Skip to content

Ngoguey42/scop

Repository files navigation

scop, Summer 2015

.obj rendering with OpenGL 4.1
Grade (TBD/100) (TBD/125)*

Goals:
  • Code in C, observing 42's norm (see below)
  • Use modern OpenGL, >=4.0 with shaders
  • Parse and render a .obj file
  • Rotation around y axis
  • Apply grey shades on each faces
  • Apply a texture on the object
  • No math/3d library allowed
Recommended bonus:
  • Handle any .obj
  • Smart texture projection
My work:
  • Watched a course from UC Davis on youtube (see below)
  • Read Learn OpenGL website (see below)
  • Used GLFW for window handling
  • Matrix operations
  • Randomly generated land at startup. Built on GPU
  • Blinn–Phong single source lighting. Represented with a movable yellow sun
  • Shadows with depth cubemap
  • Tesselation on sun from a tetrahedron to a sphere. (Automatic or controls with keyboard)
  • Tesselation on land from {color,height,normal}maps generated at startup
  • Advanced mesh processing
  • Multiple texture projections
  • Dynamic controls for object/textures/texture-projection-mode/mesh-processing/camera-potion/object-position/sun-position/sun-tesselation


Useful links:

Introduction to Graphics Architecture:
Learn OpenGL:
Light shading, Flat vs Gouraud vs Phong


Videos:

https://vine.co/u/1241053296954363904

Live mesh processing

Live mesh processing

Live lighting and shadows on land

Lighting and shadows on land

Live lighting and shadows in room

Lighting and shadows in room




All my C files strictly observes school's norm, it may often lead to odd or illogical syntaxes.
- [ ] Forbiden keywords: for, do, switch, goto.
- [ ] No more than 25 lines inside a function block.
- [ ] No more than 80 characters per lines.
- [ ] At most 5 functions per files.
- [ ] Only 1 declaration per line.  
- [ ] No declaration and assignation on the same line.
- [ ] At most 1 assignation per line.
- [ ] No more than 4 parameters for a function.
- [ ] No nested ternary.
- [ ] Comments alowed at the top of the file.
*
- A grade of 85 was required to validate the project.
- A maximum grade of 125 was reachable.
- Second sessions are organised for failed projects.