Planar UV Mapping on MeshBuilder Primitive?

Is it possible to apply a simple planar projection to the UVW coordinates of a Lathe - MeshBuilded?

https://www.babylonjs-playground.com/#1KN1LB#43

I am looking to achieve this:

In your case it is not very difficult as your mesh is planar: just use the x/z values (with proper scaling) for the u/v coordinates:

https://www.babylonjs-playground.com/#1KN1LB#44

3 Likes

You are the man! Works perfectly even if I increase the ripple count.

Super thanks.

EDIT: Is there a smarter way of creating this zig-zag line? It will be really long.
https://www.babylonjs-playground.com/#1KN1LB#46

Yes

Set entry for i = 0 then use a loop for other entries using new BABYLON.Vector3(-i, i % 2, 0)

1 Like