Page 1 of 1

pivot

Posted: Sun Sep 04, 2005 2:16 pm
by Alberto
Hello

I have been using BlizBasic for a couple of years, now I want to switch to a more sophisticated engine
Blitz provides a feature which I found very useful in many projects: pivot.
You create a pivot and you can turn any object around it.
Does Irrlicht provide something similar ?
In other words is it possible to turn an object around any axis beside local and global axis ?
Thanks in advance

Posted: Sun Sep 04, 2005 7:04 pm
by CZestmyr
Copied from the reference manual:

void rotateXYBy (f64 degrees, const vector3d< T > &center)
void rotateXZBy (f64 degrees, const vector3d< T > &center)
void rotateYZBy (f64 degrees, const vector3d< T > &center)


These are functions of a vector3df class, which represents a point in 3d space. So actually you have to specify a pivot each time you rotate a point.

With whole objects, you could get their position as vector3df, rotate this vector around the pivot and then set the vector as position. Easy enough.