CQ6
CQ6
Question 1
The vertex indices of the half-edge's start and end vertices:
A half-edge ( HE ) has a start vertex ( ) and an end vertex ( ). Its SYM pointer points to another half-edge that travels in the opposite direction, meaning the SYM of ( HE ) should have start vertex ( ) and end vertex ( ). Therefore, knowing the vertex indices (start and end) allows you to identify the correct half-edge as the symmetric counterpart. In the implementation part, we could leverage hash map and pair<vertex*, vertex*>
to get these mapping relationships.
Question 2
Function that determines the primitives drawn:
The
Drawable::drawMode()
function determines the primitives (e.g., triangles, lines, points) that will be drawn.In current case, it returns
GL_TRIANGLES
, meaning the mesh will be drawn using triangles. Depending on the return value, different primitive types like lines (GL_LINES
) or points (GL_POINTS
) can be specified.What does
Drawable::getIndexBufferLength()
return?The function
getIndexBufferLength()
returns the number of indices in the index buffer.Where is this value used?
This value is used in the
glDrawElements()
OpenGL function. It tells OpenGL how many indices are present in the index buffer and thus how many elements (e.g., triangles or lines) should be drawn during rendering.