forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

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

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Ess



Joined: 20 Apr 2006
Posts: 16

PostPosted: Sun May 07, 2006 5:17 am    Post subject: Sample/snippet of how to rotate an image using gu functions? Reply with quote

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
View user's profile Send private message MSN Messenger
fish



Joined: 08 Feb 2006
Posts: 25

PostPosted: Sun May 07, 2006 8:44 am    Post subject: Reply with quote

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
View user's profile Send private message
PlayfulPuppy



Joined: 05 May 2006
Posts: 22

PostPosted: Sun May 07, 2006 2:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
CyberBill



Joined: 26 Jul 2005
Posts: 86
Location: Redmond, WA

PostPosted: Mon May 08, 2006 3:27 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address MSN Messenger
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Mon May 08, 2006 6:25 am    Post subject: Reply with quote

just rotate image origin (or create your own
mid point ) around the z axis
_________________
10011011 00101010 11010111 10001001 10111010
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group