babbleon

camera similar to DeviceOrientationCamera

Recommended Posts

Hello,

Do we have something like DeviceOrientationCamera, but when the device is moved: the camera moves and the 'look at' position stays the sames as opposed to the camera position staying the same and the 'look at' position moving?

I'd imagine if it existed it would be called DeviceArcRotateCamera. 😊

Hope this make sense!

Thank you.

Share this post


Link to post
Share on other sites

This works:

var camera = new BABYLON.VRDeviceOrientationArcRotateCamera('Camera', 0, 0, 5, new BABYLON.Vector3(0, .3, 0), scene);
camera.cameraRigMode = 0;

However, when i rotate my device, the BJS camera seems to rotate the opposite way.

Share this post


Link to post
Share on other sites

Hello!

this camera extends the ArcRotateCamera and then use this inputManager: http://doc.babylonjs.com/api/classes/babylon.arcrotatecameravrdeviceorientationinput

You can use the xxxCorrection properties and set then to -1 to change the direction :)

A doc about inputs: http://doc.babylonjs.com/how_to/customizing_camera_inputs

Share this post


Link to post
Share on other sites

Hi @Deltakosh,

I have tried the below, but regardless of what I set xxxCorrection to it makes to difference to the movement of the camera when I move by device around.

var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 5, new BABYLON.Vector3(0, .3, 0), scene);
    
camera.inputs.add(new BABYLON.ArcRotateCameraVRDeviceOrientationInput());    
camera.inputs.attached.VRDeviceOrientation.alphaCorrection = -1;
camera.inputs.attached.VRDeviceOrientation.betaCorrection = -1;
camera.inputs.attached.VRDeviceOrientation.gammaCorrection = -1;

Am I doing something obviously wrong?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.