Assignment 4: Texturing and Coloring Geometric Objects
- Due Nov 4, 2018 by 11:59pm
- Points 10
- Submitting a file upload
Objectives
To map textures onto 2D/3D objects and to paint vertices with different colors.
Description
You will use the base code provided below to extend your Paint web application to apply textures onto objects and to support individual colors per object vertex. Your application is required to have the following features:
-
A canvas where the user can click to draw 2D and 3D objects.
-
Your scene should already start with a textured cube (choose any picture).
- 1 face has the whole texture image, 1 has the top half, 1 has the bottom half, 1 has the texture twice (on the left and right of each other), 1 has the texture 9 times in a 3x3 grid.
-
When the user clicks or drags the mouse on on the canvas, a 2D or a 3D object is drawn on the clicked.
- If the object is a tilted cube or a obj file, render it with the selected texture mapped onto it. Every face has the same texture. If no texture has been loaded, render it with the current selected color.
- It the object is not a tilted cube, render it with the selected color. If the color is solid, the entire object should have the same color. If the color is "rainbow", each vertex of the object should have different random colors and the pixels in between the vertices should have interpolated colors (webgl interpolates it automatically).
-
Your scene should already start with a textured cube (choose any picture).
- A button to switch between solid colors and "rainbow" colors.
- A button to load a texture stored in your computer.
- All the features from previous assignments.
Resources
Readings: Matsuda/Lea Ch5
Base code: ASG4.zip
Rubric
Please include a title
Keep in mind that 63 students have already been assessed using this rubric. Changing it will affect their evaluations.
Criteria | Ratings | Pts |
---|---|---|
Have buttons/sliders for add geometries, clear screen, define size and color as per Assignment 3.
threshold:
pts
|
pts
--
|
|
Have a button to switch between solid and rainbow colors.
threshold:
pts
|
pts
--
|
|
Have a button to load a texture stored in your computer.
threshold:
pts
|
pts
--
|
|
Your scene should start with a tilted textured cube with the same texture applied in different ways on each face.
1 face has the whole texture image, 1 has the top half, 1 has the bottom half, 1 has the texture twice (on the left and right of each other), 1 has the texture 9 times in a 3x3 grid.
threshold:
pts
|
pts
--
|
|
2D objects (circles, triangles, squares) should be rendered with the current selected color. If color is rainbow, each vertex has a different random color. If color is solid, each vertex has the same color.
Change colors from per object to per vertex in your Geometry/Vertex classes. Your Geometry class should store one color per vertex. Moreover, you will need to pass colors to GLSL as an attribute buffer instead of a uniform.
threshold:
pts
|
pts
--
|
|
OBJ objects should be rendered with textures applied to them.
The UV coordinates come from the file, you don't have to calculate them.
threshold:
pts
|
pts
--
|
|
Tilted cubes should be rendered with textures applied to them.
If no texture has been loaded, render it with the current selected color.
threshold:
pts
|
pts
--
|
|
Draw an object on canvas each time the mouse is clicked or is held down.
threshold:
pts
|
pts
--
|