I try to do a RGB cube in Three.js, but i must use a vertices, no textures. I look at some tutorials, but my code does not work, can I ask for advice? Thanks.
https://jsfiddle.net/yjru14q3/
var geom = new THREE.Geometry();
geom.vertices = vertices;
geom.vertexColors = colors;
var colors = [];
colors[0] = new THREE.Color( 0, 0, 0 );
....
var vertices = [];
vertices[0] = new THREE.Vector3( 0, 0, 0 );
....
var material = new THREE.MeshBasicMaterial({
vertexColors: THREE.VertexColors,
side: THREE.DoubleSide, // in case we go inside the cube
});
var cube = new THREE.Mesh(geom, material);
scene.add(cube);