Billboardmode_z not working

Repro: https://playground.babylonjs.com/#ANE052#30

Not sure if its a bug. The testing pg from source is also showing the same. Did I miss smthg?

edit: now I see billboardmode_x also seems wonky. Doesn’t rotate when camera is at other side of x-axis…

billboard mode aligns on 1 axis for x,y,z mode. so, for x, cube will be aligned toward camera on 1 side, and it will be inverted on the other. for Z, you’ll only see something by setting camera roll/up vector.
It’s easy to see and understand modes all and Y. For the others, it’s a bit more difficult.
ex with mode Z and camera up changed:

I see, hmm… so with the changes to billboardmode, the doc needs an update.

I’m trying to get trailmesh to face the camera at all times. Sample PG here: https://playground.babylonjs.com/#YMSKTJ#11

If I set node.billboardMode = BILLBOARDMODE_X;, the billboard works only when the camera is along the positive z axis.

If I set node.billboardMode = BILLBOARDMODE_ALL; and modify the lookAt to node.lookAt(cube.forward,Math.PI/2,0,Math.PI/2);, there will always be a point along the animation where the trail flips when viewing from the top.

By the current billboard definitions, there is no billboard setting that can ensure the trailmesh doesn’t flip?

correct! you’ll need to use something like this : Trail effect with Babylon.js. In my last demo, I exploited a… | by Babylon.js | Medium

1 Like

If you modify the width in your node material to something like 40,40,40, you can see trail artifacts when the bitangent flips its sign due to the change in sphere direction (Try positioning the camera parallel to the plane, so the sphere moves towards the camera and then away).

I’ll try to recreate the billboardMode effect bjs has in the past, using the premise that the only dof a trail has is its generator’s roll axis.

Thanks for clearing up the billboardmodes! Marking as solved. Cheers ! :slight_smile: