How do I align all the local coordinate axes of child nodes with the parent node in JME?

I thought it would work like in Blender: if I scale by 2x along the X axis, all models under this node would be scaled along the same coordinate axis. But in JME, when I scale by 2x, all the model nodes under this node are scaled according to their own local coordinate systems.

In my case, I create four walls, with two of them rotated 90 degrees to form a room. However, when I scale the node by 2x, the rotated walls stick out (the expected effect is that the length of the two horizontal walls increases, and the walls that are rotated 90 degrees should become thicker).

how can i solve this problem?Thanks!

other 3d model

Could we see some code as to how you are doing this scaling? Are you setting a single scaling factor on a node that has all the children attached to it?

(Or are you using the SDK looking at your screenshots, im less familiar with how that works)

If you scale a node, the position and scale of all of the children will be scaled.

It looks like the things you think are children are not really children somehow… or as richtea hints: you are not just scaling the parent.

node
   child1
   child2

node.setLocalScale(2);

child1 and child2 will double in size AND their positions will scale 2x also.

1 Like

In Blender it matters what is your transformation orientation and what is your pivot point. In JME it matters which node you scale. Do you scale a parent node that has children?

parent1
    wall1
    wall2
    wall3
    wall4
parent.setLocalScale(2f);

Or do you scale the individual children?

wall1.setLocalScale(2f);
wall2.setLocalScale(2f);
//...

Or do you scale both the parent and both the child? If you scale a child by 4 and scale a parent by 2 that equals to 8 unit of scale for the child at the end and also its position changes. If you scale only the child then the position will not change if the child mesh is centered in model space. If the child is offsetted from its own model space then its position will seem to change. Local scaling uses the model space center as pivot point. Parenting uses the parent’s center as a pivot point.

Please show us some code so we can help further.