| View previous topic :: View next topic |
| Author |
Message |
Ess
Joined: 20 Apr 2006 Posts: 16
|
Posted: Sun May 07, 2006 5:17 am Post subject: Sample/snippet of how to rotate an image using gu functions? |
|
|
| I'm hoping someone can help me get an image so rotate using gu. Some code snippets or even just the function i'm supposed to use (with parameters, please) would be greatly appreciated. |
|
| Back to top |
|
 |
fish
Joined: 08 Feb 2006 Posts: 25
|
Posted: Sun May 07, 2006 8:44 am Post subject: |
|
|
if you're rendering it vertex by vertex, (TRIANGLE_STRIP/TRIANGLE_FAN etc)
sceGumRotateZ(valueInRads);
is what you need, although if you know about vertices you'd probably know about transformation matrices too.
if you're rendering SPRITES on the other hand, basically, you cant, SPRITEs are always screen aligned. |
|
| Back to top |
|
 |
PlayfulPuppy
Joined: 05 May 2006 Posts: 22
|
Posted: Sun May 07, 2006 2:56 pm Post subject: |
|
|
| fish wrote: | | if you're rendering SPRITES on the other hand, basically, you cant, SPRITEs are always screen aligned. |
Although you should be able to rotate the image by rotating the texture coordinates via a texture matrix.
However I haven't tried this. |
|
| Back to top |
|
 |
CyberBill
Joined: 26 Jul 2005 Posts: 86 Location: Redmond, WA
|
Posted: Mon May 08, 2006 3:27 am Post subject: |
|
|
Rotating texture coordintaes would not give the desired effect...
Edges would be cut off, because the image on the screen is still square at all times.
To make sprites rotate, you need to stop using sprites and start using quads... vertex and matrix time. :) |
|
| Back to top |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Mon May 08, 2006 6:25 am Post subject: |
|
|
just rotate image origin (or create your own
mid point ) around the z axis _________________ 10011011 00101010 11010111 10001001 10111010 |
|
| Back to top |
|
 |
|