Log in or register to post comments

unable to load new objects

November 16, 2011 - 6:38am #1

hello there,

i was following a couple of guidelines to get other 3d objects into my scene. i created an obj file and used the perl script to get a .h version.
after that i modified the opengl stuff as discribed in a few posts on the forum.

the problem is thou: i just don't see any objects on my codes now.

is there an official guide on how to load new objects into my program? and while i am at it: is there a howto on how to import 3 new objects and display them on different codes?

thanks in advance.

Re: unable to load new objects

December 5, 2011 - 3:01am #6

Phillip Rideout's book is here:

iPhone 3D Programming - Developing Graphical Applications with OpenGL ES

And Jeff Lamarche's blog is here:

iPhone Development - Application Development for the iPhone using Apple's official SDK

In the second you'll have to search out his OpenGL samples, but it's worth it. here's a lead:

Blender 2.57 Objective-C Export Script

Re: unable to load new objects

December 3, 2011 - 3:45pm #5

can you point me to that guides? i fail at google in this case :(

Re: unable to load new objects

December 2, 2011 - 5:33am #4

Jeff Lamarche's articles show you how to use a Python script to write .h files out from Blender, although I can't remember if they showed you how to determine the indices.

To draw with vertex data without indices you'll need to use 'glDrawArrays' which doesn't use an indices array but just the list of vertices set up in 'glVertexPointer' - see Phil Rideout's introduction for more info.

All of this is well set out by Lamarche and Rideout - I strongly recommend reading their excellent guides.

Re: unable to load new objects

December 2, 2011 - 4:55am #3

i am using this script: http://heikobehrens.net/2009/08/27/obj2opengl/

this creates a c file from my obj.

i am now able to load the object itself but the textures are giving me troubles. in the sample code is this line:

glDrawElements(GL_TRIANGLES, NUM_TEAPOT_OBJECT_INDEX, GL_UNSIGNED_SHORT, (const GLvoid*)&teapotIndices[0]);

the problem is: the c file i get has no ...Indices array in it. all other arrays like normals and texcoords are available.

is there a better way to creat the c files from obj files? the obj files themselves i get from blender.

Re: unable to load new objects

November 17, 2011 - 2:49am #2

The samples give an example of using OpenGL and simple 3D models oriented by the AR-derived pose - please refer to 3rd party articles and blogs about 3D model creation and integration with OpenGL on iOS and Android.

The two resources I use are "iPhone 3D Programming" by Philip Rideout and the blog by Jeff Lamarche.

Maybe other forum members would be willing to provide assistance.

Log in or register to post comments