Matrixes??

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.
r2d2
Posts: 211
Joined: Mon Nov 24, 2003 5:22 pm

Matrixes??

Post by r2d2 »

Is anyone here comfortable with matrixes? Or can give me a link where they are explained? Preferably in German ^^
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

joy
Posts: 124
Joined: Tue Apr 27, 2004 9:15 am
Location: Germany

Post by joy »

For more advanced Matrixtransformation:

http://www.rz.uni-bayreuth.de/lehre/dib ... ode48.html
biotech
Posts: 37
Joined: Sat Jan 31, 2004 1:46 pm

Post by biotech »

plural of matrix is matrices not matrixes,
also plural of vertex is vertices.
ich bin ein berliner
r2d2
Posts: 211
Joined: Mon Nov 24, 2003 5:22 pm

Post by r2d2 »

whoops i haven't watched out pushed the wrong button the x and the c are next to each other on my keaboard (german layout) and i think on the american too


thx for all the links but they seem really complicated
biotech
Posts: 37
Joined: Sat Jan 31, 2004 1:46 pm

Post by biotech »

he he,c is nect to x
hehe!
ich bin ein berliner
joy
Posts: 124
Joined: Tue Apr 27, 2004 9:15 am
Location: Germany

Post by joy »

If you never haven worked with matrices before, it is a bunch of work to get into it. But there are some good books and websites where you need to get into it. There is no explaination in half a page.
r2d2
Posts: 211
Joined: Mon Nov 24, 2003 5:22 pm

Post by r2d2 »

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).
Guest

Post by Guest »

Isn't that kind of rotation more an animation around the other object? Because ohterwise there must be a function to set the axis and I have not heard about it.
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

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:

Code: Select all

light = smgr->addLightSceneNode(node, core::vector3df(0,0,-5), SColorf(1.0f, 0.5f, 0.0f, 1.0f), 10.0f);
node is parent
vector3df(0,0,-5) is offset
r2d2
Posts: 211
Joined: Mon Nov 24, 2003 5:22 pm

Post by r2d2 »

so if i understood that right you have to reset the position after/while setting it as child?
If yes then i know where my failure lies
thx very much i wasn't sure about that
r2d2
Posts: 211
Joined: Mon Nov 24, 2003 5:22 pm

Post by r2d2 »

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
mr guest

Post by mr guest »

you should tell this bug to Niko.... :(
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

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.
r2d2
Posts: 211
Joined: Mon Nov 24, 2003 5:22 pm

Post by r2d2 »

And if there should be another object rotating around the moon i only have to add another empty scene node and the object?
Post Reply