Showing posts with label OpenGL/Class Projects. Show all posts
Showing posts with label OpenGL/Class Projects. Show all posts

Friday, March 16, 2012

Simple Raytracer

Simple raytracer that calculates colors for individual pixels. The raytracer is able to calculate shadows, diffuse lighting, specular reflection, as wells as actual reflection up to three levels of recursion. Executable found here and a sample parameter file here.

Formating for the parameters:


NEAR <n>
LEFT <l>
RIGHT <r>
BOTTOM <b>
TOP <t>
RES <x> <y>
SPHERE <name> <pos x> <pos y> <pos z> <scl x> <scl y> <scl z> <r> <g> <b> <Ka> <Kd> <Ks> <Kr> <n>
LIGHT <name> <pos x> <pos y> <pos z> <Ir> <Ig> <Ib>
BACK <r> <g > <b>
AMBIENT <Ir> <Ig> <Ib>
OUTPUT <name>

Friday, January 27, 2012

OpenGL Affine Transformations Project

OpenGL animations done with affine transformations. A bee flies around a swaying flower with a sphere for foliage. Since OpenGL is not object-oriented and I do not feel comfortable handling non-object animations, I made classes for both the bee and the flower. The static keyword allows for calling class functions without creating an actual object.

Link to zipped executable here.

Thursday, January 19, 2012

Sierpinski Gasket



This fascinating pattern is created by the following steps:
  1. Pick 3 vertices for a triangle
  2. Assign a color for each vertex (In this case, red, green and blue)
  3. Pick an arbitrary point "p" that is inside the triangle, with an arbitrary color
  4. Pick, at random, one of the vertices. 
  5. Find the midpoint, "m", between "p" and the randomly picked vertex, along with the mid-point color
  6. Draw "m", and replace "p" with "m"
  7. Repeat from step 4

Friday, January 13, 2012

Nachman: Class Project


Two screenshots from a class project from winter quarter of last year. This was done in C++.

Graphics Library by Konstantin Knizhnik


Link to zipped executable