Trying to implement ThreeJS Transform control into the Forge Viewer by following an informative tutorial:
The current issue is being able to add the Transform Control successfully, but not being able to interact with it. I had to make a slight adjustment in my code from the provided tutorial - instead of using overlay, I added a scene and then incorporated the Transform Control by utilizing viewer.impl.addMesh(TransformControl). For some reason, adding overlay did not result in desired functionality.
Could there be additional steps necessary to interact with meshes in a separate scene compared to the main scene? Below is a snippet of my code:
const transformControlTx: TransformControls =
new THREE.TransformControls(viewer.impl.camera, viewer.impl.canvas, "scale");
transformControlTx.setSize(cube.geometry.boundingSphere.radius * 5);
transformControlTx.addEventListener('change', reRender);
if (!viewer.overlays.hasScene('CubeTranformScene')) {
viewer.overlays.addScene('CubeTranformScene');
}
transformControlTx.attach(cube);
viewer.overlays.addMesh(transformControlTx, 'CubeTranformScene');
The objective is to use this transform control to adjust the scale of the attached cube, which is also a custom ThreeJS Mesh.