dav74 Posted October 30, 2013 Share Posted October 30, 2013 Hello,I don't understand alpha and beta angles for the ArcRotateCamera. Have you, somewhere, a schema to explain that ?Thank you for your help. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 30, 2013 Share Posted October 30, 2013 Alpha is the rotation angle around Y axisBeta is the rotation angle around X axis Quote Link to comment Share on other sites More sharing options...
dav74 Posted October 30, 2013 Author Share Posted October 30, 2013 Thank you very much Quote Link to comment Share on other sites More sharing options...
Boz Posted May 4, 2014 Share Posted May 4, 2014 Do you know what are the units of these values ?I am trying to get the rotation angle (in degrees or radian) around Y axis so I print alpha in the console but I get values between 0 and ~12.5 for a complete circle around my target.And it is not circular, values get bigger each time. Is there a way to normalize it ? Thank you (:Pouet-- Quote Link to comment Share on other sites More sharing options...
Wingnut Posted May 4, 2014 Share Posted May 4, 2014 https://github.com/BabylonJS/Babylon.js/wiki/05-Cameras Apparently we did not do a good job on the cameras tutorial. Yes, it IS circular. The ArcRotateCamera, if .alpha = 0... looks down the -x axis. If you want to go left, subtact radians. When you get to -6.28 radians (2*-Math.PI)... you have done a complete circle to the left. If you want to go right, add radians. When you get to +6.28 radians (2*Math.PI)... you have done a complete circle to the right. Experiment, experiment, experiment! .707 radians = Math.PI/4 = 45 degrees. 1.57 radians = Math.PI/2 = 90 degrees. 3.14 radians = Math.PI = 180 degrees. An interesting place to start your arcRotateCamera.beta... = Math.PI/3 ; (about +1.05 radians) .beta = 0; // straight overhead .beta = Math.PI/2; // ground level .beta = Math.PI; // directly beneath Have you read all of The Wingnut Chronicles? Have you downloaded every zip he ever provided? Have you looked at his code (free to use)? Do you know the link to the Playpen Series Tutorials? Have I asked enough questions? Quote Link to comment Share on other sites More sharing options...
Boz Posted May 4, 2014 Share Posted May 4, 2014 Yes, I tried all tutorials from the basic series.My mistake, it is in radians. But I have tried to add a debug line and console.log(arcCamera.alpha) says when I turn around for 360 degrees, alpha is ~12.7 It is good now, it says ~6. don't know where the error was, sorry for useless question so. Thank you for quick answer Quote Link to comment Share on other sites More sharing options...
Wingnut Posted May 4, 2014 Share Posted May 4, 2014 My pleasure. Sometimes I use some html info-divs to help me learn things. I keep them updated by setting their .textContent inside the scene's render loop. (after sending the values through a rounding function called 'mr()' - my rounder.) As you can tell, vector3's ARE endless, but it only takes 6.28 radians to go 360 degrees either way. Also, notice that each value in a color3 are usually between 0 and 1, but the color3 used in tmat.diffuseColor (the torus knot) actually has a '2' in it. For some reason, color3 values can to go from 0-5 around here. It is one of the mysterious secrets of babylon.js. We think maybe the framework is haunted. Here is a quick little demo and a zipped version of it... shows how I use them. Mousewheel changes the radius. Hang on to orient.png ... it comes in handy, often. Be well. 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.