I've encountered an issue with a piece of code that throws an error, although it functions perfectly in this jsfiddle. The goal is to rotate a cube and pan it using trackball controls. It works in the fiddle, but when I bring it into visual studio, Chrome gives me this error: "Cannot read property 'multiplyQuaternions' of undefined".
The problematic code snippet I'm trying to integrate involves rotating a cube. My suspicion is that the fiddle uses an older version of three.js compared to what I'm currently working with. Any suggestions on how to correctly implement 'geometry.quaternion'? Thank you.
var geometry = new THREE.Geometry();
deltaRotationQuaternion = new THREE.Quaternion()
.setFromEuler(new THREE.Euler(
toRadians(deltaMove.y * 0.4),
toRadians(deltaMove.x * 0.4),
0,
'XYZ'
));
geometry.quaternion.multiplyQuaternions(deltaRotationQuaternion, geometry.quaternion);
}