Vinc3r
January 17, 2019, 2:46pm
1
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
Vinc3r
January 17, 2019, 4:16pm
3
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 ;))
Vinc3r
January 17, 2019, 4:22pm
5
I see, less convenient but could do the trick, thanks for the idea!
jerome
January 17, 2019, 7:42pm
6
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
Vinc3r
January 29, 2019, 3:24pm
8
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
nedcrow
September 2, 2019, 6:33am
9
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 !
sebavan
September 2, 2019, 6:50am
10
This depends on the texture type, they do not have all u and v scale.
nedcrow
September 2, 2019, 7:18am
11
I got it. And clear that.
const texture = texture as BABYLON.Texture
funcA(texture);
function funcA (texture:BABYLON.Texture) { }
Thank you!
1 Like