Question: For every ( s , t ) produced by the two nested for - loops, we need to call this: void ProduceVertex ( float s

For every (s,t) produced by the two nested for-loops, we need to call this:
void
ProduceVertex( float s, float t )
{
vec3 v =?????// do the vertex (s,t) interpolation
v =?????// make v's cordinates be with respect to the CG
v = v *?????// roughly same code as morphing the cow into a sphere of radius uDiam/2.
v =?????// put v back in the global space (ie, un-do the second line of code)
vec4 ECposition = gl_ModelViewMatrix * vec4(v,1.);
vec3 n =?????// on a sphere, the normal is a vector from the vertex (v) to the sphere center (CG)
n =?????// multiply the new normal by the proper matrix and normalize it
// will be needed by the fragment shader to perform per-fragment lighting:
gN =?????
gL =?????
gE =?????
// finally multiply the vertex by the combined matrices:
gl_Position =?????* vec4(??,??);
EmitVertex();
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!