English subtitles

← Cylinder Positioning - Interactive 3D Graphics

Get Embed Code
2 Languages

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

  1. 3JS tends to create what are called canonical objects. This is where you create
  2. an object centered around the origin and then apply a series of transforms to
  3. move it into position. This is fine so far as it goes, but is sometimes awkward
  4. when you want to perform particular kinds of modeling. For example, if I want to
  5. make a model where I want chains of cones to build a tree, I might rather say
  6. where I want each end of the cone to be located. This sort of modelling where I
  7. run a program to generate an object is called procedural model. I want to orient
  8. the cone, given the top and bottom locations. That'll be your task. In the
  9. cullen routine the top and bottom variables are vector three positions given the
  10. ends of the cone. You'll see documentation for the other variables in the code
  11. itself. Your task is to implement the internals of this method. Actually, I
  12. decided to simplify a major piece for you. Mainly because it has a special case
  13. having to do with a cross product. I implemented this function myself. So your
  14. job is to create the proper length cylinder and feed this method its axis
  15. direction and center. When you get the answer right, you'll see this on your
  16. screen. I gave a lot of test cones here, and in fact, a few of these revealed
  17. some bugs in my own code when I was writing it. If you ever design a component
  18. like this, they will be used by others. I highly recommend that you try to
  19. create as many different types of test cases as you can.