Black Sun Progress Report
Summary of Progress to Date
Thus far, I have written a great deal of code in the process of building
the Black Sun virtual environment. Initially, I built upon code from Project
#2 with its navigation code and other useful aspects. However, many
improvments on that code have been made making it more powerful and
expandable. Changes include:
- The movement interaction has been modified to use mouse interaction
rather than keyboard control and pointing a finger. Forward movement
is now made by holding down the left mouse/controller button, and
reverse motion is activated by holding down the second mouse/controller
button. This is much more effective than keyboard interaction,
especially on a slow machine because there appears to be a great deal
of loss of keyboard input whereas mouse input is more reliable.
- The code for the project has been separated out into the following
source files (as of this writing):
- main.c
- The code for initializing the C2 interface and the
environment are here. The general rendering and movement
code is also in this file.
- util.c
- This file contains general-use routines such as one for
adding vertices and their normals in one step (at the user
level) and one for calculating the distance between two
points (given either in two- or three-dimensional
coordinates).
- BlackSun.c
- Rendering code for the exterior and interior of the Black Sun
is here.
- BlackSun_objects.c
- This file contains easy-to-use interfaces into rendering
various complex objects such as spheres, cones and others.
Expandability and reuse is the goal with this code.
- Street.c
- Later, this file will contain code for rendering much of the
Street outside the Black Sun. It is not currently in use at
this time.
Header files related to the various .c files also exist for
separating pieces out appropriately.
- The interface into storing various types of complex objects (spheres,
hemispheres, etc.) has been expanded upon. The implementation written
for Project #2 was specific to that project, and this new version has
been made more general for easier and more powerful use.
- I re-read Snow Crash to get a good idea of all the descriptions
of the Black Sun, the Street and other parts of the Metaverse.
As can be seen here, much of the work done so far has been in data structure
design. I feel that making aspect as functional and powerful as possible
will make the rest of the project easy to complete.
Currently Implemented Features
At this point, the movement imported from Project #2 is functional and works
better than what was written for Project #2 (as described above). The
outside and part of the interior have been built according to the description
and scale given in Snow Crash. The circular bar in the center and the
grids of tables have not yet been implemented, and the tunnels and other
underground areas still need to be plotted out and then implemented.
The following snapshots show what has been done so far.
|
|
This view gives a distant image of the user standing outside the Black
Sun at its initial position. The size of the Black Sun in comparison to
the user is show well from this angle.
|
|
|
The view here is from inside the Black Sun looking out towards where
the entrance will be.
|
|
|
This is again from inside the Black Sun and is viewing the user from
the "distant" view. The position here is the same as the previous
snapshot.
|
|
|
The position here is from far above the Black Sun (which is
currently 65 meters tall). The small circle near the bottom of the
open slit in the front has a diameter of one meter which shows how far
away the user is and how large the Black Sun itself is.
|
|
|
Finally, a close-up of only the circular shape mentioned in the previous
caption is shown. The hemisphere in the center is supposed to be a
black sun, and it will be the only part of the Black Sun's exterior
that will be matte black.
|
Difficulties Encountered
The main difficulty encountered so far has been with lighting. The inside of
the Black Sun is matte black to allow for fast rendering and more processing
power for collision detection and other features. In Snow Crash, the
reflective properties of the exterior are not described. I have decided to
give it some specular reflection so that its corners and other features are
visible against the night sky of the Metaverse. However, getting the shading
to work properly has been difficult. Whether I am doing something wrong or it
is just the fact that the surface of the Black Sun is black, the end result
is that edges and slopes and other surface features are not easily visible if
at all. Clearly, this also causes problems with depth perception while
moving around and inside the Black Sun. I plan to carefully review the OpenGL
programming guide's section on lighting again as well as the CAVE library
documentation in case I have missed something so that this difficulty can be
overcome.
Another problem I have had is doing texture mapping. This virtual environment
will require only a few textures, but I have not yet been able to understand
how to actually load an existing texture that I create or download and map it
to a polygon. However I have not studied all the information on how to do
this, and I feel certain that once I read what is necessary, it will be an
easy task. At this point, it is by no means a critical problem.
Steps to Completion
The following lays out what I feel are the most important steps (in order of
importance) in completing this project by the end of the semester:
- Fix the problems with the lighting.
- Render the interior of the Black Sun.
- Implement collision detection and gravity controls to allow the
navigation to be as realistic as possible.
- Design and render the tunnels and giant fire under the Black Sun and
build an "access control" so that the user will have to lift up a part
of the floor to actually get to this part of the environment.
- Design the nearby parts of the Street outside the Black Sun.
- Look into the avatar library to see how it can be added to the whole
environment.
Other Relevant Information
I have decided that the time spent working on this project will be best
spent if I do not try to learn to use MultiGen. Initially, using MultiGen
seemed like a very good way of allowing me to complete the project quickly
and make it as effective as possible. However, I have since decided that
trying to learn MultiGen might take more time than I can afford, and I would
prefer the challenge of finding out what my limits of OpenGL knowledge are.
In the end, I will probably have to work harder to get the same results from
using only OpenGL, but I feel that it will be well worth the time and effort.
$Id: progress.html,v 1.2 1998/04/30 06:13:42 mystify Exp $