Quiz
- Hi! :)
Hi back!
- I'm still a bit confused as to what front and back mean for faces.
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).
- Can you expand on how the vertices of triangles are listed/ defined? For the example in the text, why are 3,2,4 and 2,4,3 equivalent?
Let's draw a triangle on a sheet of plexiglass and look at from both sides.
- I think I get what these APIs do, but I'm still a bit unclear on what exactly an API is.
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).
- What is the relationship between the 3 discussed API's, and how do we choose between them when producing graphics? In commercial or research settings, are there restrictions on using API's developed by other individuals (just out of curiosity, not yet a concern that I have personally.)
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.
- What would happen if you created a box without removing an existing box, presumably in the same location? Only asking because of that line of code that replaces/removes any existing boxes.
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!
- I wanted clarfication on part of the reading. If we look at the barn from a different angle, would we also have to send in different vertices? Or is the camera angle the only one that changes? Is that what happens when we re-execute the mathematics of the pipeline using our initial vertices, like it is mentioned in the reading?
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!
- From the reading, you mention that coordinates can be written in
any units of our choosing, but that we might chose specific unit to
fit the needs of a project. Are there certain unit-choice conventions
we should be aware of/lean towards, to help our code be more
accessible to collaborators?
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.
- I don't have a specific question, but can you explain more about Normal Vectors and show more examples of them and the face they're associated with?
For sure! I'll illustrate with the barn.
- How do professionals typically approach modeling complex objects like trees or people in Three.js? Do they still rely on basic geometries?
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).
- Does TW always use THREE.MeshNormalMaterial as the material if it's not specified? We might just cover this later, but how are points and vectors differentiated if they're both defined using Vector3?
The
TW.createMesh()
always usesMeshNormalMaterial
, just for rapid prototyping.Great question about points and vertices. The answer is just how they are used. Much as real mathematicians use them.
- Could we talk a bit more about how mesh work?
I'd be glad to, but what do you want to know?
- None so far :)
Great!