Can't use a transform node child?

I am doing a satellite rotation thing.

I use a pivot node like per the docs, but I changed it a little. I wanted to mess with the satellite orientation and such.

so what i did was put an invisible mesh, and use that to update the satellite. works fine.

however, I originally tried to use another transformNode to do this. I was thinking it’s specifically for use with transformations, and it’s probably better than an invislble mesh.

so all i did was replace my invisible mesh with another transform…and it doesn’t move :frowning:

Is this not allowed?

https://playground.babylonjs.com/#P4HU0B

I’m not sure why this is happening either,

some experimentation shows that this works well when you parent the satellite to the pivot node:
https://playground.babylonjs.com/#P4HU0B#2

Use the inspector to see what the hierarchy of your scene is. I’m not sure it is what you want (even in @Drigax example), as the box is not a child of sphere in any of the two cases (being a satellite, I assume box should be a descendant of sphere?).

I updated your example to more easily show the effect i’m looking for.

the basic idea is to rotate the disc always facing the camera. like a billboard. (but setting mesh to billboard mode makes it not move, might not work with ArcRotateCamera?)

with the working version using an invisible mesh. if I incorporate your changes, you can see the lookAt camera part fails.

https://playground.babylonjs.com/#P4HU0B#5

updated to have arcRotateCamera: https://playground.babylonjs.com/#P4HU0B#6

My understanding is this is a LOCAL vs WORLD thing.

if i print out the rotationNode’s rotation and position information, it is indeed standing still. so it appears the transform nodes only work when a real mesh is attached to them.

I wonder if this is a bug?

This seems like a bug, I’ll ping @Deltakosh , but he won’t be available for the next week. Hopefully he can provide some insight when he gets back.

It is not a bug:
https://playground.babylonjs.com/#P4HU0B#7

As the transformNode has no child, its world matrix is skipped during rendering so you need to force it to update manually

Also seems like the billboard works:
https://playground.babylonjs.com/#P4HU0B#8

2 Likes

I think when i was trying billboard mode i was in the middle of the pivot testing, and I must have tested it poorly. thanks for showing me that! now i have to decide if I want true billboard, or the nice random rotations from the satellite with lookAt hehe.

thanks for the explanation on the transformNode. seeing how you worded it, it makes sense that it didn’t move.

1 Like

So i was updating my local code, and … billboard strangeness?

Bsaed on what Deltakosh posted, I figured, just assign the disc to the pivot, and put in billboard mode. no real need for the rabbit.

no joy, wont work in billboard mode.

I need the rabbit in order to make the disc work in billboard mode. Unsure if this is a bug? I guess billboard mode ignores rotation commands, because it’s overriding that? in which case, i do need the rabbit, because he can rotate, and the slave relationship just changes positions.

https://playground.babylonjs.com/#P4HU0B#9

line 29 and on is the good stuff.

Yes billboard will cancel everything from the parent to always be facing the camera. This is the point of billboard actually :slight_smile:

Gotcha. I wasn’t sure of how billboard worked under the hood, but now I have a better understanding! Ty sir

1 Like