Control scale and rotation when set parent node.

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
svedach
Posts: 20
Joined: Fri Oct 14, 2016 12:22 pm

Control scale and rotation when set parent node.

Post by svedach »

Good afternoon. I imitate the sensor field of view (transparent triangle), which is ISceneNode given from SMesh. The field of view as a subsidiary node clinging to the sensor node, which conditionally scale (1, 1, 2). When I cling to the node of the field of view of the sensor I give it the scale to the scale of the sensor nodes (code), in this case saved the correct dimensions (when rotation of node of the field of view is (0, 0, 0)).

Code: Select all

_Node->setParent(ParentNode);
_Node->setScale(core::vector3df(1, 1, 1)/ParentNode->getScale());
But if I do the node of the field of view of the rotation, the scale of the field of view is changed. Figure red rectangle - sensor, right out the correct field of view, down - with the wrong scale. Prompt how to save the scale when attached to the node and setting the rotation subsidiary nodes. Thank you.
Image
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Control scale and rotation when set parent node.

Post by hendu »

You only scale in the Z direction. You may want to scale in XZ or all three.
svedach
Posts: 20
Joined: Fri Oct 14, 2016 12:22 pm

Re: Control scale and rotation when set parent node.

Post by svedach »

Well, why do I get by dividing the vector. And the scale is used for all three axes.
I think here the reason is different: the scale is applied to the child node after the turn. How to avoid it?
svedach
Posts: 20
Joined: Fri Oct 14, 2016 12:22 pm

Re: Control scale and rotation when set parent node.

Post by svedach »

Node field of view is created and rotated with the right size, then she is clinging to the sensor node, and if I understand correctly, to the node of the field of view of the scale of the sensor node is used, which distorts the node view.
Post Reply