English subtitles

← Translation - Interactive 3D Graphics

Get Embed Code
3 Languages

Showing Revision 2 created 05/25/2016 by Udacity Robot.

  1. Translation is just a way to say move something to a new position. In fact, in
  2. 3JS, we've been using translation for positioning parts of the drinking bird
  3. model. 3JS has translation and other transforms built into every object. In this
  4. code, we're moving the center of the sphere to the position 0, 540, 0, which is
  5. a vector, that is any point on the sphere is moved by this vector to a new
  6. position. This code does the same thing, only this line has been changed. It's
  7. pretty obvious that this y-coordinate can be the sum or product of any set of
  8. numbers. My point here is that adding values together like this is equivalent to
  9. adding the coordinates of the vectors. So here, a vector of 0, 160, 0 and a
  10. vector of 0, 390, 0 are added together to get 0, 540, 0. Translations can be
  11. treated somewhat like numbers in this respect. You can add them together in any
  12. order and you'll obtain a final translation vector that sums all the
  13. translations and tells you the final position.