I would like to change the initial position where my geometry appears; Right now it appears in the center of the canvas. I would like it to appear at the left upper corner. Can you help me?
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 10000);
camera.position.z = 1000;
Here is the full code: Three js example
Change the position of the cube using
mesh.position.set(x, y, z)
I used
window.innerWidth
andwindow.innerHeight
to move your object to the corner of the screen.Here is an updated fiddle with your box in the upper-left corner of the screen.
If you don't like how the cube flies around when you drag it, you can't use
orbitControls
any more. To make the cube still rotate normally, use this code (jQuery required):Source for this code: https://jsfiddle.net/MadLittleMods/n6u6asza/
Example using your code: https://jsfiddle.net/3eau15pv/3/