FlashyGoblin Posted March 3, 2017 Share Posted March 3, 2017 Is it possible to add an offset to the camera to allow for more of a parallax effect when rotating the camera? The camera pivots around a center point which is why you don't see any depth of a scene when rotating it. Thoughts? See attached image. Thanks! Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 3, 2017 Share Posted March 3, 2017 Howdy partner! You can achieve that using a parent, but it might be a nice idea to take the pivot matrix from abstract mesh and put it on the node. any thoughts from other people? Quote Link to comment Share on other sites More sharing options...
FlashyGoblin Posted March 3, 2017 Author Share Posted March 3, 2017 Hey @RaananW !! But wouldn't putting the camera inside a node still have the camera rotating on its own pivot from device orientation events and camera controls? Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 3, 2017 Share Posted March 3, 2017 Rotate the parent, not the camera. On each frame copy the camera's rotation to the parent, and reset the camera's rotation. Just a theory, but it should work. This might cause functionality like the pick function to work incorrectly thou. Needs to be checked. Quote Link to comment Share on other sites More sharing options...
FlashyGoblin Posted March 3, 2017 Author Share Posted March 3, 2017 Ok, good idea. Thanks. Quote Link to comment Share on other sites More sharing options...
FlashyGoblin Posted March 3, 2017 Author Share Posted March 3, 2017 @RaananW That seems to be working!!!!. The only issue is that after multiple times of rotating, the beta gets off track. I needed to addRotation because directly setting the null to the camera's rotation wasn't working. http://www.babylonjs-playground.com/#1RJ4G2#1 Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 3, 2017 Share Posted March 3, 2017 @FlashyGoblin - here is my take on the hack http://www.babylonjs-playground.com/#1RJ4G2#3 Angular sensitivity is multiplied in 2, and the rotation is applied to both camera and parent. this way it simulates the same behavior. Quote Link to comment Share on other sites More sharing options...
FlashyGoblin Posted March 3, 2017 Author Share Posted March 3, 2017 Yep, that did it! You da man!!! 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.