damian+merfoo=♥ Posted January 20, 2014 Share Posted January 20, 2014 Using an ArcRotateCamera you can set the rotation on creation of the camera, is there a way to do something like, camera.rotation.x and camera.rotation.y to change the rotation of a camera already in the world? I'm assuming that it would be better to not just make a gazillion cameras every time that I want to manually change the rotation though as far as I can see the only way to set a camera is on creation! When I try my method above it just says "Cannot set property 'x' of undefined". Quote Link to comment Share on other sites More sharing options...
gwenael Posted January 20, 2014 Share Posted January 20, 2014 I would love to have position, rotation, and scaling in a new kind of node (transform). A transform could be used to be the parent of meshes, lights and cameras. Thus, it will be simple to achieve what you want. Like my post here http://www.html5gamedevs.com/topic/2796-discussion-about-nodes-meshes-instances/?p=18165 and maybe someday we'll have it Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 20, 2014 Share Posted January 20, 2014 camera.position is available As far as it concerns rotation, the arcrotatecamera has a alpha and beta property to position it on a sphere Quote Link to comment Share on other sites More sharing options...
damian+merfoo=♥ Posted January 21, 2014 Author Share Posted January 21, 2014 @Deltakosh, but that's only for when you use new and create a camera, or are you saying that I can do camera.alpha and camera.beta to change those properties of an existing camera? Quote Link to comment Share on other sites More sharing options...
gwenael Posted January 21, 2014 Share Posted January 21, 2014 Yes you can set them when you want, there are public variables. https://github.com/BabylonJS/Babylon.js/blob/master/Babylon/Cameras/babylon.arcRotateCamera.jsThey are also set when you set the position of the camera: camera.setPosition(vector3) Quote Link to comment Share on other sites More sharing options...
damian+merfoo=♥ Posted January 21, 2014 Author Share Posted January 21, 2014 ok, thank you very much! I was looking through examples and the tutorials and I never found anyone doing this so I was starting to worry! Glad to hear that I was wrong! Quote Link to comment Share on other sites More sharing options...
gwenael Posted January 21, 2014 Share Posted January 21, 2014 The convention for variables is: prefixed by an underscore (_alpha) when they are private, protected or accessible only to friends classes; not prefixed by an underscore (alpha) when they are public, accessible by any part of the code. 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.