Difference between revisions of "CISC440 S2018 HW1"
(Created page with "stub") |
|||
Line 1: | Line 1: | ||
− | + | First, get OpenGL 3.3, [http://www.glfw.org/ GLFW] installed using instructions in [http://www.opengl-tutorial.org/beginners-tutorials/tutorial-1-opening-a-window/ OpenGL Tutorial #1] regarding installation on your system. To be sure it is working, run the program, which just pops up an empty (black) window | |
+ | |||
+ | Now, starting from [http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/ OpenGL Tutorial #3] (Matrices), you will: | ||
+ | |||
+ | * Create a new 3-D [https://en.wikipedia.org/wiki/Polyhedron polyhedron] from multiple transformed versions of the isosceles triangle, right triangle, and/or square. See draw_cube() for an example of how to do this. It does not need to be a regular polyhedron -- you can make a rubber ducky or any other [http://i.kinja-img.com/gawker-media/image/upload/s--KMPf9Vy5--/yc7sj7zdwn2o7zacyfsg.jpg wacky shape] that you want | ||
+ | * Arrange multiple (≥ 10) copies of your object in a 2-D pattern. Vary the color and scale/orientation/location of the objects. '''[2 points]''' for enough copies, '''[3 points]''' for creativity/aesthetics. | ||
+ | ** Use at least <tt>glm::rotate()</tt> and <tt>glm::translate()</tt> '''[2 points]''' | ||
+ | ** Use a few (≥ 3) different colors '''[2 points]''' | ||
+ | * Create ''plan'' view and (approximately) ''isometric'' view of your model with different parameters to <tt>glm::lookat()</tt>. Make the camera close enough that object fills most of window. '''[2 points]''' | ||
+ | |||
+ | I am providing an already-modified version of <tt>tutorial03.cpp</tt>, called [http://nameless.cis.udel.edu/class_data/cg_s2017/modified_tutorial03.cpp <tt>modified_tutorial03.cpp</tt>], which has a function <tt>draw_triangle()</tt> that takes as arguments a ''different'' model matrix and (r, g, b) color for each triangle to be drawn. (The [http://nameless.cis.udel.edu/class_data/cg_s2017/MultiColorSimpleTransform.vertexshader vertex] and [http://nameless.cis.udel.edu/class_data/cg_s2017/MultiColor.fragmentshader fragment] shaders have also been modified -- you should not need to go into these). <tt>draw_triangle()</tt> should NOT be modified for this assignment. | ||
+ | |||
+ | Back up the original .cpp in the directory, drop in the modified .cpp (plus the shaders linked above), and rename it to <tt>tutorial03.cpp</tt>. Then start modifying it further to satisfy the homework requirements. | ||
+ | |||
+ | When you are done, submit <tt>tutorial03.cpp</tt> (with your name added in the header section to attest that YOU did the coding) and a screenshot for each view to Sakai. Make sure it is easy to switch between plan view and isometric view in code (commenting out different version of <tt>glm::lookat()</tt> is fine). | ||
+ | |||
+ | ==Graduate students only== | ||
+ | |||
+ | * Your calls to <tt>draw_triangle()</tt> cannot be "hard-coded". Rather, you must programmatically create a pattern such as a [https://en.wikipedia.org/wiki/List_of_convex_uniform_tilings tiling], a [https://en.wikipedia.org/wiki/Koch_snowflake Koch snowflake], or representation of some other 2-D mathematical function | ||
+ | * Your pattern must have ≥ 100 triangles | ||
+ | * You must use shear, scaling, or other kinds of transformations in addition to rotation and translation |
Revision as of 14:55, 16 February 2018
First, get OpenGL 3.3, GLFW installed using instructions in OpenGL Tutorial #1 regarding installation on your system. To be sure it is working, run the program, which just pops up an empty (black) window
Now, starting from OpenGL Tutorial #3 (Matrices), you will:
- Create a new 3-D polyhedron from multiple transformed versions of the isosceles triangle, right triangle, and/or square. See draw_cube() for an example of how to do this. It does not need to be a regular polyhedron -- you can make a rubber ducky or any other wacky shape that you want
- Arrange multiple (≥ 10) copies of your object in a 2-D pattern. Vary the color and scale/orientation/location of the objects. [2 points] for enough copies, [3 points] for creativity/aesthetics.
- Use at least glm::rotate() and glm::translate() [2 points]
- Use a few (≥ 3) different colors [2 points]
- Create plan view and (approximately) isometric view of your model with different parameters to glm::lookat(). Make the camera close enough that object fills most of window. [2 points]
I am providing an already-modified version of tutorial03.cpp, called modified_tutorial03.cpp, which has a function draw_triangle() that takes as arguments a different model matrix and (r, g, b) color for each triangle to be drawn. (The vertex and fragment shaders have also been modified -- you should not need to go into these). draw_triangle() should NOT be modified for this assignment.
Back up the original .cpp in the directory, drop in the modified .cpp (plus the shaders linked above), and rename it to tutorial03.cpp. Then start modifying it further to satisfy the homework requirements.
When you are done, submit tutorial03.cpp (with your name added in the header section to attest that YOU did the coding) and a screenshot for each view to Sakai. Make sure it is easy to switch between plan view and isometric view in code (commenting out different version of glm::lookat() is fine).
Graduate students only
- Your calls to draw_triangle() cannot be "hard-coded". Rather, you must programmatically create a pattern such as a tiling, a Koch snowflake, or representation of some other 2-D mathematical function
- Your pattern must have ≥ 100 triangles
- You must use shear, scaling, or other kinds of transformations in addition to rotation and translation