PDA

View Full Version : Cube Rendering



JMoore
09-21-2010, 10:22 AM
I'll do my best to keep this short and to the point, for my benefit and for yours :)

I'm writing an application for Android that reads .GML files which contain model data for urban landscapes. It's formatted much like an XML file and gives a list of coordinates for the vertices of each face that makes up a building.

So a simpler question that will lead me on my way is: given an array of 3D-coordinates, how do I render out the object without having an indice list? From a few tutorials I've taken, I understand that geometry is constructed from triangles, generally connecting vertices in a counterclockwise manner.

I'm not sure how to render a shape given just coordinates, and no indice list.

Thanks for the help!

Dark Photon
09-21-2010, 06:42 PM
given an array of 3D-coordinates, how do I render out the object without having an indice list
An index list is used by glDrawElements*() calls.

So use glDrawArrays(), which doesn't require an index list.

The first argument specifies how to interpret your vertex data (TRIANGLES [groups of 3], QUADS [groups of 4], etc.)