Is it sprite ? or GUI?How to position on the house ? manual?

demo: campus Albano

You may use GUI here, like in the example - https://playground.babylonjs.com/#XCPP9Y#20
In order to position one needs to know the name of the mesh where GUI label should be attached to, for example:
myLabel.linkWithMesh(sphere);

3 Likes

Lol. How did you decypher this question :mage: I didn’t even know which part to look at.
If this was really the question, total respect to you. And then, yes, I believe your answer works;)

I have the same question as you. Have you found the solution

The solution is what labris has posted. Using GUI we can link it to a mesh, in the example demo, the buildings.

2 Likes

What I want to achieve is to let the pop-up box of GUI move with the wizard. What should I do

i have a playground can help you :wink:
https://www.babylonjs-playground.com/#ZI9AK7#1432

I tried this scheme, but he couldn’t bind to the spirit. I didn’t know if it was the problem of the spirit coordinates. I created a circle with the coordinate position of X: 0, Y: 0, Z: 0. I also set the coordinates of the spirit as X: 0, Y: 0, Z: 0, but the position of the spirit was obviously higher than that of the circle

const spriteManagerTrees = new BABYLON.SpriteManager(‘camerasManager’, ‘/static/gltf/image/camera.png’, 20000, {
width: 512,
height: 1024
}, _that.scene2)
spriteManagerTrees.isPickable = true
for (let i = 0; i < 3; i++) {
// Mutliple trees
const myCamera = new BABYLON.Sprite(‘cameras’, spriteManagerTrees)
myCamera.width = 2
myCamera.height = 4
myCamera.isPickable = true
myCamera.useAlphaForPicking = true
myCamera.investigationType = ‘arcCamera’
myCamera.position.x = 0
myCamera.position.y = 0
myCamera.position.z = 0
myCamera.actionManager = new BABYLON.ActionManager(_that.scene2)
myCamera.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickUpTrigger, function (res) {
console.log(res)
let pickResult = _that.scene2.pickSprite(res.pointerX, res.pointerY)
if (pickResult.hit) {
_that.showExplain(pickResult)
}
}))

here:
myCamera.width = 2
myCamera.height = 4
width and height will affect the myCamera’s position

image
Well, thank you very much, but there is a new problem. He can’t follow the camera. As long as I turn the camera position, I will deviate. Is there any good solution to provide
image

you need to use GUI

I don’t know how to do it. Can I give you an example :grin:

I’m not sure to understand, Can’t that playground help you? https://www.babylonjs-playground.com/#ZI9AK7#1433