Instanced Geometery and lookAt()

I am attempting to set my dummy object3D’s rotation using lookAt but it does not seem to set the rotation at all.

Is there something special I need to do with this?

I only need this to happen once when they are first created.

see live demo here: LucianWorld VR

matrix property will be updated only after the first render, try this:

const pos = new THREE.Vector3(x, y, z);
const sc = new THREE.Vector3(1, 1, 1);
const obj = new THREE.Object3D();
obj.lookAt(4, 5, 6);
const m4 = new THREE.Matrix4();
m4.compose(pos, obj.quaternion, sc);
starInstances.setMatrixAt(i, m4);
1 Like

hello. can I assume sc is “scale”? and does it default to vec 3 1,1,1 ?

yes

no, it defaults to 0,0,0