Question: Modify Program 13.1 so that it moves each vertex slightly toward the center of its primitive triangle. The result should look similar to the exploded

Modify Program 13.1 so that it moves each vertex slightly toward the center of its primitive triangle. The result should look similar to the exploded torus in Figure 13.5, but without the overall change in torus size.

Program 13.1#version 430 layout (triangles) in; in vec3 varying Normal [ ]; in vec3 varying LightDir[]; in vec3 varying#version 430 layout (triangles) in; in vec3 varying Normal [ ]; in

Figure 13.5www W

#version 430 layout (triangles) in; in vec3 varying Normal [ ]; in vec3 varying LightDir[]; in vec3 varying HalfVector[]; // inputs from the vertex shader out vec3 varying NormalG; // outputs through the rasterizer to the fragment shader out vec3 varyingLightDirG; out vec3 varyingHalfVectorG; layout (triangle_strip, max_vertices=3) out; // matrices and lighting uniforms same as before void main (void) { //move vertices along the normal, and pass through the other vertex attributes unchanged

Step by Step Solution

3.41 Rating (160 Votes )

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 Computer Graphics Programming Questions!