We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › 3D Objects, Arrays, and and rotation
Page Index Toggle Pages: 1
3D Objects, Arrays, and and rotation (Read 1903 times)
3D Objects, Arrays, and and rotation
Apr 28th, 2010, 10:14pm
 
I would like to know if it is possible to have a grid of 3D objects displayed and change the rotation of one of the objects at a time. I am able to get them to all rotate together but I want to be able to click on one and have it rotate without moving the others. Thanks!!
Re: 3D Objects, Arrays, and and rotation
Reply #1 - Apr 29th, 2010, 12:33am
 
To pick one you should use the picking library from antiplastik (see this skecth http://www.openprocessing.org/visuals/?visualID=7953).
Apart from that, to do something to one object at time, you must create a Class Cube wich renders a Cube. Then, knowing for example its ID wich could be a property of it, you can call the cube via its ID or some other property wich you may have attached to it, and say: rotateY(some degrees). It should work.
Re: 3D Objects, Arrays, and and rotation
Reply #2 - Apr 29th, 2010, 2:43am
 
You might like to try the Shapes3D library, not only will it simplify the creation of a range of shapes but has an easy to use 3D picking routine plus a range of rotate methods that can be used on the selected shape.

You can see a demo of shape picking here http://www.lagers.org.uk/s3d4p/applets/s3d4p_shapepicker/index.html

Smiley
Re: 3D Objects, Arrays, and and rotation
Reply #3 - Apr 29th, 2010, 12:07pm
 
Great! Thanks for the responses. I will take a look at them and see what I can do.
Page Index Toggle Pages: 1