I am looking to create a unique outline in my BufferGeometry. My goal is to create a filled polygon with surrounding lines.
Currently, I have attempted using MultiMaterialObject, but the line intersects the square: http://jsfiddle.net/VsWb9/3918/
var positionArray = [0,0,0, 0,100,0, 100,100,0,
0,0,0, 100,100,0 ,100,0,0],
colorArray = [];
for(var i = positionArray.length;i--;)
colorArray[i]=1 // white
bufferGeo.addAttribute('position', new THREE.BufferAttribute(new Float32Array(positionArray), 3));
bufferGeo.addAttribute('color', new THREE.BufferAttribute(new Float32Array(colorArray), 3));
materialsArray = [
new THREE.LineBasicMaterial({vertexColors: THREE.VertexColors, side: THREE.DoubleSide}),
new THREE.MeshBasicMaterial({color: 0xff0000, wireframe: true, opacity: 0.2, transparent: true, shadding: THREE.SmoothShading})
];
mesh = THREE.SceneUtils.createMultiMaterialObject(bufferGeo, materialsArray);
However, I do not want the intersecting line. While this example uses a square, my project involves numerous polygons (Pentagon, Hexagon, etc). What is the best approach to achieve a perfect outline without any intersections?
- Should I create two separate "BufferGeometry" objects? One using LineBasicMaterial with different vertex positions sequence and another using MeshBasicMaterial with the correct sequence of vertices.
- Or is there another solution?
Thank you