tipam/pi3d — pull request #3 by Huulivoide (2012-07-09 18:26:29+00:00)
Title: rotateAroundPoint()/Object()

This simplistic function allows one to put stuff to rotate around another object or a x,y,z coordinate point in the 3D space on a real circular orbit, while maintaining constant distance. It is somewhat limit, Rotating can only happen on literal axises, although one might be able to come around that with some clever use of several instances of this same function. I am not sure If I have put the stuff on right places or not, but if you have some tips I'd really like to fix the stuff up and send another pull request, providing you find this worth it in the 1s place ^_^.

Like said it is limited and only supports rotating around the axels, but not between them. (Depending on the scene a clever rotation of the camera would fix this I think.)
Also currently orbiting object cannot have orbiters of their own. As this breaks the movement. So just Moon orbiting Earth or Earth orbiting the sun, but the no Moon orbiting Earth that orbits the sun. (I had an idea of implementing a mother child pairing for the objects in general. This meaning one could pair up objects so that when one would rotate the mother object the childs paired to it would rotate too, same thing when scaled the childs would be scaled too. But "child_object.x += 5" would only move the child and leave the mother object intact. According to my logich this should allow one to put the solar system to the screen.)

I think the ideas don't belong to this pull request but here they are any way XD.

Also here is a video of this function in use.
http://www.youtube.com/watch?v=b2M-J3LpdCg&feature=autoshare