What am i missing?
var xPos = -110;
for ( var count = 0; count < codedInstancedMeshGroup.count; count ++ ) {
// scale
var randomScale = (Math.random() * (2.0 - 1.0) + 0.1).toFixed(2);
codedInstancesMatrix.makeScale( randomScale, randomScale, randomScale );
//rotation
var tempRotationAngleForMatrix = Math.floor(Math.random()*359+1);
rx = Math.random().toFixed(2);
ry = Math.random().toFixed(2);
rz = Math.random().toFixed(2);
var tempVector3AxisForMatrix = new THREE.Vector3(rx, ry, rz).normalize();
codedInstancesMatrix.makeRotationAxis ( tempVector3AxisForMatrix, tempRotationAngleForMatrix);
// position
xPos = xPos + 50;
codedInstancesMatrix.setPosition( xPos, 20, 0 );
// update
codedInstancedMeshGroup.setMatrixAt( count , codedInstancesMatrix );
}
note:
I have
codedInstancedMeshGroup.instanceMatrix.setUsage( THREE.DynamicDrawUsage );
also set …