Matrixes??
Matrixes??
Is anyone here comfortable with matrixes? Or can give me a link where they are explained? Preferably in German ^^
In english:
http://www.cprogramming.com/advtutorial.html -look at Rotations in Three Dimensions by Confuted and Silvercord
http://www.j3d.org/matrix_faq/matrfaq_latest.html
http://skal.planet-d.net/demo/matrixfaq.htm
http://sjbaker.org/steve/omniv/eulers_are_evil.html
http://www.cprogramming.com/advtutorial.html -look at Rotations in Three Dimensions by Confuted and Silvercord
http://www.j3d.org/matrix_faq/matrfaq_latest.html
http://skal.planet-d.net/demo/matrixfaq.htm
http://sjbaker.org/steve/omniv/eulers_are_evil.html
Ok i think i'm slowly getting the hang out of it but i've got a problem.
I've got an object and i want to rotate it around an other object. The problem that occurs is that the object either only rotates around its own axis or it (by using setParent the transformation is relative to the parent i used sedParent for this second method) is on the same place like the object that it should turn around, (when i use setParent) but it shuld be somewhere else and should use that spot only as axis.
I hope you understand what i wanted to describe. It's kinda difficult to describe (at least for me).
I've got an object and i want to rotate it around an other object. The problem that occurs is that the object either only rotates around its own axis or it (by using setParent the transformation is relative to the parent i used sedParent for this second method) is on the same place like the object that it should turn around, (when i use setParent) but it shuld be somewhere else and should use that spot only as axis.
I hope you understand what i wanted to describe. It's kinda difficult to describe (at least for me).
-
Guest
r2d2>> when you set one node to be child of another, you have to set its offset then.
this example shovs hove to make light to be child of another node and you can do it similar with any other node:
node is parent
vector3df(0,0,-5) is offset
this example shovs hove to make light to be child of another node and you can do it similar with any other node:
Code: Select all
light = smgr->addLightSceneNode(node, core::vector3df(0,0,-5), SColorf(1.0f, 0.5f, 0.0f, 1.0f), 10.0f);vector3df(0,0,-5) is offset
Well sorry guys but there seems to be some bugs in the engine. The getRelativeTransformation() = matrix command doesn't have any effect. (the parent is set!). Second the rotation is not around the parent it is around the own axis
shouldn't the object be rotated and then translated?
he seems to translate first and then he rotates
shouldn't the object be rotated and then translated?
he seems to translate first and then he rotates
r2d2>> when you set something childof something else than you use parent to manipulate child.
Means if you rotate child than it rotates around own axis. But if you rotate parent you rotate child around.
Also dont forget that there is virtual ISceneNode* irr::scene::ISceneManager::addEmptySceneNode which create empty node you can use as parent.
for example:
You have planet node and you have moon node, you want to have moon rotate around planet.
you create empty node and make it child of planet, then you make moon child of empty node and ofset its position so graph would look like this:
planet .empty -moon
if you rotate empty node, you rotate moon around planet in fact.
Of course there is problem that if you rotate planet, you rotate moon too but that you can rid by simply not making empty node child of planet but instead keeping its position at the planet position.
Means if you rotate child than it rotates around own axis. But if you rotate parent you rotate child around.
Also dont forget that there is virtual ISceneNode* irr::scene::ISceneManager::addEmptySceneNode which create empty node you can use as parent.
for example:
You have planet node and you have moon node, you want to have moon rotate around planet.
you create empty node and make it child of planet, then you make moon child of empty node and ofset its position so graph would look like this:
planet .empty -moon
if you rotate empty node, you rotate moon around planet in fact.
Of course there is problem that if you rotate planet, you rotate moon too but that you can rid by simply not making empty node child of planet but instead keeping its position at the planet position.