Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COThere are a few minor flaws in this solution: 1) The rotation rate should be multiplied by the elapsed time that frame. 2) I would suggest accumulating the rotation in the angle, rather than the camera position itself - and for good measure I'd probably use `WrapAngle` on the angle.
      singulars
    2. CO@Andrew. 1) I agree in practice but I left 'elapsed time' out purposefully to simplify the algorithm so it could be visualized and understood better. Perhaps not a good choice, I don't know. 2) I disagree on this one. It is not good, in 3d, to store angles that have to do with rotations/orientations from frame to frame. In 2d, storing an angular representation of something's orientation is good and proper. In 3d, it's bad. See this link, with an emphasis on the last paragraph on the blog post: http://blogs.msdn.com/b/shawnhar/archive/2010/02/12/doing-math-in-2d-vs-3d.aspx
      singulars
    3. CO@Steve I am afraid I disagree. While you are quite right about not using angles for calculations as a general rule, it is perfectly valid to use an angle to place an orbit camera. You have to create a rotation matrix from an angle in order to trace out a circle (you do so yourself). I simply suggest a better way to store it. The thrust of Shawn's article is that an implementation of something like `CreateLookAt` should not use angles and trigonometry - but dot and cross products (which it does).
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload