Assignment 3: Texturing and Coloring Geometric Objects
- Due May 6, 2019 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
Extend your web application to support textures onto objects and 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
- Examples:
- Code written in lab (04/30): https://canvas.ucsc.edu/files/1296098/download?download_frd=1
What to Turn in
1. Canvas Submission
Zip your entire project and submit it to Canvas under the appropriate assignment. Name your zip file "[FirstName]_[LastName]_Assignment_3.zip" (e.g. "Lucas_Ferreira_Assignment_3.zip").
2. Live Hosted Submission
Host your assignment on your UCSC portal. This can be achieved by just putting your entire project directory into the 'public_html' folder which you can access via the UCSC Unix timeshare. Your site link is 'https://people.ucsc.edu/~ucsc_user_name/'.
WHEN SUBMITTING YOUR PROJECT ON CANVAS, PLACE YOUR SITE LINK AS A COMMENT OF THE SUBMISSION.
Read the SubmissionGuide.txt file for further explanation on how to submit your assignment.
Rubric
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.
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
--
|
||
Total Points:
10
out of 10
|