I’m trying to create a zoom box, so far I managed to translate the cursor positions from locale to world coordinates and create a box object around the cursor with the right uvs.
Here is my attempt : https://jsfiddle.net/1ewatknv/
Without scaling, the box is perfectly centered around the cursor, but if you toggle the scaling checkbox to set the scale zoomMesh.scale.set(1.5, 1.5, 1)
, the box position shift the further you move the cursor from the scene center.
Am I messing any CSS like “transform origin” for three.js to center the scale around the object, or is there a better approach the get this kind of zoom effect ?
Thanks for your help.