The objective of this project is to aid in the therapy of arachnophobic individuals by submersing them in a virtual environment that simulates moving spiders walking though familiar scenes in the patients everyday life. Our hope is that by having the user confront his or her fears head on by placing them in such an environment we can improve, if not cure them, of their phobia.
Throughout our project we were able to work very closely with our advisor, Dr. Milton Huang. Dr. Huang is a psychiatrist at the University of Michigan Medical Center in Ann Arbor, MI and has had previous experience with treating patients using virtual reality environments. Most of the parameters for this project came from recommendations that Dr. Huang had, based on his medical knowledge and previous experiences with treating patients in a virtual environment. The four main parameters for our project is as follows:
(1) Object Association - There are two scenes that we developed in virtual reality to be sure that the user would be able to relate, or associate to. The first scene that the user is initially placed into is a living room. The room is very comfortable and is set up like most living rooms are: with a couch, television, and a table. We wanted the user to get the impression that this would be a place where you would go to read a book, watch television, or just to relax. In other words, we wanted the user to feel relaxed with nothing to worry about before they encountered their first spider.
The basement is set up to have the complete opposite effect on the user than the living room. We have included many things to make the basement feel vary dank, and scary. The goal in creating the basement model was to make the user see things that they immediately associate spiders with. Some examples of this would be spider webs, concrete walls, an old stairway, dark corners, and old, dusty boxes. In fact, just walking around in a dark basement will make most people keep a look out for a spider running across the floor!
(2) Give Patient Control - One of the things nice about the environment we have set up for the patient is that they have full control over the environment they are in. While in the VR cave, the patient has the freedom to walk wherever he/she wishes. If the user becomes too frightened, they also have the control to move themselves back into the living room where it is a very calm, warm environment.
(3) Levels of Difficulty - One of the most important parameters that needed to be incorporated into our virtual environment is the ability to raise the number of spiders in the environment. The reasoning for this is as the user becomes braver, and comfortable with his/her surroundings, we want them to have the option to increase the level of difficulty by adding more spiders to the environment. If the user suddenly panics because there are too many spiders walking around him/her, we want the user to have the option to leave the spider area in the basement. We do not, however, want the user to be able to decrease the number of spiders. This is because when using exposure therapy as we are here you always want to make forward progress, never backwards.
(4) Reduce Patients Imagination of what will Occur - One of the main goals of this project is to denounce any fears that a patient might have with respect to what "might" happen if he/she encounters a spider. The spiders in our environment are completely harmless. They do not attempt to bother the user, nor do they attempt to bite the user if he/she are in close proximity to the spider. All the tiny insects do is wander around aimlessly within the house. Our hope is that once the user spends some time walking around our environment that he or she will start to believe that spiders are harmless.
After making the decision that we were going to have a living room and a basement as our two focus rooms we needed to decide on what type of props we wanted to model to put in the rooms and how we were going to model them. Our first task was to test out how easily we could export VRML 1.0 files out of various types of modeling programs and view them in the VR CAVE. To do this, we modeled up various shapes using FormZ, 3D Studio Max, and Unigraphics and then exported the files to VRML 1.0. When viewing our newly exported files, we found that it was extremely difficult to decipher and sort through the code if we ever wanted to manually add something to the file such as a texture. Based on our results, we decided that it would be safer if we modeled the majority of our environment by hand. We then began modeling the spider, basement, and living room.
Initially, we were lucky enough to find a VRML 1.0 model of a spider on the Internet. However, to use the spider model we had to modify the legs on the spider so that each leg was a separate entity from the spider's body. This was necessary so that we could later have the ability to animate the spider's legs to simulate it walking.
Modeling the basement and the living room turned into being a relatively easy task. The reason for this is we wanted to keep the number of polygons we used for our entire model at a minimal amount. We found that the best way to minimize the number of polygons we had was to use primitive shapes as much as possible instead of modeling things with a lot of curves.
Once we had the basement and the living room modeled and attached to one another, we had to make some decisions on what kinds of props to place in each of the rooms. For the basement, we wanted it to be dark, musty, and unclean. To accomplish having this environment, we modeled typical things that one would find in a basement environment such as a beam with pole supports, a staircase coming down from the living room, spider webs, boxes, fluorescent lights, shelves, furnace, and pipes.
The living room environment is almost the complete opposite to that of the basement environment. We wanted to living room to be clean, and pleasant. To do this, we included things that one would find in a typical living or family room such as a couch, lamp, and a table.
Textures and Objects
As the goal of the project is to help people fight their fear of spiders, we needed to place patients in an environment that induced fear in them. To do so, the environment needed to resemble a real-world place where people encounter spiders. We chose a basement, as basements are very common places that everybody would recognize, people usually find spiders in their basements as opposed to other rooms, and people tend to associate basements with their fears.
There are issues with placing people directly into the exposure environment, however. Often a patient will need some time to get accustomed to the immersive VR of the CAVE. To allow for this, we created a living room in the upstairs. It contains a couch, table, and lamp as one might expect to find in a living room.
Once the patient is accustomed to the behavior of the 3D environment, he or she moves down the stairs to the basement environment. As the main encounter environment, the basement needs to look as real as possible. We achieved this by placing things like boxes, shelves, pipes, and a furnace in the basement.
Textures play an important role in creating a realistic environment. In the living room, we used textures to simulate such things as wallpaper, the fabric on the couch, carpeting, and the metallic look of the pole of the lamp. The basement was to look dark and messy, so we used textures to simulate grease spots on the floor, water damage to the boxes, and rust on the furnace. Some of the textures were taken from online public domain image collections and modified in Photoshop; others them were created entirely in Photoshop.
In order to port our world into the VR CAVE there were many things that we had to do extra with our model that we were not first aware of. First off, all of the VRML code that we wrote had to be VRML 1.0 and not 2.0. This initially caused a problem because all of our group members were fluent in VRML 2.0 as that is what was taught in our ENG 477 class. Thankfully, we discovered that VRML 1.0 was very similar to 2.0 and it was easy to make the change over.
Another problem we had and solved is that all the dimensions (in pixels) of textures used in the CAVE have to be a power of two. This was a relatively easy problem to solve once we figured out why we could not get any of our textures to display in the cave. To solve the problem we used the graphic editor xv to change the dimension of all our texture files.
One of VRML's shortcomings is the ability to animate objects. To get our spider to move its legs and to travel across the floor, we needed to learn performer and some of the performer libraries. Performer can be defined as an animation language that was developed by SGI. More information on how and why we used performer to animate our spider can be found in the "Animation Techniques" section of this document (see below).
Since this project was built from the beginning to be CAVE-ready we ran into some interesting challenges. We used the Iris Performer 'C' libraries to view the models, position and rotate the models, animate the spiders, and handle navigation. The performer libraries can only import Inventor files, which is identical to a VRML version 1.0 file. This meant that we could not use any of the scripting or advanced features that VRML version 2.0 provides. We used VRML 1.0 files to hold our of our models, including the basement, couch, boxes, spiders, and everything else in the application. The spiders were imported as nine pieces: a body and 8 legs. Using the Performer libraries we animate each leg on the spider, and were able to make the spiders rotate and randomly walk around the basement.
We used performer for all of our navigation as well, which allowed us to add collision detection to the walls of the basement and living room, as well as simulate the effect of walking down the stairs by controlling the height value of the navigation matrix.
Because our C++ program controls all aspects of the experience we can add features which allow the user to control the intensity. Each time the user presses the first button on the wand the intensity level increases, which means the amount of spiders in the room with the user is increased.
In the future the software could be modified so that the intensity heightening will also increase the size of the spiders, modify the texture of the spiders, have the spiders start crawling up the walls, etc.
The source code for our project can be downloaded here:
This is the main part of our program, it initializes the CAVE, imports the VRML 1.0 files, positions and rotates the models, handles navigation, and handles the increasing of the intensity level.
This is the Spider class, it will load the VRML files for the spider's body and each of the legs. It also sets up the animation functions.
Each of the nine VRML models that make up the spider has their own SpiderData object that goes with it. The SpiderData class contains the necessary information for the Spider to move and rotate the model in the correct way. This class is passed to the animation functions held in the Spider class.
These are the Inventor files
In conclusion, our project was very successful. We were able to meet all of the project parameters that our project advisor had set for us. The ability to associate to the objects that were placed in the basement was very strong. It was very easy for the user to relate our model to similar, personal scenes where they had seen creepy spiders walking on the floor. While being submersed in the CAVE, the user has full control over all movements including the ability to raise the level of difficulty and the ability to exit the frightening basement if the environment becomes too stressful. By having the spiders walking harmlessly on the ground, we were able to reduce the patients imagination of what might occur if he were to let a spider get close to him/her.
The programming aspect of this project was also very successful. All the VRML 1.0 models that we coded turned out to be very life like. This was accomplished by scaling the environment in a way so that all the objects had the dimensions that they would have in real life. Some time was also spent on creating realistic textures and lighting effects to add into our environment. Again, by adding textures and the proper lighting we were able to create very life like effects within our model.
One of the toughest programming tasks we had during this project was coding the spider in C++ and performer in order to get the spider to take on signs of life. It took some time before we could get the spiders all moving forward as opposed to moving sideways or backwards. We also had to enable the spiders to turn while walking across the basement floor, as we quickly discovered that the level of realism declines if the spiders only have the ability to walk in a straight line. Animating all eight of the spider's legs so that it appeared to be walking was done using performer. Again, by getting the legs to move we were able to really get the spider to have life like movements. Our final programming task was to contain the spiders in a certain area so that they could not walk through the basement walls and outside of our environment. Once this functionality was added in, we had very realistic looking spiders and a very realistic looking environment.