Interactive Explorer Project Description


Introduction - Overview of a Typical Connection - Classes Used - IXServer Details - IXClient Details - Algorithms of Interest - Remaining Tasks/Ideas - Conclusion

Introduction
The following excerpt from the demonstration page describes the desired experience:
You are represented by a point which has freedom of movement in a three-dimensional environment. The world as viewed from your current position and orientation is displayed along with buttons which can be used to navigate the environment. This view is updated as you - or other people and objects - move around in the virtual environment. As you explore, you will find two types of objects: those that are fixed in place and those that you can push by bumping into them. Try interacting with the environment around you!
The goal of this project is to create a three dimensional environment which can be Interactively Explored by multiple people simultaneously. Multiple users should be able to explore the environment with full freedom of movement and discuss what they see with each other. This conversation is made possible through the use of IRC-type messaging capabilities also provided by the applet. A client should be able to join at any time without having to know anyone's Internet address, worry about who else is present at the time, or obtain permission to join an active session.

A few of the key features:
Introduction - Overview of a Typical Connection - Classes Used - IXServer Details - IXClient Details - Algorithms of Interest - Remaining Tasks/Ideas - Conclusion

Overview of a Typical Connection
Before anything else can happen, a machine needs to be set-up to run a web server and the Interactive Explorer server, IXClient. Once this machine is in place and has been provided with the necessary files (web pages and Java classes for IXServer and IXClient), a client can initiate a session as follows:
  1. The client starts her browser and accesses the URL of the Interactive Explorer page.
  2. Her browser requests the page from the server which sends the page and code for the client applet, IXClient.
  3. The user's browser loads the applet and begins executing it.
  4. As part of its initialization, the applet attempts to connect to the Interactive Explorer server on the server machine.
  5. The server, on receiving a connection, spawns two threads for handling the new connection (a reader and a worker/writer).
  6. The client, on making the connection, spawns a thread for receiving update messages from the server and requests an update.
  7. The server, on receiving an update request, sends a complete description of the current state of the environment to all currently connected clients.
  8. The client, on receiving the update, renders the view as seen from the user's current position and orientation.
The client is now connected and active. Any of the following can occur depending on the actions of the currently connected clients: When the client has finished using the applet, she closes her browser/loads another page/disconnects from the network, and the following events occur:
  1. The user's applet terminates without sending any additional messages.
  2. The server, on sending its next message, determines that the connection has been terminated.
  3. The server frees all resources dedicated to maintaining information about the client.
  4. The next update message from the server contains no reference to the previously existing client - it vanishes.
Introduction - Overview of a Typical Connection - Classes Used - IXServer Details - IXClient Details - Algorithms of Interest - Remaining Tasks/Ideas - Conclusion

Classes Used
Class Name Purpose Used by
IXServer
Used by
IXClient
ButtonConsole Draws a bitmap of buttons and handles mouse input. Used for "Movement" and "Rotation" buttons. No Yes
CollisionDetection Performs collision detection for a point moving through a set of triangles or a triangle moving through a set of points. Yes Yes
Environment Contains a description of the current state of all objects (including clients) in an environment. Yes Yes
IndexedLine Representation of a line with end-points stored as indices into a separate array of points. Yes Yes
IndexedObject Representation of an object consisting of points, lines, and triangles with objects stored as indices into separate arrays of their respective type. Yes Yes
IndexedTriangle Representation of a triangle with end-points stored as indices into a separate array of points. Yes Yes
IXClient Main class for the client applet. Handles the user interface and the major functionality of the applet. No Yes
IXClientConnection Separate Thread which handles client-side communication with the server. No Yes
IXClientInformation Contains information about a client connection. Yes No
IXClientRenderer Separate Thread which handles all aspects of rendering the client's current view of the environment (including coordinate transformations, clipping, and drawing calls). No Yes
IXClientScreen Handles the z-buffered drawing of points, lines and polygons on a pixel-by-pixel basis. No Yes
IXServer Main class for the server application. Handles establishing new connections and provides shared methods for safe environment modification. Yes No
IXServerConnection Separate Thread which handles sending data to a client when necessary. Yes No
IXServerConnectionReader Separate Thread which handles reading data from a client and responding to it. Yes No
IXServerTimer Separate Thread which ensures that an event will occur every n seconds. Yes No
PerspectiveTransform Matrix for computing the perspective transformation of a point, TPERSP. No Yes
Semaphore Implementation of a binary semaphore for ensuring mutual exclusion and blocking. No Yes
ThreePoint Representation of a point in three-dimensional space (with double variables) as well as point operations. Yes Yes
ThreeVector Representation of a vector in three-dimensional space (with double variables) as well as vector operations. Yes Yes
TwoPoint Representation of a point in screen space (with int variables). No Yes
ViewTransform Matrix for computing the viewing transformation of a point, TVIEW. No Yes

Introduction - Overview of a Typical Connection - Classes Used - IXServer Details - IXClient Details - Algorithms of Interest - Remaining Tasks/Ideas - Conclusion

IXServer Details
Since IXServer is expected to be run for extended periods of time, care has been taken to make it as stable and reliable as possible. IXServer should be able to handle multiple clients connecting, disconnecting, and doing whatever they want in the environment, as well as lost connections and data. Because the security limitations of Java prevent clients from sending messages directly to each other, any information that is intended to reach all clients must be routed through the server. These requirements and others led to certain implementation decisions:
Introduction - Overview of a Typical Connection - Classes Used - IXServer Details - IXClient Details - Algorithms of Interest - Remaining Tasks/Ideas - Conclusion

IXClient Details
IXClient is intended to be run on the user's machine in the (Java-enabled) web browser of their choice. It should not be too demanding of the underlying hardware, and should be easy to use and understand. The obvious goal is that a wide variety of people will be able to quickly acclimate themselves with the applet and begin using it (instead of trying to figure out how to use it). The attempt to accommodate these and other criteria led to a number of implementation decisions:
Introduction - Overview of a Typical Connection - Classes Used - IXServer Details - IXClient Details - Algorithms of Interest - Remaining Tasks/Ideas - Conclusion

Algorithms of Interest
Introduction - Overview of a Typical Connection - Classes Used - IXServer Details - IXClient Details - Algorithms of Interest - Remaining Tasks/Ideas - Conclusion

Remaining Tasks/Ideas
Introduction - Overview of a Typical Connection - Classes Used - IXServer Details - IXClient Details - Algorithms of Interest - Remaining Tasks/Ideas - Conclusion

Conclusion
Writing this applet has been an excellent learning experience. As can be seen by some of the issues covered above, the Interactive Explorer project makes use of a number of current technologies (such as client/server computing, the Java language, and 3D environments). While one can learn a considerable amount about something by reading about it, there's nothing like designing an implementation to ensure you really do understand. Overall, I am pleased with the way the project has gone. The current state of the application is far from perfect, but it accomplishes almost everything I initially envisioned. Performance, while not stellar, is very reasonable considering what is being attempted and how it is being accomplished. However, there are still a number of things that could be done, and so I look forward to continuing my work on this project.


The applet is available.
The source code is not currently available since this is a work in progress and therefore in a constant state of flux - there is a considerable amount of extra code in place (for profiling purposes among others) which makes understanding the code much more difficult.