Doubts with position of objects and camera


I’m developing a scenary with a CubeTexture with a initial camera position of (0,0,0). Inside of it a plane geometry manually positioned like this:

var geometry = new THREE.PlaneGeometry(1.5 * SCALE, 1 * SCALE);
var material = new THREE.MeshBasicMaterial({map: texture});
var plane = new THREE.Mesh(geometry, material);
plane.position.x = 4
plane.position.y = 0
plane.position.z = 0


The scene is moved with DeviceOrientationControls and the app is forced to launch on LANDSCAPE PRIMARY (device turned to the left)

If I launch the page with this initial orientation the element is on the correct position.
I I launch the device with the device initially turned to the right (LANDSCAPE SECONDARY) the element is exactly behind the user vision

How can I set the camera to look to the element on init?


Have you tried moving the camera back a bit?

I have already tried with camera.rotation.x = … but the camera not rotate.

have I missed something?


Backwards and forwards generally refers to the z axis (relative to your position looking at the screen). Left / right is the x axis and up / down is the y axis.

This is the convention for three.js, some applications swap the y and z axes.

Try setting camera.position.z = 10. This will move out ‘backwards’, i.e. out of the screen towards you.

You can also try using camera.lookAt( object ), before adding the controls.