Hello!
I’m using a THREE.GLTFLoader and THREE.OrbitControls inside a preview panel in a After Effects extension.
When a .glb is loaded to the preview window it automatically rotates, and I’m able to use the scroll wheel on the mouse to zoom in and out of the scene, but all the orbit controls/pan controls do not work at all. Below is my current code:
// OrbitControls
controls = new THREE.OrbitControls(camera, renderer.domElement);
controls.enableDamping = true; // Smooth motion
controls.dampingFactor = 0.05;
controls.enableZoom = true; // Allow zooming
controls.enablePan = true; // Allow panning
controls.enableRotate = true; // Allow rotation
// Allow full vertical orbit: from directly above (0) to directly below (PI)
controls.minPolarAngle = 0;
controls.maxPolarAngle = Math.PI;
// Remove explicit azimuth restrictions so that horizontal rotation is fully free
// (If you need to set limits, try using numeric values, e.g., -Math.PI and Math.PI)
// GLTFLoader
gltfLoader = new THREE.GLTFLoader();
I have been using Chatgpt to help with the coding because I’m not familiar with it yet.
Is this even possible in After Effects? I kind assume that if zooming in and out on the model works full orbit control would work? right?