ECS175 Assignment 2
Drawing Basic Shapes
Start Assignment
In this assignment you will learn how to draw basic shapes using WebGL. You will implement three basic shapes and use Vertex and Index buffers to define your geometry and upload it to the GPU. This assignment requires you to understand the basics of CPU-side programming in WebGL like buffer creation, buffer binding, and handling vertex attributes.
Copyright By PowCoder代写 加微信 powcoder
Refer to Chapter 2 in the textbook. Requirements
When complete, your assignment should fulfill the following requirements:
Clear the canvas to Aggie Blue
Support the three shapes Point, Triangle, and Square
Allow drawing user selected shape by clicking on the canvas
The shapes must be centered around the cursor
Allow switching shapes using the keyboard shortcuts ‘P’, ‘T’, and ‘S’
Allow clearing all shapes and filling the canvas with Aggie Blue by pressing ‘X’
Switching between Discrete and Continuous mode should allow you to either draw one shape per click or a continuous stream of shapes while holding the mouse click. Similar to apps like Paint or Photoshop.
The template contains a file assignment2.js which contains empty classes and/or methods that need to be implemented by you. There are several comments to give you hints on what each part of the code needs to do.
Grading Criteria
1 pts Vertex Buffer Creation
1 pts Index Buffer Creation
2 pts Vertex Attribute Object Creation
2 pts Rendering Shapes
1 pts Correct Shape Placement Centered Around Cursor 1 pts Shape Class Implementation
2 pts WebGL Class Implementation
How to Get Started
Click on this link to join the assignment on Github Classroom and get access to your personal repository.
After you join, you might be prompted with a message like this:
You can disregard that message and head directly to your repository (blurred-out section in the image).
You will use this repository to manage your submission. Please commit and push regularly to save your work.
We provide a code template that contains basic files to get you started. The provided template is an HTML5/JS webpage that you can display by hosting the index.html file locally and viewing the local URL in your browser of choice. We strongly recommend developing in Google Chrome as it will be the platform used for grading. We’ll show you how to simply host a page locally in one of the lectures.
How to Submit Your Work
Submit this homework by submitting the URL to your Github repository along with your Github username here on Canvas.
Structure your Canvas submission like this:
Github User: [your Github username here]
Repository: [your repository URL here]
Your work has to be submitted to Canvas and pushed to Github before the due date. We will consider the latest commit for grading, so consider if your improvements are worth a late penalty.
We do not grade a program that does not run. Late submissions will lose 10% per day.
You are encouraged to help one another, but you must write your own code. If you use somebody else’s code, document it. You must abide by the UC Davis Code of Academic Conduct.
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com