Texturing a lathe mesh

Hi there - I am wondering if htere is a missing parameter that I need to pass to MeshBuilder.CreateLathe() to change the orientation of UVs. I want the texture to be “centred on” the gravity well from above…

I guess it could also be that I need to completely transform my texture, but i’d prefer not to go to that effort :stuck_out_tongue:

Hello @jimmejardine,

I see the problem you’re running into. The brief description of this function in the Babylon.js docs seem to hint at this behavior, but it might just be the way I’m reading it.

Unfortunately I couldn’t find a way to pass in an option to make it work. However, I was able to remap the UVs manually. https://playground.babylonjs.com/#1DZBX7#1. Note there are more efficient ways to do the math that I’m doing. It’s been a while since I’ve done this so I just stuck to the basics (if someone else wants to revise that vertex math to be more efficient I’d love to see it!).

Edit: I slightly simplified the math by using Vector3.FromArrayToRef, vector3 minimizeInPlace / vector3 maximizeInPlace, and vector3 subtract. https://playground.babylonjs.com/#1DZBX7#2

Hey! One option is to use the frontUV:
Lathe | Babylon.js Documentation (babylonjs.com)