I'm looking to incorporate a section in the corner of my main view that displays a miniature version of the main view.
Currently, I am developing a webpage using JavaScript with three.js. The main view window showcases various geometries that can be rotated and moved using OrbitControls.
My goal is to have a separate section in the corner of the main view where a small cube can be displayed, rotating in sync with the main view without zooming in or out when the main view is zoomed.
var orientationGeometry = new THREE.Mesh( geometry, material );
camera.add( orientationGeometry );
// in animate function:
orientationCube.rotation.x = controls.getPolarAngle();
orientationCube.rotation.y = controls.getAzimuthalAngle();
While this code successfully rotates the small cube and keeps it fixed on the screen by adding it as a child to the camera, zooming in or out causes the cube to move away from the camera.
Is there a method to create an additional section as depicted in the following image?