4.2 Virtual 2D World
1. Building a Virtual World
As you can imagine, there is a lot involved in building a virtual world. Luckily, the insect simulator does not require a whole lot of detail at this stage. Its environment is currently limited to some obstacles and some food. The bulk of the work in building this world was isolated in two parts. The first involved implementing an interface so that the neurons could get information from the body, and affect the parts of the body. Basically this involved answering questions like "How does the firing of a neuron cause a leg to move?" The other difficult part concerned the actual physics of motion and collision detection. When an insect moved its leg with its foot down, how did that motion translate into movement of the insect as a whole? What happens if two legs on different sides try and move it in opposite directions at the same time? A general mechanism for the movement of the insect needed to be found. Also, when an insect collides with an obstacle the simulator needs to detect this and stop the insect from just moving right through the obstacle. The obstacle needs to constrain the movements of the insect. So while this system is much simpler than a 3D physics based simulator, it was by no means trivial to build.
2. Section Overview
The first page in this section discusses some of the details about the insect and its body. It will discuss all of the different parts of the insect body and briefly describe what each part does and how it works. The next topic is the insects environment. It discusses the physics that was used to build the simulator, and then goes on to talk about the properties of food and the details of the collision detection of obstacles. These pages do not typically go into very detailed descriptions of how the software work. Instead, they provide a general guideline of the kind of algorithms used to implement the virtual world.