(Demo) Rings of Cubes


GeeXLab - rings - cubes - OpenGL



Here is a small demo that shows how to use hierarchy to create groups of objects that can be handled more easily than individual objects. Each ring is a group made up of cubes and all rings are grouped in a single object. Actually there is another level of hierarchy because each ring is a child of another object called a pivot. And all pivots are grouped in the global object:


GeeXLab - rings - cubes - hierarchy diagram

 
Without this organization, it would be hard to animate the rings…

The original idea comes from this tweet where 8 rings of 16 cubes are animated. I found the animation interesting and I decided to code it with GeeXLab in Lua.

The demo is available in OpenGL 2.1 so it can run on the Raspberry Pi too (an OpenGL 3.2 is also available but does not bring nothing interesting). As usual, just drag-and-drop the demo (main_gl21.xml) into GeeXLab and enjoy.



 
The first version of the demo: 8 rings, and 16 cubes per ring (like the source demo):


GeeXLab - rings - cubes - OpenGL

 
Since all rings are procedural, we can tweak the generation of the ring:

8 rings and 32 cubes per ring


GeeXLab - rings - cubes - OpenGL

 
The same demo on the Raspberry Pi:


GeeXLab - rings - cubes - OpenGL - Raspberry Pi

 

8 rings and 64 cubes per ring


GeeXLab - rings - cubes - OpenGL

 

16 rings and 32 cubes per ring


GeeXLab - rings - cubes - OpenGL

 
The same demo on the Raspberry Pi:


GeeXLab - rings - cubes - OpenGL - Raspberry Pi

 

16 rings and 64 cubes per ring


GeeXLab - rings - cubes - OpenGL

 

32 rings and 64 cubes per ring


GeeXLab - rings - cubes - OpenGL





Leave a Comment

Your email address will not be published. Required fields are marked *