Difference between revisions of "Project1S16"
(Created page with "Note: this is a preliminary description of the project, so you can get started on it. The final version of the project will go on line by end of day 3/29. ---- The first hom...") |
|||
Line 1: | Line 1: | ||
Note: this is a preliminary description of the project, so you can get started on it. The final version of the project will go on line by end of day 3/29. | Note: this is a preliminary description of the project, so you can get started on it. The final version of the project will go on line by end of day 3/29. | ||
+ | |||
+ | We recommend that you start by getting your development software ready. More information on this is [[BasecodeCSE167S16 | here]]. | ||
---- | ---- |
Revision as of 11:14, 29 March 2016
Note: this is a preliminary description of the project, so you can get started on it. The final version of the project will go on line by end of day 3/29.
We recommend that you start by getting your development software ready. More information on this is here.
The first homework project is aimed at getting you familiar with the tools and libraries that will be your friends throughout the quarter. These will include GLFW and GLew. You are free to use any other graphics or window management library, however you must contact us first for approval, as we want to make sure that you are not using a library that does too much of the homework for you.
For the first homework project, you will be:
Writing a parser for the .obj file extension (more info to come) Rendering the 3D object defined by the .obj file Manipulating the object (translation (moving), scaling, rotating (orbiting), etc.) using the keyboard, and Implementing a way to switch between immediate mode (which is the code that we provide) and modern OpenGL (this usually gives you a 100x speedup!), which will be discussed next week after we formally introduce modern OpenGL to you.
4. The OBJ file format
For the purposes of keeping your sanity intact, all .obj files we provide will have only information of vertices (lines starting with a v), normals (lines starting with a vn), and faces (lines starting with an f). You won't need to worry about normals and faces until project 2, but for those curious, this is very important when dealing with shading (lighting, colors, that kind of stuff).
The general format for vertex lines is:
v v_x v_y v_z r g b
Where v_x, v_y, v_z are the vertex x, y, and z coordinates and are strictly floats.
The values r, g, b define the color of the vertex, and are optional (i.e. they will be missing from most files). Like the vertex coordinates, they are strictly floats, and can only take on values between 0.0 and 1.0.
All values are delimited by a single whitespace character.
The general format for normal is the same as for vertices, minus the color info.
The general format for face lines for files you will be working with this quarter is
f v1 v2 v3
or
f v1//n1 v2//n2 v3//n3
Where v1, v2, v3 are the indices of the vertices (i.e. the order in which they appear in the .obj file, so the 5th line that starts with v will have index 5), and n1, n2, n3 are the indices of the normals. If the n1, n2, n3 values are missing, then it is assumed that the vertex and normal indices are the same. Please note that obj object indexing starts at 1, not 0.
You can find more info about the .obj file format on Wikipedia. Again, you are only responsible for the v, vn, and f lines, however being able to parse other types of lines can be very helpful, as extra credit portions of the homework may involve more complicated .obj objects.