Computer Graphics
3D Library for the Suns
OpenGL (mesa) does not seem to work on the elec eng suns. I have
prepared an alternative version of the library that only uses Xlib (ie,
it is about as low level as you can get while still staying with
'standard' software).
This can be found on the elec eng suns in
~lbull/Public/LibX3D1.0
For those in CS this library can be found in
~ucacmsl/Public/CG/LibX3D1.0. It is worth looking at if you want to see
details of how to do things like clipping (not necessary in the other
library where OpenGL does it for us). Also there is an implementation
of a BSP tree.
Most of the files are the same as for the OpenGL based library,
especially, all the data structures are the same. However, there are
some differences:-
-
Note that calls to the camera are now not with a _GL part, ie, you call
setVRP(camera,x,y,z) instead of setVRP_GL(camera,x,y,z);
-
OpenGL uses a z-buffer. This is much too slow to use just in software,
therefore this library uses a BSP tree instead. Look at the main
program, to see how rendering is performed;
-
There are no materials in this library, there's only flat shading, and
there are various functions in the face.* module to set the colour, and
in light.* to set up light sources.
-
Because there are no materials, the file structure is slightly
different (I mean the files that describe objects - instead of a
material each polygon simply has a red, green, blue colour;
-
It is not interactive;
-
It is obviously much slower!