klaude Posted September 18, 2017 Share Posted September 18, 2017 Hello, guys. I'm newbie on 3d programming. I want to display sprite like GUI that has a function linkWithMesh. but it hasn't. In this example, sprite's position from a mesh is changing, not fixed. https://www.babylonjs-playground.com/#87HQN6 the mesh must have BILLBOARDMODE_ALL. how to make sprite to track mesh's position like GUI's linkWithMesh. Quote Link to comment Share on other sites More sharing options...
RaananW Posted September 18, 2017 Share Posted September 18, 2017 Howdy! Welcome to the forum. Even thou sprite looks 2d, we are 3d in our core. You will need to update the position in all axes in order to place the sprite on top of the mesh. Here is an example how it can be done: https://www.babylonjs-playground.com/#87HQN6#1 If dealing with different types of nodes, ou could also use the parenting system (http://doc.babylonjs.com/tutorials/position,_rotation,_scaling , search for parenting). Quote Link to comment Share on other sites More sharing options...
klaude Posted September 19, 2017 Author Share Posted September 19, 2017 Hello, RaananW. Thanks for your help. forgot to state linkOffsetX, linkOffsetY of GUI.Control. Using parenting function, It works what i want. but only when it comes to mesh. (yellow one) how to make sprite like plane2 in the next example. https://www.babylonjs-playground.com/#87HQN6#2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.