Monday, November 14, 2005

My Computer Graphics Assignment

One of the modules that I have taken this year is Computer Graphics. It is about 3D computer generated objects and how the computer tracks scaling, positioning and rotation in 3D space. The module sticks very well to the basic theory of how it works and I probably know enough right now to create my own very rudimentary 3D engine using a couple of 2D lines and a grid.

As a practical side to the module we have been instructed to use a free 3D graphics program called POV-Ray. POV-Ray is different to other 3D design tools because it doesn't have a graphical designer, instead the user has to programmatically generate objects. The advantage to this is that the designer can create objects that are based on mathematical principals like These or These. And I myself have found being able to design one object and then generate thousands of duplicates in under eight lines of code to be very useful.

Anyway the limits of my skill doesn't extend much further than this:
#include "colors.inc"
#include "textures.inc"
#include "stones1.inc"

camera {
location <10, 5, 10>
look_at <0, 3, 0>
}

light_source { <10, 8, 3> color White*2 shadowless
spotlight
radius 40
tightness 5
point_at <0, 3, 0>
}

plane { <0, 1, 0>,0
pigment {
checker color Black, color White
}
}

box {
<-1.7, 0, 1.7>,
<1.7, 0.5, -1.7>
pigment {Gray}
texture { T_Grnt16 }
}

box {
<-1.2, 0, 1.2>,
< 1.2, 0.5, -1.2>
pigment {Grey}
texture { T_Grnt16 }
translate <0,0.5, 0>
}

cone {
<0, 1, 0>, 1
<0, 5, 0>, 1.0
pigment {Gray}
texture { T_Grnt16 }
}

sphere{
<0,6,0>,1
pigment {Pink}
}
Which when rendered looks like this image below:

Image Hosted by ImageShack.us

The assignment I am expected to produce for my practical is This. I know POV-Ray is capable of doing Very Nice 3D Work, but I don't think I am going to be able to do the picture justice. Still my limited skill should get me a pass at least.