al404 Posted September 22, 2016 Share Posted September 22, 2016 I need to get a random position of the camera in a certain alpha and beta range i didn't find information about the range to use so i moved my camera around my object and log the values and i got back alpha 1.54 beta 1.49 right alpha 0.12 beta 1.53 front alpha -1.55 beta 1.49 left alpha -3.12 beta 1.44 what is the correct way to get beta random value? what is the range of beta values? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 22, 2016 Share Posted September 22, 2016 Hello by default beta is limited to [0, Math.PI] in order to not get upside down. Beta is than angle around X axis (so Math.PI is top and 0 is bottom) https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/babylon.arcRotateCamera.ts#L31 Quote Link to comment Share on other sites More sharing options...
al404 Posted September 22, 2016 Author Share Posted September 22, 2016 ok thanks and the same is for alpha? if i what to get an alpha random value i should get it between Math.PI and -Math.PI ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 22, 2016 Share Posted September 22, 2016 Alpha is between 0 and 2 * Math.PI as it describes the angle around Y axis (so a complete circle is allowed here) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 22, 2016 Share Posted September 22, 2016 You should have a look at this great article by @Wingnut: http://doc.babylonjs.com/tutorials/Cameras 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.