Total n00b question, but I haven't been able to figure this out.
It appears that ISceneNode::setRotation() rotates the object around the center of the bounding box (as near as I can tell). How do I go about changing this, so it rotates around some other arbitrary point?
Thanks in advance!
changing the axis of rotation?
-
- Posts: 31
- Joined: Thu Jun 07, 2007 6:23 pm
- Location: New York
- Contact:
What type of visual effect are you trying to achieve? I'm not following your question exactly; a rotation about a point in space (outside of the mesh's BB) or a rotation about a different point within a mesh's BB?
Computer scientist by day...
http://www.mrjoelkemp.com
http://www.mrjoelkemp.com
-
- Posts: 15
- Joined: Sun Feb 24, 2008 4:27 am
The second one, rotation around a different point within the mesh (not necessarily a vertex).Jgoldnight wrote:What type of visual effect are you trying to achieve? I'm not following your question exactly; a rotation about a point in space (outside of the mesh's BB) or a rotation about a different point within a mesh's BB?
Basically, the mesh is a head. When it nods forward (rotating along the X axis), the origin it rotates around should be the base of the spine, not the center of the head.
Re: changing the axis of rotation?
that's not correct...scotchfaster wrote:It appears that ISceneNode::setRotation() rotates the object around the center of the bounding box (as near as I can tell).
it rotates around it's origin !!!
the origin is a point you define in your 3d modeling tool...
but this also depends on the tool you're using, for example with Milkshape3d the origin of the mesh is the point at 0,0,0 in the space of Milkshape, or with 3DSMax you can define the origin at any point in space you want...
the easiest way for what you want to do is to create the mesh so its origin is at the point where the neck shall rotate...
or you create one or more bones, one bone should be at the desired position so you can rotate the bone to rotate the head around this point...
of course you also can rotate a node around any point in space you want, for an algorythm to do this search the forum, there are some threads about this...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
-
- Posts: 15
- Joined: Sun Feb 24, 2008 4:27 am
Hmmm...I'm not creating these meshes myself, but importing them. They are in 3DS format, but I don't see an "origin" field anywhere.
In any case, it does appear that it rotates around (0,0,0), and so my very simple solution is to offset the vertices of the mesh.
And yes, I realize that a better model would involve a torso with the head attached and using a hinge, but that's overkill for this application.
Thanks for the help!
In any case, it does appear that it rotates around (0,0,0), and so my very simple solution is to offset the vertices of the mesh.
And yes, I realize that a better model would involve a torso with the head attached and using a hinge, but that's overkill for this application.
Thanks for the help!
right, (0,0,0) of the mesh is it's pivot/origin, but it must not be the centre of the mesh/bounding box...scotchfaster wrote:Hmmm...I'm not creating these meshes myself, but importing them. They are in 3DS format, but I don't see an "origin" field anywhere.
In any case, it does appear that it rotates around (0,0,0), and so my very simple solution is to offset the vertices of the mesh.
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java