代写范文

留学资讯

写作技巧

论文代写专题

服务承诺

资金托管
原创保证
实力保障
24小时客服
使命必达

51Due提供Essay,Paper,Report,Assignment等学科作业的代写与辅导,同时涵盖Personal Statement,转学申请等留学文书代写。

51Due将让你达成学业目标
51Due将让你达成学业目标
51Due将让你达成学业目标
51Due将让你达成学业目标

私人订制你的未来职场 世界名企,高端行业岗位等 在新的起点上实现更高水平的发展

积累工作经验
多元化文化交流
专业实操技能
建立人际资源圈

cs代写:WebGl design

2018-02-27 来源: 51due教员组 类别: 更多范文

下面为大家整理一篇优秀的cs代写范文- WebGl design,供大家参考学习,这篇论文讨论了相对高级的webGl,涉及了典型的Web图形处理等问题。

WebGl,WebGl design,assignment代写,cs代写,作业代写

In this assignment, you will write a simple drawing program, based on the Lab 2 code. You may use the Lab2Template.zipView in a new window code, any code you wrote for Lab 2, and any code from the posted solution (to be provided next week). Your program should display a drawing canvas with associated sliders and buttons. Drawing will be performed by mouse clicks in the window.

The assignment is divided into a base program (worth 60% of the total for the assignment), and two features, each worth an additional 20% of the total.

Base Program

The base program should allow a user to draw filled rectangles. It should have sliders labeled “Red”, “Green”, “Blue” with values displayed (as in the lab), additional color buttons, and a button labeled “Reset”.

The user will click in the drawing area to specify two diagonally opposite vertices of a rectangle. After every second click, the positions of the clicks should be used to add a rectangle to the drawing area. The drawing area should display all rectangles drawn so far. The color sliders should select the color for the next vertex.

So for example, selecting a first color using the sliders, defining a vertex, then selecting a second color and defining another vertex, should result in drawing a rectangle with the two different vertex colors smoothly interpolated across the interior. The two additional vertices that you generate for the rectangle should have as their color the average of the two vertex colors. Clicking the “Reset” button should delete all rectangles, reset all sliders to their original values, and start over.

In addition to the sliders, also define a set of buttons which will set the sliders to predefined colors: White (1.0, 1.0, 1.0), Black (0.0, 0.0, 0.0), Red (1.0, 0.0, 0.0), Yellow (1.0, 1.0, 0.0), Green (0.0, 1.0, 0.0), Cyan (0.0, 1.0, 1.0), Blue (0.0, 0.0, 1.0), and Magenta (1.0, 0.0, 1.0). You may add buttons for any additional colors that you like.

Feature 1 – Showing Interaction

Modify the base program by adding code to start drawing a moving “rubber band” rectangle outline when the first vertex of a rectangle is clicked, using the first vertex and the current mouse position as the rectangle opposite corners. After the second vertex is clicked, remove the rubber band lines and add the rectangle to the screen as in the base program.

Hint: use two sets of buffers, one set for the completed rectangles, and another set for the point and lines of the rubber band rectangle. Use gl.bindBuffer to switch which buffers are currently used. Use gl.drawBuffers separately for each set of buffers when redrawing. See the code in ArraySwitchDemo.zipView in a new window for an example of how to handle multiple buffers. You may use code from this demo.

Feature 2 – Sending Uniform Data to a Shader

Add an Alpha (opacity) slider to the program, underneath the Red, Green, and Blue sliders. Use a WebGL “uniform” value to pass an alpha value to the vertex shader (alpha, also known as opacity, is the fourth parameter for specifying a color). The vertex shader should assign this opacity value to rectangle vertices along with the RGB values. An alpha value of 1.0 is completely opaque, an alpha value of 0.0 is completely transparent.

Note: by default, transparency is not enabled in WebGL. Add these two calls during initialization to enable it:

gl.enable(gl.BLEND);

gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);

Graduate Credit Feature 3 – Multiple Primitives

This feature is required for those taking the course for graduate credit; it is optional for those taking the course for undergraduate credit.

In addition to filled rectangles, also allow the user to draw filled triangles by clicking the three corners. Implement the rubber-band interactions features for triangles as well as rectangles. The rubber band should be a line after the first vertex is clicked, and a triangle outline after the second vertex is clicked. The user should have buttons to select “Triangle” or “Rectangle”, and your program should be capable of displaying both on the screen at the same time.

51due留学教育原创版权郑重声明:原创assignment代写范文源自编辑创作,未经官方许可,网站谢绝转载。对于侵权行为,未经同意的情况下,51Due有权追究法律责任。主要业务有assignment代写、essay代写、paper代写、cs代写服务。

51due为留学生提供最好的assignment代写服务,亲们可以进入主页了解和获取更多assignment代写范文 提供作业代写服务,详情可以咨询我们的客服QQ:800020041。

上一篇:Assignment代写:Data Structures T 下一篇:Assignment代写:Different views o