Difference between revisions of "Project6Fall14"

From Immersive Visualization Lab Wiki
Jump to: navigation, search
Line 9: Line 9:
 
==1. Make a Bezier Patch==
 
==1. Make a Bezier Patch==
  
Generate the 16 control points for a cubic Bezier patch.  
+
Generate the 16 control points for a cubic Bezier patch. Put them all in the x-z plane (horizontal), since the patch is going to simulate water.
  
c) Connect the control points with straight lines. ('''5 points''')
+
Tessellate the patch out of GL_QUADS: use uniform sampling to calculate 3D points on your patch on a regular grid. We suggest using around 100x100 quads to produce a smooth surface.
  
d) Draw the cubic Bezier curves the control points describe in a different color than the lines: Evaluate at least 20 sample points (this needs to be a const value in your code that can be changed easily) along each Bezier curve segment. The two curves need to be C0 continuous at the junction point, but higher level continuity is not required for now. ('''10 points''')
+
Connect the points with GL_QUADS in counter-clockwise order to form a surface, and calculate normals. Give the quads a color and material of your choice.
 
+
e) Calculate the vertices for the surface of revolution by rotating the Bezier curve around the axis of symmetry in steps of at most 10 degrees (make this a const value that can be changed easily as well). ('''10 points''')
+
 
+
f) Connect the vertices with GL_QUADS in counter-clockwise order to form a surface, and calculate (normalized!) normals. Use a perfect bright white (<tt>glColor3f(1,1,1)</tt>) for the color of the GL_QUADS. ('''10 points''')
+
  
 
'''Tip:''' You can compute normals as follows: Given the Bezier curve (x(t),y(t),0) in the x/y plane, you first compute the tangent vector (x'(t),y'(t),0). The corresponding 3D normal vector is then (-y'(t),x'(t),0), which you rotate around the y axis similar to the vertices. Don't forget to normalize the normal vectors.
 
'''Tip:''' You can compute normals as follows: Given the Bezier curve (x(t),y(t),0) in the x/y plane, you first compute the tangent vector (x'(t),y'(t),0). The corresponding 3D normal vector is then (-y'(t),x'(t),0), which you rotate around the y axis similar to the vertices. Don't forget to normalize the normal vectors.
  
g) Enable at least one directional light source and position it so that it nicely illuminates the object. Use a light direction from above and behind the camera and slightly offset to the left. ('''5 points''')
+
Enable at least one light source and position it so that it nicely illuminates the patch.  
 
+
h) Allow the user to move the control points with the mouse by clicking on them with the left mouse button and dragging them to a new location. Don't allow moving them across the axis of symmetry. Regenerate the surface of revolution for the new set of control points every time the mouse button is released. ('''10 points''')
+
  
 
==2. Animate the Patch==
 
==2. Animate the Patch==
Line 78: Line 72:
 
* Piecewise Bezier patch
 
* Piecewise Bezier patch
 
* more realistic water
 
* more realistic water
 +
* use triangle strip and show speedup
 
-->
 
-->

Revision as of 18:07, 22 November 2014

Contents

Project 6: Silver Water

[THIS PROJECT IS UNDER CONSTRUCTION. PLEASE COME BACK LATER.]

This project is on Bezier patches, texturing, and environment mapping with a GLSL shader program. The goal is to create a Bezier patch, make it resemble a water surface with small waves, then put it in a textured environment cube and render its surface with environment mapping.

It is due on Friday, December 5th at 3:30pm and will be discussed in CSB 001 on Monday, December 1st at 5pm.

1. Make a Bezier Patch

Generate the 16 control points for a cubic Bezier patch. Put them all in the x-z plane (horizontal), since the patch is going to simulate water.

Tessellate the patch out of GL_QUADS: use uniform sampling to calculate 3D points on your patch on a regular grid. We suggest using around 100x100 quads to produce a smooth surface.

Connect the points with GL_QUADS in counter-clockwise order to form a surface, and calculate normals. Give the quads a color and material of your choice.

Tip: You can compute normals as follows: Given the Bezier curve (x(t),y(t),0) in the x/y plane, you first compute the tangent vector (x'(t),y'(t),0). The corresponding 3D normal vector is then (-y'(t),x'(t),0), which you rotate around the y axis similar to the vertices. Don't forget to normalize the normal vectors.

Enable at least one light source and position it so that it nicely illuminates the patch.

2. Animate the Patch

3. Add an Environment

4. Use Environment Mapping

5. Optional: TBD