little_bigben Posted January 9, 2018 Share Posted January 9, 2018 Hello, I'm developping a web VR editor for 360 video experiences, and I would like in this case to force the camera rotation when I change my POV. I tried to use setTarget on ArcRotateCamera, but it doesn't work when scene.createDefaultVRExperience() is called. How could I change my camera rotation? Thanks, Benjamin Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 9, 2018 Share Posted January 9, 2018 The simplest way would be to change the camera's rotationQuaternion to the desired rotation. A VR camera is not an ArcRotate camera but (internally) a FreeCamera. You can also reset the camera's pose (camera.resetToCurrentRotation()) so that the "forward" rotation of the camera will be the one you are currently looking at. And always remember, the user is constantly rotating, you shouldn't limit that. Quote Link to comment Share on other sites More sharing options...
little_bigben Posted January 9, 2018 Author Share Posted January 9, 2018 Thank you I'll try that. It's not a limitation, it's a "reset" during a transition, the user cannot feel it Quote Link to comment Share on other sites More sharing options...
little_bigben Posted January 9, 2018 Author Share Posted January 9, 2018 I tryed on my project, and then got back to the playground to show you. Here is the sample : https://www.babylonjs-playground.com/#682D2P The rotation does not do anything to the camera. My goal is to "reset" user's view (like a reset center view). Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 9, 2018 Share Posted January 9, 2018 you will need to change the rotationQuaternion, and not the rotation . For example: https://www.babylonjs-playground.com/#682D2P#1 Quote Link to comment Share on other sites More sharing options...
little_bigben Posted January 9, 2018 Author Share Posted January 9, 2018 It does not seems to work : https://www.babylonjs-playground.com/#682D2P#2 The camera doesn't rotate :/ Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 9, 2018 Share Posted January 9, 2018 Hi, the vr camera does rotate: I assume you provided values in all axes just to check the rotation. The non-vr camera doesn't. Are you referring to this one? GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
little_bigben Posted January 10, 2018 Author Share Posted January 10, 2018 In this code : https://www.babylonjs-playground.com/#682D2P#6 I don't create camera, BJS do it for me. When I rotate the camera it doesn't rotate at all (I'm not using the camera in headset mode). Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 10, 2018 Share Posted January 10, 2018 So you are not mentioning the VR camera right? You want the non VR camera to rotate like this? https://www.babylonjs-playground.com/#682D2P#8 little_bigben 1 Quote Link to comment Share on other sites More sharing options...
little_bigben Posted January 10, 2018 Author Share Posted January 10, 2018 Yes, thanks! I haven't see the existence of the scene.activeCamera. It will be easier! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 10, 2018 Share Posted January 10, 2018 no problem I was thinking you wanted to control the VR camera since the beginning Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.