Log in or register to post comments

Hi, I have a question~!

June 21, 2011 - 5:33am #1

Can you see my ficture?
In the ficture, the tower is broken.
I think color mapping is problem.
In the Teapot.h, there is Indices. But when I chang my obj file to .h, there is no indices. Remove indices from teapot.h, the teapot image was broken. How can i make indices in my obj file?
If you know, please give me some advice.

Hi, I have a question~!

October 22, 2013 - 11:50pm #6

This is about the basics of OpenGL programming, you may want to search this information in the OpenGL guide, for instance:

http://www.opengl.org/

http://www.opengl.org/wiki/Client-Side_Vertex_Arrays

 

Hi, I have a question~!

October 22, 2013 - 7:12pm #5
Thanks too. So, my question is about the .h file:
 
Now i am using glDrawArrays instead of glDrawElements, 
but i do not know what is the diference between this functions ...
 
So ...
What is Vertices? Why NUM_CUBE_OBJECT_VERTEX * 3? Why 3?
What is Normals? Why NUM_CUBE_OBJECT_VERTEX * 3? Why 3?
What is TexCoords? Why NUM_CUBE_OBJECT_VERTEX * 2? Why 2?
What is Indices? Why NUM_CUBE_OBJECT_INDEX 1024 * 3? Why 1024 * 3?
 
Please explain to me the elements from the .h file.
Thanks!!!!
=]
 

Re: Hi, I have a question~!

June 21, 2011 - 6:00am #4

Models are typically built out of either quads (rectangles) or triangles. If your model is built out of quads you can use a 3D modeling tool to "triangulate" it, or break each quad into two triangles. This will be required for rendering with OpenGL ES.

If you don't have a modeling program, you might try Blender (it's free). There are plenty of resources available online to help you triangulate your model.

- Kim

Re: Hi, I have a question~!

June 21, 2011 - 5:50am #3

um.... sorry..
What is 'triangulated'?

Re: Hi, I have a question~!

June 21, 2011 - 5:41am #2

You don't necessarily need indices. If you have them, you use the glDrawElements() function. If you don't, use the glDrawArrays() function.

It looks like your model needs to be triangulated, OpenGL ES cannot render quads.

- Kim

Log in or register to post comments