Sprite and BillboardMode

It seems that a sprite is necessarily in billboard all axys mode, and I don’t see a property to tweak that.

Is this because it’s not the same object than a mesh? Do you think it could be a feature to allow disabling the billboardMode (and also add the rotation property)?

It is a 2D object (literally a sprite :)) so no way to not be billboard. If you want controllable billboard you should use a plane and play with its billboard mode

Seems logic.

I’m not sure if it’s possible to use and animate a sprite texture to a classic mesh?

well this is possible by playing with texture.uOffset, vOffset, uScale and vScale (but less convenient for sure ;))

I see, less convenient but could do the trick, thanks for the idea!

you could it simply with a SPS with a single planar particle and updating its UVs values each frame also
https://doc.babylonjs.com/how_to/solid_particle_system#colors-and-uvs

good to know too, thanks

In case someones wants to take a look, here a base code I’ve done: https://www.babylonjs-playground.com/#I4T59R#5

As you can see it’s about using a texture with a 2:1 ratio, it needs tweak if you have more lines than in this example.

1 Like

Hello @Vinc3r.
I’m using typeScript.
I tried to approach 'Mesh.diffuseTexture.uScale(or vScale).
But it failed. and this don’t on playGround.

Log is : Property ‘uScale’ does not exist on type ‘BaseTexture’.

How do I solve this problem? Thank U !

This depends on the texture type, they do not have all u and v scale.

I got it. And clear that.

const texture = texture as BABYLON.Texture

funcA(texture);

function funcA (texture:BABYLON.Texture) { }

Thank you!

1 Like