English subtitles

← Instancing - Interactive 3D Graphics

Get Embed Code
3 Languages

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

  1. Instancing is the idea that a single geometric set of triangles can be reused
  2. again and again. For example, for a lamp, you might have a single piece of
  3. geometry for a bulb fixture. If you want three bulb fixtures, you then set up
  4. transforms for where the objects go but reuse the same set of triangles for each
  5. one. In three.js a mesh of triangles is called its geometry. Though you often
  6. hear it called no objects mesh, a mesh in three.js, is a type of object. This is
  7. easy enough to do in three.js. If the geometry doesn't change, just reuse it.
  8. Here's a simple example. I create the geometry for a cylinder, and then reuse it
  9. again and again for each mesh object that I make. Note that an object is made
  10. from some geometry and a material. This means I could've given each cylinder a
  11. different material while we're using the same geometry. Say, I have a car model
  12. with 4 tires. The question to you is, which of these are valid reasons for using
  13. instancing for tires? It allows an individual tire to be shown as our of air and
  14. flat. It reduces the number of transforms needed. It can use less memory. It
  15. allows some tires to be drawn with less geometry than others.