HTML5代写/webGl代写/js代写:webGl Project1

HTML5代写/webGl代写/js代写:这是一个典型的html5 webGl相关的图形处理代写程序,本次属于相对基础版本
In this lab, you’ll have the opportunity to experiment with several new WebGL and HTML5 concepts:

Simple shaders
Using buffers to send data to the GPU
HTML and WebGL 2D coordinate systems
Using event data in an event handler
User interaction using the mouse
You’ll modify the template code to produce a very simple drawing program.

For this lab, modify the template code to perform the following tasks:

The display of mouse x and y at the top of the page are in pixel coordinates relative to the canvas element. Modify this display by adding another line displaying the coordinates in floating point WebGL clip coordinates, x and y each in the range [-1.0..+1.0]. Notice that the canvas pixel coordinate origin is in the upper left, and that y coordinates increase in a downward direction. Clip coordinates have the origin at the center of the canvas, and y coordinates increase in the upward direction (standard Cartesian coordinates).
The template program just draws 5 points on the screen. Modify it so that whenever the mouse is clicked (“click” mouse event), an additional point is drawn at the cursor location in the color specified by the sliders (start with an empty canvas).
Add code so that the “Reset” button clears all the points on the display.
After your have step 2 working, modify the program so that if the mouse is moved with the button held down, a point is drawn at every location that the mouse passes over, using the color specified by the sliders


电子邮件地址不会被公开。 必填项已用*标注