Hi back!
Sure. Just like a coin has two faces, all triangles have two sides. They might look quite different, say red and green. As you can imagine, only one side is visible from a particular viewpoint. So, the graphics system can save literally half the work by only rendering the visible side.
But now consider a box. Assume the camera is outside the box, and the outer faces are all the "front" of their triangles. Some of the inner (back) faces are "facing" the camera and would be visible if it weren't for the outer faces. So, we can save the renderer even more work by saying, "only render front faces"
The front and back are defined by whether the vertices are counterclockwise (front) or not (back).
Let's draw a triangle on a sheet of plexiglass and look at from both sides.
An API is an interface between two pieces of software. For example, the OS controls the hardware via interrupts and system calls. You can access those from Python by importing the OS module. That OS module allows your program to talk to the OS.
In this course, your program talks to TW or Threejs which translates to WebGL which talks to the CPU and the GPU (graphics card).
Threejs is "higher level" than WebGL; that means it does a lot more things for us, providing pre-built stuff and pre-written software. The price of that higher level is always a bit fo control and sometimes some performance, since translating down to lower layers always takes a bit of time. But you also gain "power" in the sense of being able to do more stuff more easily.
In industry, I'm sure they are focussed on getting stuff out the door, but they also want to not be sued for copyright infringement, so they won't (hopefully) steal other people's software. WebGL is an industry standard, so that's not an issue. Threejs is open source, so while there are probably licensing restrictions, it's pretty available.
Great question. Students have done this before, particularly making the box smaller. Where is my new box? Inside the old one, which you forgot to remove. Oh!
Yes, when we re-render from a different angle, we send in the vertices again, at least to lower layers of the pipeline. The vertices might already be sitting in memory of the graphics card. High-end graphics cards come with lots of memory, most of which is used for user data.
But the mathematics is definitely re-executed!
The latest version of Threejs encourages you to think in SI units, so meters for distances.
But that won't affect us for many weeks when we get to PBR, so it's okay to think in other units.
For sure! I'll illustrate with the barn.
Trees would often be done procedurally, with fractal patterns and randomness and such. People are an enormous amount of work and are done in lots of ways. A character like Shrek would have an underlying bone structure, with skin and such laid over, so that the skin adjusts when the arms move, for example. And you know about motion capture for characters like Gollum. Then the mesh is built by scanning a person like Andy Serkis (Gollum) or Benedict Cumberbatch (Smaug).
The TW.createMesh()
always uses MeshNormalMaterial
, just for rapid prototyping.
Great question about points and vertices. The answer is just how they are used. Much as real mathematicians use them.
I'd be glad to, but what do you want to know?
Great!