[SOLVED]Rotation about the center of a mesh

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
wsw1231
Posts: 148
Joined: Fri Oct 01, 2010 7:55 am

[SOLVED]Rotation about the center of a mesh

Post by wsw1231 »

How to set rotation of an object about its center or about one specific point?
Last edited by wsw1231 on Mon Feb 07, 2011 6:06 am, edited 1 time in total.
wsw1231
Posts: 148
Joined: Fri Oct 01, 2010 7:55 am

Post by wsw1231 »

I ask this question because the rotation looks strange when I rotate an imported object.
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

What do you mean by 'the rotation looks strange'?

The model you imported probably didn't have its center at the scene origin, so it will rotate around its relative origin inside irrlicht
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

You could add the node to a dummy transformation node or even transform the vertices manually, but as Radikalizm said it's probably better to just move the mesh in an editor and save it again.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
wsw1231
Posts: 148
Joined: Fri Oct 01, 2010 7:55 am

Post by wsw1231 »

Radikalizm wrote:What do you mean by 'the rotation looks strange'?

The model you imported probably didn't have its center at the scene origin, so it will rotate around its relative origin inside irrlicht
How should I adjust the position of the center of the mesh to the scene origin in 3DS MAX?

Is there any better way to do that other than using 3DS MAX?
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

wsw1231 wrote:
Radikalizm wrote:What do you mean by 'the rotation looks strange'?

The model you imported probably didn't have its center at the scene origin, so it will rotate around its relative origin inside irrlicht
How should I adjust the position of the center of the mesh to the scene origin in 3DS MAX?

Is there any better way to do that other than using 3DS MAX?
Just set x, y and z components of the position vector of your mesh to 0 in max, or depending on the mesh, you can set the z value so the base of the mesh is at 0 (the z-axis in max is the same as the y-axis in irrlicht)
Post Reply