Skip to main content
OP's request for more explanation
Source Link
Seth Battin
  • 5.5k
  • 3
  • 28
  • 43

The three component vectors right, up, and forward probably point along the axes x, y, and z relative to the camera. So by adding these vectors together you can compose any other vector. It works the same as if you built a vector by specifying its three elements individually, except that you are adding three vectors which each have one non-zero element. Normlizing that sum guarantees that the total length of the sum is a vector of length 1.

If Time.deltatime is the time since last update then, except for small variations, dir will be not vary from frame to frame. It's essentially taking the sine and cosine of constant values, which yields a constant camera direction.

If If that time value were accumulated rather than constant, then this would yield a circular motion of the camera. This On the x-y plane, the x and y coordinates could be specified by taking the sine and cosine of a single angle. Your code sample appears to be doing that, using Time.deltatime as its angle (but I think it's doing it wrongly, as it's essentially constant each frame).

This picture is loosely related, please ignore the complex part; I was just trying to find an animation of the unit circle.

The most interesting trigonometry wave gif I could find

If Time.deltatime is the time since last update then, except for small variations, dir will be not vary from frame to frame. It's essentially taking the sine and cosine of constant values, which yields a constant camera direction.

If that time value were accumulated rather than constant, then this would yield a circular motion of the camera. This picture is loosely related, please ignore the complex part; I was just trying to find an animation of the unit circle.

The most interesting trigonometry wave gif I could find

The three component vectors right, up, and forward probably point along the axes x, y, and z relative to the camera. So by adding these vectors together you can compose any other vector. It works the same as if you built a vector by specifying its three elements individually, except that you are adding three vectors which each have one non-zero element. Normlizing that sum guarantees that the total length of the sum is a vector of length 1.

If Time.deltatime is the time since last update then, except for small variations, dir will be not vary from frame to frame. It's essentially taking the sine and cosine of constant values, which yields a constant camera direction. If that time value were accumulated rather than constant, then this would yield a circular motion of the camera. On the x-y plane, the x and y coordinates could be specified by taking the sine and cosine of a single angle. Your code sample appears to be doing that, using Time.deltatime as its angle (but I think it's doing it wrongly, as it's essentially constant each frame).

This picture is loosely related, please ignore the complex part; I was just trying to find an animation of the unit circle.

The most interesting trigonometry wave gif I could find

Source Link
Seth Battin
  • 5.5k
  • 3
  • 28
  • 43

If Time.deltatime is the time since last update then, except for small variations, dir will be not vary from frame to frame. It's essentially taking the sine and cosine of constant values, which yields a constant camera direction.

If that time value were accumulated rather than constant, then this would yield a circular motion of the camera. This picture is loosely related, please ignore the complex part; I was just trying to find an animation of the unit circle.

The most interesting trigonometry wave gif I could find