[haiku-development] GLTeapot, world space rotation

  • From: Alexandre Deckner <alex@xxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 24 Feb 2008 17:56:16 +0100

Hi folks!
I've reimplemented teapot's rotation to be in world space, it means that the teapot always rotate in the direction of your mouse movement as if you really pushed it with your finger (like a trackball). What do you think?

To do so, the cleanest way was to use simple (and beautyfull) quaternion math. I took http://www.bulletphysics.com implementation (ZLib license, i think it's ok?) as i'm familiar with it (i refactored/restyled btQuaternion.h from the LinearMath library). I think i just have to put our license header above or under theirs, no?

Getting slightly off topic now... In the future, it could be nice to have a Be-ified 3d math library in a MathKit or maybe in the GameKit (that could also have a collision and dynamics library, based on Bullet as it would be the best candidate imo). For those interested, Bullet compiles with Jam (heh! must be good :-) out of the box iirc, you can check the compiled glut demos on R5 or Haiku here: http://haikubeat.free.fr/files/bullet/ (note that it was in april 2007 and there was no multi-threading at that time)

[... Bullet is a professional open source multi-threaded 3D Collision Detection and Rigid Body Dynamics Library. It is free for commercial use under the ZLib license.The library is being used by several professional game developers on PC, PlayStation 3, XBox 360 and Nintendo Wii. Sony Computer Entertainment provides a parallel SPU optimized version, and collaborations with IBM, Intel, AMD and NVidia to exploit their parallel hardware. Bullet is native part of Blender 3D modeler and it supports COLLADA Physics file format ...]

Enjoy,
Alex

Other related posts: