Sample/snippet of how to rotate an image using gu functions?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Ess
Posts: 16
Joined: Thu Apr 20, 2006 8:16 am

Sample/snippet of how to rotate an image using gu functions?

Post by Ess »

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.
fish
Posts: 25
Joined: Wed Feb 08, 2006 5:12 am

Post by fish »

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.
PlayfulPuppy
Posts: 22
Joined: Fri May 05, 2006 12:04 am

Post by PlayfulPuppy »

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.
CyberBill
Posts: 86
Joined: Tue Jul 26, 2005 3:53 pm
Location: Redmond, WA

Post by CyberBill »

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. :)
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

just rotate image origin (or create your own
mid point ) around the z axis
10011011 00101010 11010111 10001001 10111010
Post Reply