Login  Register

Re: How to duplicate a cube and control each one independently?

Posted by gouessej on Aug 12, 2017; 12:27pm
URL: https://forum.jogamp.org/How-to-duplicate-a-cube-and-control-each-one-independently-tp4038114p4038116.html

Don't use display lists, they are half broken in numerous drivers, it's a waste of time even on very old hardware.

You can store the geometry (vertices, colors, texture coordinates, indices, normals, ...) of a cube or any more complicated model into one or several vertex buffer objects. You can use the same geometry with different transforms (rotation, translation, scale, ...). This tutorial might help you:
http://glprogramming.com/red/chapter03.html

You have to understand how the model-view matrix works, you'll need to use glLoadIdentity and maybe glMultMatrix and glLoadMatrix if you choose to store the transforms into matrices.
Julien Gouesse | Personal blog | Website