“BABYLON.Mesh.BILLBOARDMODE_ALL” is not working properly. After applying BABYLON.Mesh.BILLBOARDMODE_ALL the mesh is moving away from it's actual position

I want to make the mesh representing the height of the model to always face the camera whenever user rotates the model.

I have tried using mesh.billboardMode = 7 but it shifts the mesh to the bottom of the model for some unknown reason. Any help from @sebavan and @Evgeni_Popov would be really appreciated.

Why animating it in this case ?

I am trying to show the model without animations first and then show the animations upon clicking the Animate button.

The animations are part of the model itself

I have updated the playground. @sebavan Please check.

the rotation on x should be -90 I guess
image

When we apply billboardMode = 7 for some reason it is shifting downwards from it’s position

rotating it to -90deg will rotate the mesh, but the position is changing from it’s actual position @sebavan

if(mesh.name === "Height"){
        mesh.billboardMode = 7
         mesh.rotation.x += -Math.PI/2
}

This is not related to billboard but to where the pivot of your mesh seems to be ?

You can disable pivot and try rotating within the inspector. You will notice it rotates around the bottom of the lamp and not itself.

1 Like

Facing the same issue as @Manii_Pindi here. It seems that if I create a text label that I wish for it to be next to a mesh, and set BILLBOARDMODE_ALL, rotating my camera around the mesh makes the text “move”… Is there a way to fix the position so that regardless of rotation, I always see the text label next to my mesh in the correct “readable” orientation?

Do you have a playground?

How are you attaching it “next to mesh”?

It’s likely the same problem. I’m not sure how to solve between two solutions:

  1. set pivot point of text label (.setPivotPoint()), or
  2. move text label point you want fixed to 0,0,0 and bake vertices. then attach to mesh.

There may be other solutions depending on how you’re implementing mesh, text, and attachment.

1 Like