Quiz
- When two defined vertices have the same position, what properties make them different from each other?
They could differ by surface normal and/or texture coordinates. There's an example in the Threejs reading about custom geometry
(It's also possible for them to differ by color, but we haven't talked about that.)
- What are typed arrays? I read the MDN page and still don't understand.
Sure. Some arrays are generic containers: the elements are pointers to objects, and those objects can be of different datatypes (string, int, float, dictionary and user-defined objects like dates or employees.)
Typed arrays only contain a particular datatype, say INT or BYTE. The framebuffer is such a thing: it only contains 3-byte RGB quantities. Or the data texture arrays that we discussed last time, which were 4-byte RGBA quantities.
This is important for efficiency. The code that pulls bits out of the array can assume a certain representation and doesn't have to worry about different cases for difference kinds of data.
- Could you please go over the code in the .addGroup() part of the reading?
Sure. The
addGroup
method is a Threejs setter method for adding a group to the list of groups for a buffergeometry. Each group is a dictionary with keys forstart
,count
andmaterialIndex
. - I am not sure what questions to ask, but I know I probably will have some in class.
Please do!
- None today! Thank you for the reading
Glad to hear it!