pivot

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Alberto

pivot

Post 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
CZestmyr
Posts: 72
Joined: Sat Feb 12, 2005 7:11 pm
Location: Czech Republic
Contact:

Post 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.
Post Reply