javascript - Cycle through materials onclick with three.js - Stack Overflow

PHOTO EMBED

Sat Nov 19 2022 18:56:17 GMT+0000 (Coordinated Universal Time)

Saved by @oday #javascript

var materials = [
    new THREE.MeshBasicMaterial( {color:'#b02030'} ),
    new THREE.MeshLambertMaterial( {color:'#b02030'} ), 
    new THREE.MeshPhongMaterial( {color:'#b02030', shininess: 100 } ),
    new THREE.MeshNormalMaterial(),
    // ...
];
var materialToShow = 0;
content_copyCOPY

https://stackoverflow.com/questions/53992754/cycle-through-materials-onclick-with-three-js