Hi fellow Babylon.js users,
First of all thanks for this great engine! This is the most pleasant 3D engine I have ever worked with so far. Until now it has been smooth sailing, but now I have my first question.
For some time I have been developing my game and making excellent progress, but right now I’m stumped. I’d like to have Diablo-like life and mana “baubles”, and I’d like to render them in 3D (with all sorts of nice effects :)) and project them as the top-most layer. But when implementing this I was always running into a weird problem, which I’ve isolated (fortunately that was straightforward) in the following two playgrounds:
Babylon.js Playground (the whole setup)
Babylon.js Playground (just the baublesScene)
As you can see, when moving the camera, the projected sphere in the first example moves with the camera, even though it’s supposed to stay still (and there’s supposed to be two on the left and right, not just one in the center). It’s almost like the camera of the baubleScene had its parent set to the main camera.
In the second example you can see what the baubleLayer should actually look like. As you can see, the camera can’t move. I just want the two spheres there to be glued to the screen basically (I hope that makes sense).
When looking at the first demo, you can also see a slight lag in the movement of the projected sphere, which tells me there’s some code there that resets the position/orientation explicitly. But I don’t understand why. Is this a bug or is it actually supposed to work this way?
The problem is exactly the same when using a plane to project on (by setting the emissiveTexture of its material), by the way.
I hope you can help me. Thanks in advance!