C
C
clown_of_helloween2017-03-26 22:59:42
JavaScript
clown_of_helloween, 2017-03-26 22:59:42

Threejs Texturing in parts?

There is an object

var background1 = new THREE.Geometry(); 
    background1.vertices.push(new THREE.Vector3( -5.88,  3.64, 0.0)); 
    background1.vertices.push(new THREE.Vector3(-5.9, -3.64, 0.0)); 
    background1.vertices.push(new THREE.Vector3( 5.9, 3.64, 0.0)); 
    background1.vertices.push(new THREE.Vector3( 5.9, -3.64, 0.0)); 
    background1.faces.push(new THREE.Face3(0, 1, 2)); 
    background1.faces.push(new THREE.Face3(0, 1, 3)); 
    background1.faces.push(new THREE.Face3(2, 1, 3));

How can I set the texture coordinate? Just like in vanilla JS
ctx1.drawImage(img, -256*j+position.x, -74*i+position.y, 1050, 650, 0, 0, 1050, 650);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question