comment/uncomment line 39 which is the offset. Switch to 4.21, you’ll notice that
a) the axes have changed !
b) no worries, simply edit line 39 to AIlabel.position.z = 0.4*100; Now, you’ll notice the motion of the AILabel is different from 5.27 !
First noted in 5.23 and then 5.27 is still showing the same inconsistency. I can live with the axes change since its a small edit in my codes but the seasickness is making me dizzy. Was something new introduced to billboard/parenting that I missed ?
Switch between 4.21 and latest. It seems that parenting and billboard mode has changed between 4.21 and 5.27. I guess the question is: what if I don’t want my child to be affected by the parent’s rotation while the child is in billboard mode? Is there a switch to turn it off ?
My approach would be, to create a TransformNode inbetween (because you want offset and rotation), then set node as parent of small1. At last set node.position to absolutePosition of box. This might give results you want?
PG:
Edit: It would even work without TransformNode, but you will have to update the position manually, because of offset:
Thanks, there are indeed many workarounds/hacks. I dimly recall that when billboard mode was created, it was intentionally made to exclude some parent transforms. I fail to understand the application for the billboard in its current incarnation (other than some fringe use cases). Regardless, my reason for this thread is that 5.27 broke back compat. There must be a reason the team made the decision, I want to understand what it is.
It is not difficult for me to submit a PR, but I would not know why. Pls help me understand the reason.
@cedric I presume its too late to revert the PR ? Can we have a programmatic switch to bypass/turn off whatever was added ? Do we open any can of worms if we do so ?
@Takemura Thanks for the follow-up ! On a weekend, no less !
Lemme get your application right, you want to
a) parent a plane to a cylinder,
b) have the plane face the camera
c) have the plane maintain its position and size when you scale the cylinder
d) have the plane rotate around the y-axis when you rotate the cylinder and still face the camera ?
ok, so a picture is worth a thousand words:
a) parent a plane to a transform node, parent a cylinder to same transform node?
b) have the plane face the camera
c) have the plane maintain its position and size when you scale the cylinder
d) have the plane rotate around the y-axis when you rotate the cylinder and still face the camera ?
That is only for demonstration purposes. If you remove it, just add small1.position = cylinder.position.add(group.position); anywhere in your main code or after you scale yr cylinder in a callback to update the new position. You’ll also realize that even if you switch to 4.21, the codes still work. Hope it helps.
Before my change, only the position was forwarded from the parent to the child. An oriented parent with a billboard child could result in the child to not appear as a billboard.
To me, billboard affect the end result. If something is billboard, then whatever his parent hierarchy is, it should appear as a billboard.
Now with Phaselock’s PG https://playground.babylonjs.com/#92Y727#292
I understand it can break back compat.
To fix it for everyone, I can add a static flag in TransformNode to apply Rotation . Default would be off for back compat.