3

my jsfiddle showing the problem

If anyone could help me with texturing, this would be really useful for anyone wanting to make roads or railroads etc.

I've got a shape, and I extrude it with a spline. And I have a mesh animating along the spline also (which could be a car or train). But I am struggling to get the texture to follow the path.

I have created a fiddle http://jsfiddle.net/neonDog/tpuczbyw/52/

I have experimented with the UVGenerator extrude option - but I don't know what I'm doing and I can't even get the texture to appear any different than default. I have a copy of the default generator THREE.ExtrudeGeometry.WorldUVGenerator in the fiddle stored as customUVGenerator.

var extrudeSettings = {
    steps           : 100,
    bevelEnabled    : false,
    extrudePath     : spline,
    UVGenerator     : customUVGenerator //THREE.ExtrudeGeometry.WorldUVGenerator
};

Similar questions with no answers:

THREE.JS UV Mapping on ExtrudeGeometry

Three.js How to map a texture over multiple faces onto a curved custom geometry

Calculating UV coordinates during mesh extrusion

The most helpful post I've found is here: THREE.js generate UV coordinate

but neither of those custom UV solutions produce the desired result

Desired outcome would be something that is in game engines like Unity, Unreal and CryEngine where the texture curves with the spline path desired outcome

gman
  • 100,619
  • 31
  • 269
  • 393
Will Ormerod
  • 91
  • 1
  • 4

0 Answers0