- Home /
Camera Rotation
Hello guys!
I've documented a little about Camera Rotation and I still didn't found sth to give an effect of Earth Rotation around Sun ( To move the camera around Left Click of mouse which is a static point ).
I founded that I should use cos & sin functions but I don't know how.
I want to make the rotation like in this VIDEO but I have 0 ideas how.
Can you help me somehow please?
Answer by Glurth · Feb 04, 2018 at 04:02 PM
I would recommend you "child" the camera object, to an otherwise empty object, that is placed at the same location as the SUN object. Now, you can simply rotate this object, to have the camera rotate about the central point. e.g.
parentObject.transform.rotation = Quaternion.Euler(0,rotationAngle,0); //sin and cos trig-stuff done in here
Whats nice about using a parent like this is that if the cemera starts out looking at the central object, it will continue to look at the central object, as you rotate the parent.
Nope. It doesn't work. I am on a 3D space and I want to move it around terrain that is created
Your answer
Follow this Question
Related Questions
Why is my camera not snapping 90 degrees? 0 Answers
Choose starting point/angle for rotation with cos and sin 0 Answers
Trigonometric functions 2 Answers