Having trouble drawing a path in my 3D world, as the line class is not helpful. Can anyone offer assistance? See this image
I've updated my question
I want to draw a path and fill it with texture.
var SUBDIVISIONS = 20; geometry = new THREE.Geometry(); var curve = new THREE.QuadraticBezierCurve3(); curve.v0 = new THREE.Vector3(0, 0, 110); curve.v1 = new THREE.Vector3(0, 200, 110); curve.v2 = new THREE.Vector3(200, 200, 110); for (j = 0; j < SUBDIVISIONS; j++) { geometry.vertices.push(curve.getPoint(j / SUBDIVISIONS)) } material = new THREE.LineBasicMaterial({ color: 0xff0000, linewidth: 5 }); line = new THREE.Line(geometry, material); scene.add(line);
This method has two issues: 1. Linewidth not supported on Windows, 2. LineBasicMaterial does not support textures
- After searching online, I came across the Three.MeshLine class. The linewidth works fine, but there are issues with texture mapping. Here's the code for loading a texture:
Despite adjusting the texture and MeshLineMaterial settings, the result is not what I expected. See image:result imagevar loader = new THREE.TextureLoader(); loader.load('assets/images.png', function(texture) { strokeTexture = texture; strokeTexture.wrapS = strokeTexture.wrapT = THREE.RepeatWrapping; strokeTexture.repeat.set(5, 1); strokeTexture.needsUpdate = true; init() });