Loading 'indices' from Wavefront OBJ format

Problems with Canvas, OpenGL, etc...

Loading 'indices' from Wavefront OBJ format

Postby VansFannel » Fri Dec 03, 2010 2:57 pm

Hello.

I'm developing an Android application with OpenGL ES 2.0.

I want to load an export made with Blender 2.49b in Wavefront OBJ format. I have identified verxtex position, normal and texture.

I want to use glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) to draw my mesh but I don't know how I can obtain the last parameter, indices, from a Wavefront OBJ file.

Are faces the 'indices' that I'm looking for?

I've found this on a forum:
faces = indices starting with 1!

What is the meaning of 'starting with 1!'?

Thanks.
VansFannel
Freshman
Freshman
 
Posts: 7
Joined: Fri Dec 03, 2010 2:49 pm

Top

Re: Loading 'indices' from Wavefront OBJ format

Postby SilverLogic » Sun Dec 05, 2010 8:22 am

Yes, the indices are the faces.

"Starting with 1" is just referring to the fact that the OBJ format is 1-based, not 0 based like you'd expect an array to normally be. (so the first batch of vertex information would be referenced to as 1 in the face definitions)
User avatar
SilverLogic
Junior Developer
Junior Developer
 
Posts: 10
Joined: Thu Oct 21, 2010 10:31 pm

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 2 guests