saltemishel Posted May 7, 2018 Share Posted May 7, 2018 Hi All, It seems that I can rotate along the Alpha and Beta direction using the arc camera. Is it possible for me to rotate the camera by 360 based on the player's viewing angle? (something like the screen rotates clockwise/counter-clockwise) https://goo.gl/images/VHFpT1 Or any other camera recommendation? Thanks! Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 7, 2018 Share Posted May 7, 2018 you most manage it by upVector https://www.babylonjs-playground.com/#4IJPKS Quote Link to comment Share on other sites More sharing options...
saltemishel Posted May 7, 2018 Author Share Posted May 7, 2018 @NasimiAsl Thanks! It works like a charm, how do I remove the limit so it can rotate 360 degrees? Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 7, 2018 Share Posted May 7, 2018 you most calculate that and use math i try write sample to have it after after office to you ( after 6 hours ) but you can try yourself too 1. calculate a vector between camera and target position 2. rotate your up vector to cross of that 3. add rotation matrix to find new up vector when you rotate around of (camera - target vector ) and maybe some others see and help you faster @adam @jerome @Wingnut ... GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
saltemishel Posted May 7, 2018 Author Share Posted May 7, 2018 @NasimiAsl Ah I see, I've figured it out. I've set it to be the actual equation instead of adding. this.ti+=0.05; this.camera.upVector.y = Math.sin(this.ti/180*Math.PI); this.camera.upVector.x= Math.cos(this.ti/180*Math.PI); It works now. Thanks! 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.