Jump to content
  • Advertisement
Sign in to follow this  
JHiemstra

OpenGL normals/culling/drawing order problems with DAE import

This topic is 3500 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I'm creating a small DAE loader that takes everything from the geometry element (positions, normals, mapchannel, tristrip p elems, textcoords) and draw them using triangle_strips in OpenGL ES. As the following screenshots clearly show, I can load and draw the geometry but there's something wrong. I get the same results with all my models. http://www.iphonevalley.com/images/daetest1.jpg http://www.iphonevalley.com/images/daetest2.jpg I tried the following to solve it: - flip normals in 3D Studio Max before exporting (seems to have no effect 'at all') - enable culling with backface or frontface - change the drawing order to CW and/or drawing the tristrips in reverse order - condition the DAE with the Axis converter (Y_UP) in the Collada Refinery. - various combinations of the above I'm kinda lost as for what to try next. Can anyone here suggest other magic buttons I can push? :D I'm kinda hoping it's something simple, not collada-related because I know I'm loading the mesh info correctly, I seem to be messing up in the opengl drawing. To include some code for the sake of including some code:
		glCullFace(GL_BACK);
		glVertexPointer(3, GL_FLOAT, 0, newvertices);
		
		glEnableClientState(GL_TEXTURE_COORD_ARRAY);
		glTexCoordPointer(2, GL_FLOAT, 0, newtexcoords);
		
		glColorPointer(4, GL_UNSIGNED_BYTE, 0, squareColors);		
		glEnableClientState(GL_COLOR_ARRAY);

		glNormalPointer(GL_FLOAT, 0, newnormals);
		glEnableClientState(GL_NORMAL_ARRAY);
		
		glDrawArrays(GL_TRIANGLE_STRIP, 0, [thisStripsVertCoords count]);
Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!