| View previous topic :: View next topic |
| Author |
Message |
Pete333
Joined: 13 Aug 2009 Posts: 3
|
Posted: Thu Aug 13, 2009 1:28 am Post subject: The equivalent to glRotatef or how to convert to Gum. |
|
|
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 |
|
 |
jsharrad
Joined: 20 Oct 2005 Posts: 102
|
Posted: Thu Aug 13, 2009 3:41 am Post subject: |
|
|
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 |
|
 |
Pete333
Joined: 13 Aug 2009 Posts: 3
|
Posted: Thu Aug 13, 2009 3:55 am Post subject: |
|
|
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 |
|
 |
jojojoris
Joined: 30 Mar 2008 Posts: 261
|
Posted: Thu Aug 13, 2009 5:42 am Post subject: |
|
|
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 |
|
 |
Pete333
Joined: 13 Aug 2009 Posts: 3
|
Posted: Thu Aug 13, 2009 5:57 am Post subject: |
|
|
| 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 |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Thu Aug 13, 2009 10:56 pm Post subject: |
|
|
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 |
|
 |
m0skit0
Joined: 02 Jun 2009 Posts: 226
|
Posted: Fri Aug 14, 2009 12:27 am Post subject: |
|
|
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 |
|
 |
|