Graphics Reference
In-Depth Information
gl_Position= uProjectionMatrix* vec4( V4, 1. );
EmitVertex( );
EndPrimitive( );
}
// look for a silhouette edge between triangles 042 and
// 405:
if( N042.z * N405.z < 0. )
{
gl_Position= uProjectionMatrix* vec4( V4, 1. );
EmitVertex( );
gl_Position= uProjectionMatrix* vec4( V0, 1. );
EmitVertex( );
EndPrimitive( );
}
}
Exercises
1. Implement the silhouete for new geometry as speciied by your instruc-
tor, and implement variations for both, such as
a. Vary the color of the silhouete edge to relect the direction of the edge.
b. Vary the color of the silhouete lines to relect the primitive ID of each
segment.
2. Create a surface of various degrees of smoothness from four 3D vertices
using bilinear interpolations. Use GL_LINES_ADJACENCY to input the ver-
tices together. For the collection of vertices, break them up into an arbi-
trary number of triangles like this:
using the bilinear equation
() =−
(
)
(
) +−
(
) +−
(
)
Qst
,
1
s
1
tQ s
1
tQs tQ stQs t
1
+
,
0
,
1
.
0
1
2
3
Search WWH ::




Custom Search