Jean-Philippe Côté Posted February 5, 2018 Share Posted February 5, 2018 I'm stuck with something that I expected to be very simple: rotating an orthographic camera around its z-axis. Maybe there's something I don't understand but I was expecting to be able to do that but it doesn't work: camera.noRotationConstraint = true; camera.rotation.z = BABYLON.Angle.FromDegrees(angleInDegrees); I tried looking at other posts on the subject and I'm now even more confused than I was... Is there a simple way to rotate such a camera? Cheers! Quote Link to comment Share on other sites More sharing options...
Amarth2Estel Posted February 6, 2018 Share Posted February 6, 2018 Hello Jean-Philippe ! Here is a playground showing working on camera.rotation.z is enough. The problem is that you are passing a BABYLON.Angle (which is an Object) to the attribute z of the Vector3 rotation, while it expects a float (angle in radians). You can use the radians() method on your BABYLON.Angle to get the correct data ! Quote Link to comment Share on other sites More sharing options...
Jean-Philippe Côté Posted February 6, 2018 Author Share Posted February 6, 2018 Of course! Thanks. P.S. Other posts on the forum gave me the impression that it was more complicated than it really was. It works! Quote Link to comment Share on other sites More sharing options...
Guest Posted February 6, 2018 Share Posted February 6, 2018 If something is too complicated then it is a personal failure for me Jean-Philippe Côté 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.