Have a Problem..

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
Axel186
Posts: 15
Joined: Thu May 24, 2007 2:54 pm
Location: Israel

Have a Problem..

Post by Axel186 »

Hi =), it's my first msg here =).

The problem is:
I have a map, room witch have 2 chairs and one table. Now, how can I move or rotate one of chairs or table?

I think it's calling 'childs', but I am not sure.

Waiting for answer....
Image
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

hmm... i gues you have room and two chairs as one mesh. if so - you cant move or rotate them. If you want to control objects then create separate nodes, use separate meshes. to move node use node->setPosition() or node->setPos() (dont remember), to rotate - node->setRotation()
Axel186
Posts: 15
Joined: Thu May 24, 2007 2:54 pm
Location: Israel

Post by Axel186 »

Is not one mesh but it's one file... So what other thinks?
Image
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

one file - one mesh :) you cant load several different meshes from one file
Axel186
Posts: 15
Joined: Thu May 24, 2007 2:54 pm
Location: Israel

Post by Axel186 »

hmm... ok.. other example..
In 3dmax I create car, one mesh is the body and another 4 meshes is the wheels... Exporting... and now is the problem... How can I turn only the wheels and not all car?
Image
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

What Roxas is saying is Irrlicht will treat all your objects as one mesh.

You need to export a wheel and the car separately. Load the car and make a Node with it. Load the wheel and make four wheel Nodes as children to the car Node. Then you can go crazy with all the rotation you like.
Axel186
Posts: 15
Joined: Thu May 24, 2007 2:54 pm
Location: Israel

Post by Axel186 »

Ok .. =) that mean I must parent the wheels to the car and everything will be OK?
Image
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

Yes; once you've done that the wheels position will always be relative to the car; that way you wont' have to move the wheels each time you move the car.
Axel186
Posts: 15
Joined: Thu May 24, 2007 2:54 pm
Location: Israel

Post by Axel186 »

Ok, Tnx to every one!
Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The .irr format and the collada loader do support scene loading. The an8 loader from Sudi also does. There is no really clean interface to scene loading (IMHO it's clumsy do to mising access features), yet, but it is possible. 3DS does not support scenes, though, as do many other formats.
Post Reply