Rotate the cube

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
Jekano
Posts: 7
Joined: Thu Oct 12, 2006 9:21 pm

Rotate the cube

Post by Jekano »

Can you tell me how correct use function rotate?
I create cube, convert him to .obj format.

Load mesh and try rotate:

Code: Select all

core::vector3df b = node->getRotation();
b.Y += 90.0f;
node->setRotation(b);
Item rotate, but cube rotate around vertex.

But I need rotate cube around center. How do it?

P.S. At editor I change Pivot to center and one of vertex. Rusult equal.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

the exporter probably exports from the origin (0,0,0) rather than the pivot. try moving the centre of the cube to the origin
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Jekano
Posts: 7
Joined: Thu Oct 12, 2006 9:21 pm

Post by Jekano »

I tried. And it's worked!!!
Great thx!
Post Reply