Slastraf Posted March 28, 2016 Share Posted March 28, 2016 I want to make a camera with that you can watch an object from every angle. The object itself shouldnt be moved or anthing. How would you do this ? I have found a gif that does just that. Quote Link to comment Share on other sites More sharing options...
Undac Posted March 28, 2016 Share Posted March 28, 2016 It's been a while since I studied this, but that's how I remember it is: x += R * sin(T) * cos(F) y += R * sin(T) * sin(F) z += R * cos(T) T is on 0y rotation, F is on 0z rotation. PS: http://mathworld.wolfram.com/Sphere.html 1 Quote Link to comment Share on other sites More sharing options...
Rick Posted March 28, 2016 Share Posted March 28, 2016 Are you looking for the player to rotate this or doing it on your own? This is basically 3rd person camera control with no limitations on it. If you place the camera at the same position as the object it's rotating around, then rotate the camera in whatever direction (x and y usually), then Move() the camera backwards (Move() in LE is relative to the entities rotation so a negative value in the z parameter would move it backwards) then you could get this same effect. It's what a lot of people here do for 3rd person camera functionality. No need for much math at all on your end. Note that you are doing this all in the same frame and you'd keep the rotation value between frames of the camera and just add/sub the value. If you're looking for a nice smooth rotation that the player isn't doing, then look into the lua tween library below, and it gives you that. You'd use it to tween the rotation values over time. https://github.com/kikito/tween.lua 1 Quote Link to comment Share on other sites More sharing options...
macklebee Posted March 28, 2016 Share Posted March 28, 2016 orbital camera example here: http://www.leadwerks.com/werkspace/topic/14066-solvedrotate-the-camera-around-the-object/#entry96667 2 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel 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.