CS 537 – Interactive Computer Graphics
In this assignment, you’ll be asked to render a more complex geometric shape to the screen, and you’ll be
How to turn in your Assignment:
The zip archive should contain your Assignment2 folder. This naming system helps us make sure the right assignment is paired with the right individual.
Loading an OBJ File
In the Assignment2 directory, you’ll find a file called “bunny.obj” that contains the geometry we’ll use for this
assignment. We covered this file format in Week 03. You can open it in a text editor to explore the layout of this geometry file format. To simplify the assignment for you so that you don’t need to parse this OBJ file yourself,
you’ve been provided with an OBJ loader function in the file objLoader.js. Do not write your own OBJ loader; just use the code in this file. Important: The starter code that you have been provided already loads the OBJ file contents into memory in the JS application – you shouldn’t need to call the OBJ loader functions yourself.
Setting up a Local HTTP Server
- Render the bunny geometry (triangle mesh) from the OBJ file to the screen. For this, you should investigate and use the function “gl.drawElements” instead of “gl.drawArrays,” as gl.drawElements allows you to use an vertex index list as provided in the OBJ file.
- Render the bunny using a color-coding system where its positional coordinates (xyz) are mapped to the RGB color cube. For instance, the largest value in “y” could be mapped to pure green, while the smallest value in “y” could be mapped to “no green.” The largest value in “x” could be mapped to pure red, and the largest value in “z” could be mapped to pure blue. Variants of this color-coding scheme will receive
full credit, so long as the color of each vertex is clearly a function of the position. You could compute this positional color-coding scheme in the application or in a shader; the implementation is up to you.
本网站支持 Alipay WeChatPay PayPal等支付方式
E-mail: firstname.lastname@example.org 微信号:vipnxx