Steffen Posted October 18, 2016 Share Posted October 18, 2016 Hi, I've got my vive and the controllers working and now I want to implement some teleporting feature to move around. So I have some kind of a laserpointer to choose the new position. How can I link the new position as the start position of the webVRFreeCamera (with options-flag "trackPosition:true")? Because the vive overrides my positions, I'm adding "newPos" to "scene.activeCamera" every frame. But there seems to be an offset. And obviously, if I set "scene.activeCamera.position = newPos" and not "+=", the trackPosition isn't working any more. Thanks Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 18, 2016 Share Posted October 18, 2016 Ping @RaananW Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 17, 2016 Share Posted November 17, 2016 A month later, and here I am! I see the problem, you need some kind of a position offset. It exists for the rotationQuaternion, but not for the position. The quickest solution would be to add newPos in a beforeRender loop, which runs after the camera got its new position. so, the camera gets the new position, and you set the offset right after, the scene renders, the camera gets a new position, and the fun continues. But I can add a position offset just like the rotation offset which exists in the VR cameras. If it helps. Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 17, 2016 Share Posted November 17, 2016 So! I felt like commiting something today. The WebVR camera has now a setPositionOffset function that takes a vector3 as an optional parameter. This will be the new offset position from which the position provided by WebVR will be calculated. if you don't provide any vector3, the current camera position will be used as the new offset. We are one step closer to real life teleportation! GameMonetize 1 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.