[1.5]new way of handling relative translation

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
white tiger
Posts: 269
Joined: Tue Oct 31, 2006 3:24 pm
Contact:

[1.5]new way of handling relative translation

Post by white tiger »

i'm stuck how 1.5 handles a completely new way of positioning a child node. in the previous versions of irrlicht, a child position was related to the parent, but the unit of measurement was also the same. for example, we assume that node1 is a box of (5,5,5) and node2 a box of (10,10,10)

Code: Select all

node2->setPosition(core::vector3df(10,20,30));
node1->setParent(node2);
node1->setPosition(core::vector3df(0,1,0))
what's the absolute position of node1? in previuos irrlicht version it was (10,21,30). in 1.5 there is a new way of handling it. the unit measure is not the same, the unit of measurement for the position of the child's node is the dimension of the parent node.

in 1.5, after the above code, node1 will be in (10,40,30); right above the parent node, beacuse the new unit of measurement for the child node is not 1.0 anymore but the node2 x dimension, 10

now i don't want this, i want that the unit of measurements both for the parent and for the child are the same (1.0). how i can achieve these in 1.5?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

are you sure ??? :shock:
I can't reproduce this...

are the nodes scaled ???
remember scaling also acts on the position of children !!! ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Ditto.
white tiger wrote:the unit of measurement for the position of the child's node is the dimension of the parent node.
The unit of measurement is the scale of the parent node. AFAIK, it always has been. I can't see this changing, since (for example) you have a child positioned on the surface of a sphere node, and you double the dimensions of the parent, you'd want the child to remain at the surface, i.e. you'd have to double its relative position.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
white tiger
Posts: 269
Joined: Tue Oct 31, 2006 3:24 pm
Contact:

Post by white tiger »

rogerborg wrote:Ditto.
white tiger wrote:the unit of measurement for the position of the child's node is the dimension of the parent node.
The unit of measurement is the scale of the parent node.
damned! :lol:

it does work now. Thanks :wink:
Post Reply