The equivalent to glRotatef or how to convert to Gum.

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

Moderators: cheriff, TyRaNiD

Post Reply
Pete333
Posts: 3
Joined: Thu Aug 13, 2009 1:03 am

The equivalent to glRotatef or how to convert to Gum.

Post by Pete333 »

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 :)
jsharrad
Posts: 100
Joined: Thu Oct 20, 2005 3:06 am

Post by jsharrad »

sceGumRotateX()
sceGumRotateY()
sceGumRotateZ()

Takes an angle argument in radians

sceGumRotateZYX()
sceGumRotateXYZ()

Takes a pointer to a vector containing the angles in radians
Pete333
Posts: 3
Joined: Thu Aug 13, 2009 1:03 am

Post by Pete333 »

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 :)
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

Post by jojojoris »

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: Select all

      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: Select all

int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
Pete333
Posts: 3
Joined: Thu Aug 13, 2009 1:03 am

Post by Pete333 »

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: Select all

      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.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

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.
m0skit0
Posts: 191
Joined: Tue Jun 02, 2009 8:58 pm

Post by m0skit0 »

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.
Post Reply