Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Nicsoft

macrumors member
Original poster
Oct 17, 2009
53
0
Stockholm
Hello,

I am trying to learn how to add several objects and working with those in my 3D-world. I am developing for iPhone. Regarding my question below I couldn't find good information about it while Googling.

What is the strategy/pattern for working with several objects in my 3D-world? I add my vertices like this: glDrawElements(GL_TRIANGLE_STRIP, 24, GL_UNSIGNED_BYTE, roomFaces);

How do I go about working with several objects that I want to handle as single entities. E.g. perhaps I have 5 objects but I only want to move or rotate one of those. Since (correct me if I am wrong) all vertices I added like above, when translating (glTranslatef) or rotating (glRotatef), all vertices for all objects will change in value, correct? The idea I'm having is that I should create some functions that concatenate all vertice arrays before sending those to OpenGL ES. When I want to move or rotate something, I do that "manually" and then send a new array of vertices to Opengl ES. But this feels like performance over-head, I would like to do this without sending the vertices all the time, just posting the changes for that object, that I want to move/rotate, to Opengl ES. Is this possible in some way? If not, what is the strategy for this?

Is there any good resources for this type of questions out there?

Thanks in advance!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.