What is the origin of a node in irrlicht?

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
powerpop
Posts: 171
Joined: Thu Jan 08, 2004 1:39 am
Location: san francisco

What is the origin of a node in irrlicht?

Post by powerpop »

i have looked at the documentation and around the forums but i can't find references to the origin of objects - if i import a .3ds object (or an md2) what is the origin of this object - and how does that effect the bounding box - also, how should i save my object mesh originally so that the 0,0,0 i want in my object will match 0,0,0 of the origin (or better said, so that if i had a cube the lower left corner would be in the right place) - and when i rotate an object how does the origin effect the rotation (for instance if irrlicht places the origin x,z in the middle of the object and y is at the edge then rotation will be funky)
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

We started a thread like this based on how scale works.

yikyak went on to find out that 0x0x0 Irrlicht = 0x0x0 3ds = 0x0x0 Milkshape. But Maya is slightly different.

http://irrlicht.sourceforge.net/phpBB2/ ... block#5654

I put the feet of my models at 0 y and center the body over 0x,0z.
Crud, how do I do this again?
powerpop
Posts: 171
Joined: Thu Jan 08, 2004 1:39 am
Location: san francisco

Post by powerpop »

so x and z have to be centered while y is on the edge - what happens when you use rotate, does it spin on the origin? - this is not what i want of course, i want to rotate a cube around its middle so it stays in the same place
SwiftCoder
Posts: 32
Joined: Thu Jan 15, 2004 7:33 pm
Location: Carribean

Post by SwiftCoder »

What Sai means is that when you open your model in IrrLicht, the origin will be in the same place it was in MilkShape/Max (i.e. (0, 0, 0) x,y,z).
powerpop
Posts: 171
Joined: Thu Jan 08, 2004 1:39 am
Location: san francisco

Post by powerpop »

this brings up an interesting problem for me - at the beginning of my app i want to pretend that the origin of an object is at 256,256,256 no matter how big the object is - then once the app is running i want the origin to be back at the center of the object (so it will spin correctly) - the first origin is for placement, the second for action

in our original program we would make objects in maya and place a bounding box around the object that was not visible - this box was the size of one grid unit (512 cubed) - then the object also had its own origin saved in maya - when we converted to our xml format we would take the bounding box and figure out the offset from the object origin and then store this in our xml description

i imagine i can do the same here - store this as meta information - but one question, how can i change the origin for rotation when i call node->rotate - i dont always want to rotate around the center of the object ...?
Post Reply