I would like to draw a house. I'm new to three.js I know how to draw cubes (walls) but how best to draw the roof? And especially the section of the wall directly under the peak of the roof? I know of such a method:
var starPoints = [];
starPoints.push(new THREE.Vector2(-500, 0));
starPoints.push(new THREE.Vector2(0, 500));
starPoints.push(new THREE.Vector2(500, 0));
var starShape = new THREE.Shape(starPoints);
var extrusionSettings = {
size: 0, height: 0, curveSegments: 0,
bevelThickness: 0, bevelSize: 0, bevelEnabled: false,
material: 0
, extrudeMaterial: 1
, amount: 100
};
var starGeometry = new THREE.ExtrudeGeometry(starShape, extrusionSettings);
var materialFront = get_material(gparams.kirpich, 1, 1); //materials_list.basic_color; // new THREE.MeshBasicMaterial({ color: 0xffff00 });
var materialSide = get_material(gparams.kirpich, 1, 1);
var materialSide2 = new THREE.MeshBasicMaterial({ color: "#f00" });
var materialArray = [materialFront, materialSide];
var starMaterial = new THREE.MeshFaceMaterial(materialArray);
var star = new THREE.Mesh(starGeometry, materialFront);
star.position.set(0, 250, 0);
//star.rotation.x = -90 * Math.PI / 180;
scene.add(star);
I have got a triange, but I can not get necessary material for this triangle. I can get only color material, but I want to get custom material from a material picture. How could I get necessary material or may be there is another way to get custom mesh with custom material for these purpose?
Thank you very much in advance!