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>

Wednesday, February 22, 2012

Underhell - Chapter 1 Trailer

Trailer for the Half-life 2 mod i'm coding for. Check out the already released prologue!

Official Website: http://underhell.wecreatestuff.com/

Env_message Entity modification HL2 (for Underhell mod)

A modification to Env_message. The button on the left is an Env_message entity with a parameter override in a new input function. This mod uses that override to specify which message index to print. This way numerous different messages can be displayed with only one Env_message entity.


The right-most button is a game_text entity and the middle two are Env_message entities using keyvalues instead of parameter overrides to print a message. Source code for this is available on request.

Ambient Generic entity fixed (for Underhell mod)

This fixes the Ambient Generic stop and toggle methods to stop and toggle a non-looping sound.


This online guide:https://developer.valvesoftware.com/wiki/Ambient_generic:_stop_and_toggle_fix


did not work correctly until I notted (! operator) m_fLooping in the if statement.


Shooting the white block toggles the sound and shooting the other block stops the sound.

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