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 

The equivalent to glRotatef or how to convert to Gum.

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



Joined: 13 Aug 2009
Posts: 3

PostPosted: Thu Aug 13, 2009 1:28 am    Post subject: The equivalent to glRotatef or how to convert to Gum. Reply with quote

I'm pretty new to all this so please forgive me is this is a stupid question...

I have some GL code which I want to convert to Gum.

glPushMatrix();
glRotatef( Angle, 0.0f, 0.0f, 1.0f );

So far I have got this far:

sceGumPushMatrix();

but I can see no equivalent for glRotatef.

As I said, I'm pretty new to all this but I want to give programming the PSP a go, just for the fun without using OPEN GL. Thanks for any help :)
Back to top
View user's profile Send private message
jsharrad



Joined: 20 Oct 2005
Posts: 102

PostPosted: Thu Aug 13, 2009 3:41 am    Post subject: Reply with quote

sceGumRotateX()
sceGumRotateY()
sceGumRotateZ()

Takes an angle argument in radians

sceGumRotateZYX()
sceGumRotateXYZ()

Takes a pointer to a vector containing the angles in radians
Back to top
View user's profile Send private message
Pete333



Joined: 13 Aug 2009
Posts: 3

PostPosted: Thu Aug 13, 2009 3:55 am    Post subject: Reply with quote

I think I get this now, so my example needs to become this:

sceGumPushMatrix();
sceGumRotateZ(Angle*PI/180.0f);

I'm still pretty new to 3D so forgive my own ineptness :)
Back to top
View user's profile Send private message
jojojoris



Joined: 30 Mar 2008
Posts: 261

PostPosted: Thu Aug 13, 2009 5:42 am    Post subject: Reply with quote

Take a look at the sdk GU samples.

sdkdir/psp/sdk/samples/gu/...

You can best start with the cube sample since thiis is the simplest.

you will see sometging like this:

Code:
      sceGumMatrixMode(GU_MODEL);
      sceGumLoadIdentity();
      {
         ScePspFVector3 pos = { 0, 0, -2.5f };
         ScePspFVector3 rot = { 2, 2, 2};
         sceGumTranslate(&pos);
         sceGumRotateXYZ(&rot);
      }


That is a bit how you do it with the GU. (I don't know how it is done with OpenGL)
_________________
Code:
int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
Back to top
View user's profile Send private message
Pete333



Joined: 13 Aug 2009
Posts: 3

PostPosted: Thu Aug 13, 2009 5:57 am    Post subject: Reply with quote

jojojoris wrote:
Take a look at the sdk GU samples.

sdkdir/psp/sdk/samples/gu/...

You can best start with the cube sample since thiis is the simplest.

you will see sometging like this:

Code:
      sceGumMatrixMode(GU_MODEL);
      sceGumLoadIdentity();
      {
         ScePspFVector3 pos = { 0, 0, -2.5f };
         ScePspFVector3 rot = { 2, 2, 2};
         sceGumTranslate(&pos);
         sceGumRotateXYZ(&rot);
      }


That is a bit how you do it with the GU. (I don't know how it is done with OpenGL)


Thanks :) I'll take a look at the examples. I'll refrain from posting until I really get stuck.
Back to top
View user's profile Send private message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Thu Aug 13, 2009 10:56 pm    Post subject: Reply with quote

I've written a little demo with a sample where triangles are defined at the
start of the program with a list of vertices in big arrays.

Where is the code to create a triangle at runtime?
_________________
If not actually, then potentially.
Back to top
View user's profile Send private message
m0skit0



Joined: 02 Jun 2009
Posts: 226

PostPosted: Fri Aug 14, 2009 12:27 am    Post subject: Reply with quote

Just fill those arrays at runtime :P
_________________
The Incredible Bill Gates wrote:
The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
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