#88960 - ikaris - Thu Jun 22, 2006 2:49 pm
Hello everyone,
my Maya Display List Exporter is up and running (I'll release a version once I get an answer to this question ! I want to make sure I'm not doing something wrong...)
If I export a triangle, it works fine. I can rotate it on the DS hardware and it works great. (I'm not using an emu for these tests)
I downloaded the latest version of devkitpro about a week ago, so I think I'm up to date.
If I export anything more than a triangle (i.e. a quad, i.e. two triangle, a cube, etc...) the object rotates normally, then the geometry gets distorted and then the DS crashes.
Here are some examples of some display lists generated by my exporter... can anyone see anything wrong ?
Triangle (this one works !)
Quad (crashes after a half second...)
Cube (also crashes...)
Essentially all I've done is modified the code for the Display List 1 example, and included the .h file... I also added a zoom function with the shoulder buttons... here's the source in case anyone's interested...
Help ! Thanks !
Last edited by ikaris on Thu Jun 22, 2006 5:44 pm; edited 1 time in total
my Maya Display List Exporter is up and running (I'll release a version once I get an answer to this question ! I want to make sure I'm not doing something wrong...)
If I export a triangle, it works fine. I can rotate it on the DS hardware and it works great. (I'm not using an emu for these tests)
I downloaded the latest version of devkitpro about a week ago, so I think I'm up to date.
If I export anything more than a triangle (i.e. a quad, i.e. two triangle, a cube, etc...) the object rotates normally, then the geometry gets distorted and then the DS crashes.
Here are some examples of some display lists generated by my exporter... can anyone see anything wrong ?
Triangle (this one works !)
Code: |
u32 callList[] = { 9, FIFO_COMMAND_PACK(FIFO_BEGIN, FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16), GL_TRIANGLE, VERTEX_PACK(inttov16(0),inttov16(0)), VERTEX_PACK(inttov16(0),0), VERTEX_PACK(inttov16(-1),inttov16(0)), VERTEX_PACK(inttov16(0),0), VERTEX_PACK(inttov16(0),inttov16(0)), VERTEX_PACK(inttov16(-1),0), FIFO_COMMAND_PACK(FIFO_END, FIFO_NOP, FIFO_NOP, FIFO_NOP), }; |
Quad (crashes after a half second...)
Code: |
u32 callList[] = { 18, FIFO_COMMAND_PACK(FIFO_BEGIN, FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16), GL_TRIANGLE, VERTEX_PACK(inttov16(0),inttov16(0)), VERTEX_PACK(inttov16(0),0), VERTEX_PACK(inttov16(-1),inttov16(0)), VERTEX_PACK(inttov16(0),0), VERTEX_PACK(inttov16(0),inttov16(0)), VERTEX_PACK(inttov16(-1),0), FIFO_COMMAND_PACK(FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16, FIFO_END), VERTEX_PACK(inttov16(-1),inttov16(0)), VERTEX_PACK(inttov16(0),0), VERTEX_PACK(inttov16(-1),inttov16(0)), VERTEX_PACK(inttov16(-1),0), VERTEX_PACK(inttov16(0),inttov16(0)), VERTEX_PACK(inttov16(-1),0), }; |
Cube (also crashes...)
Code: |
u32 callList[] = { 108, FIFO_COMMAND_PACK(FIFO_BEGIN, FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16), GL_TRIANGLE, VERTEX_PACK(inttov16(-1),inttov16(-1)), VERTEX_PACK(inttov16(1),0), VERTEX_PACK(inttov16(1),inttov16(-1)), VERTEX_PACK(inttov16(1),0), VERTEX_PACK(inttov16(-1),inttov16(1)), VERTEX_PACK(inttov16(1),0), FIFO_COMMAND_PACK(FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16), VERTEX_PACK(inttov16(1),inttov16(-1)), VERTEX_PACK(inttov16(1),0), VERTEX_PACK(inttov16(1),inttov16(1)), VERTEX_PACK(inttov16(1),0), VERTEX_PACK(inttov16(-1),inttov16(1)), VERTEX_PACK(inttov16(1),0), VERTEX_PACK(inttov16(-1),inttov16(1)), VERTEX_PACK(inttov16(1),0), FIFO_COMMAND_PACK(FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16), VERTEX_PACK(inttov16(1),inttov16(1)), VERTEX_PACK(inttov16(1),0), VERTEX_PACK(inttov16(-1),inttov16(1)), VERTEX_PACK(inttov16(-1),0), VERTEX_PACK(inttov16(1),inttov16(1)), VERTEX_PACK(inttov16(1),0), VERTEX_PACK(inttov16(1),inttov16(1)), VERTEX_PACK(inttov16(-1),0), FIFO_COMMAND_PACK(FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16), VERTEX_PACK(inttov16(-1),inttov16(1)), VERTEX_PACK(inttov16(-1),0), VERTEX_PACK(inttov16(-1),inttov16(1)), VERTEX_PACK(inttov16(-1),0), VERTEX_PACK(inttov16(1),inttov16(1)), VERTEX_PACK(inttov16(-1),0), VERTEX_PACK(inttov16(-1),inttov16(-1)), VERTEX_PACK(inttov16(-1),0), FIFO_COMMAND_PACK(FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16), VERTEX_PACK(inttov16(1),inttov16(1)), VERTEX_PACK(inttov16(-1),0), VERTEX_PACK(inttov16(1),inttov16(-1)), VERTEX_PACK(inttov16(-1),0), VERTEX_PACK(inttov16(-1),inttov16(-1)), VERTEX_PACK(inttov16(-1),0), VERTEX_PACK(inttov16(-1),inttov16(-1)), VERTEX_PACK(inttov16(-1),0), FIFO_COMMAND_PACK(FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16), VERTEX_PACK(inttov16(1),inttov16(-1)), VERTEX_PACK(inttov16(-1),0), VERTEX_PACK(inttov16(-1),inttov16(-1)), VERTEX_PACK(inttov16(1),0), VERTEX_PACK(inttov16(1),inttov16(-1)), VERTEX_PACK(inttov16(-1),0), VERTEX_PACK(inttov16(1),inttov16(-1)), VERTEX_PACK(inttov16(1),0), FIFO_COMMAND_PACK(FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16), VERTEX_PACK(inttov16(-1),inttov16(-1)), VERTEX_PACK(inttov16(1),0), VERTEX_PACK(inttov16(1),inttov16(-1)), VERTEX_PACK(inttov16(1),0), VERTEX_PACK(inttov16(1),inttov16(-1)), VERTEX_PACK(inttov16(-1),0), VERTEX_PACK(inttov16(1),inttov16(1)), VERTEX_PACK(inttov16(1),0), FIFO_COMMAND_PACK(FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16), VERTEX_PACK(inttov16(1),inttov16(-1)), VERTEX_PACK(inttov16(-1),0), VERTEX_PACK(inttov16(1),inttov16(1)), VERTEX_PACK(inttov16(-1),0), VERTEX_PACK(inttov16(1),inttov16(1)), VERTEX_PACK(inttov16(1),0), VERTEX_PACK(inttov16(-1),inttov16(-1)), VERTEX_PACK(inttov16(-1),0), FIFO_COMMAND_PACK(FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16, FIFO_VERTEX16), VERTEX_PACK(inttov16(-1),inttov16(-1)), VERTEX_PACK(inttov16(1),0), VERTEX_PACK(inttov16(-1),inttov16(1)), VERTEX_PACK(inttov16(-1),0), VERTEX_PACK(inttov16(-1),inttov16(-1)), VERTEX_PACK(inttov16(1),0), VERTEX_PACK(inttov16(-1),inttov16(1)), VERTEX_PACK(inttov16(1),0), FIFO_COMMAND_PACK(FIFO_VERTEX16, FIFO_END, FIFO_NOP, FIFO_NOP), VERTEX_PACK(inttov16(-1),inttov16(1)), VERTEX_PACK(inttov16(-1),0), }; |
Essentially all I've done is modified the code for the Display List 1 example, and included the .h file... I also added a zoom function with the shoulder buttons... here's the source in case anyone's interested...
Code: |
#include <nds.h> #include "callList.h" int main() { float rotateX = 0.0; float rotateY = 0.0; float zoom = -1; powerON(POWER_ALL); //set mode 0, enable BG0 and set it to 3D videoSetMode(MODE_0_3D); //this should work the same as the normal gl call glViewPort(0,0,255,191); glClearColor(255,0,0); glClearDepth(0x7FFF); while(1) { //any floating point gl call is being converted to fixed prior to being implemented gluPerspective(35, 256.0 / 192.0, 0.1, 40); gluLookAt( 0.0, 0.0, 1.0, //camera possition 0.0, 0.0, 0.0, //look at 0.0, 1.0, 0.0); //up glPushMatrix(); //move it away from the camera glTranslate3f32(0, 0, floattof32(zoom)); glRotateX(rotateX); glRotateY(rotateY); glMatrixMode(GL_TEXTURE); glIdentity(); glMatrixMode(GL_MODELVIEW); //not a real gl function and will likely change glPolyFmt(POLY_ALPHA(31) | POLY_CULL_NONE); scanKeys(); u16 keys = keysHeld(); if((keys & KEY_UP)) rotateX += 3; if((keys & KEY_DOWN)) rotateX -= 3; if((keys & KEY_LEFT)) rotateY += 3; if((keys & KEY_RIGHT)) rotateY -= 3; if((keys & KEY_R)) zoom -= 0.1; if((keys & KEY_L)) zoom += 0.1; glCallList(callList); glPopMatrix(1); glFlush(); } return 0; }//end main |
Help ! Thanks !
Last edited by ikaris on Thu Jun 22, 2006 5:44 pm; edited 1 time in total