While developing the initial version of the Magnetics Lab project I recognized the potential for improvement and expansion on the basic interactions I created around the idea of magnetism. In this blog post I will cover the second stage of development for the Magnetics Lab project where I was able to build and implement these interaction variations. Below is a short demo video which covers some of the highlights of these new types of reactive objects, attractor fields, and interactions.
Magnetics Lab Demo Preview Video
This post will cover the following development steps I took while creating this demo
- Focus
- Monopole Attractors
- Dipole Magnets
- Magnetic and Electrical
- Electromagnetic
- Gravitation
- Planetarium
- Planetarium HD
The Focus
While developing this stage of the Magnetics Lab I focused on two primary objectives: expanding the scope of potential applications this project could be applicable to and creating a streamlined demo that would be easy to quickly introduce to potential collaborators.
I knew from the initial development of the basic magnetic interactions that a variety of similar concepts would be easy to create and implement with some specific alterations to the code running the interactions. After some tinkering with my code, I was able to implement these variations to create the interaction types I cover in more detail in the following sections of this post.
Once I had the variant interaction types functioning correctly, I then set about putting together discrete demo scenes that each exemplified a different interaction type. While building these scenes I tried to focus on creating a stage for the user to engage in a discovery and exploration experience in order to learn about the various interaction types. This meant avoiding large blocks of text or audio instructions for the user to read and limiting the content of each scene in order to narrow the focus into small, additive, easily digestible interaction concepts. Stringing these scenes together into a specific order allowed me to slowly introduce the user to increasingly complex interactions by building off of the concepts introduced in the previous scene.
Below is a full preview video of the playable Magnetics Lab demo
Monopole Attractors
In my mind, when introducing a user to magnetic style interactions the logical starting point is monopole attractors. These attractors are essentially the backbone of the interactions in the Magnetics Lab, as they were the first and simplest interaction type I created when I first started work on this project. These attractors interact by exhibiting the most basic concept of magnetism, the idea that opposite polarities attract each other, and matching polarities repel each other. Each of these monopole attractors has either a positive or negative polarity. When one of these objects enters an attractor field it is either drawn directly toward the source of the field, or repelled away from the field based on the polarity of the object and polarity of the field.
Dipole Magnets
Although the monopole attractors covered in the previous section are a great starting point for magnetic interactions, they don’t quite reflect the functionality of real-world magnets as much as I would like. One of the biggest issues with them is that real-world magnets always have two polarities. So, the next step in development was to create dipole magnets. Initially I attempted to create these dipole magnets by building composite objects which contained two separate monopole attractors attached to a single parent object. These composite objects did not exhibit the behavior I was hoping for, instead the influence the fields had on any object would cancel each other out. After tinkering around a bit more in my code, I was able to create magnetic fields which added a displacement to the direction that reactive objects would be drawn toward based on polarity. This meant that instead of matching polarities being pushed away and opposites being drawn toward the fields source, now both polarities would be drawn into the field, but would be diverted toward opposite ends of the field source based on their polarities. I now had magnetic fields and objects that interacted in a way that more accurately reflects the magnetic interactions seen in the real world.
Magnetic and Electrical
Once the displaced variation of attractor interactions used for the dipole magnetic fields was functioning correctly, I realized that with an alteration in the direction of displacement I would be able to create circular/rotational interactions. This immediately made me think of interactions between magnetic and electrical fields/objects. When an electrical charge moves along a wire, a magnetic field is created which rotates around the wire. So, I decided this would be the next interaction variant I would tackle. Once again after some tinkering in my code I was able to create this rotational attraction interactions.
At this point I realized I would need to add some additional framework to the Magnetics Lab in order to differentiate between different types of fields and objects. Until this point the only variation needed to run the interactions was the difference in polarity for the fields and objects. So, I created a system of types which included magnetic, electrical, and gravitational. By designating some objects and fields as electrical and some as magnetic, I could display this new interaction variant. As seen in the video below, when an electrical object enters a magnetic field it rotates around the center of the field, with its direction determined by the electrical objects charge.
Electromagnetic
The next aspect of interaction I wanted to implement was to build on the basic magnetic/electrical interactions I created in the previous section. I wanted to make an electromagnetic object. As I mentioned above, when an electrical charge moves through a wire it creates a magnetic field that rotates perpendicular to the direction of its motion. Up to this point all of the fields used in the project were essentially stationary relative to the source object the field was attached to. So, I created a variation of field which rotated and changed its size, direction, and rotation speed based on the velocity of its source object. By attaching this new type of field to an electrical object and setting the field as a magnetic field, I was able to create what I have been referring to as an electromagnetic object. The creation of this new object type drastically increases the potential implementations and applications of this demo project.
Gravitation
The last of the interaction variations I created was a very simplified version of gravitation. Although the sizes and distances used in this gravitational interaction variant don’t reflect reality, the core interactions are similar enough to convey the concepts of how gravity and gravitational fields effect objects. Trying to accurately replicate real world sizes and distances needed to create and witness real gravitational interactions is not plausible for this style of project. The objects involved would have to be so massive and so far away from each other that I don’t feel that the user would gain any benefit or learning from the experience. But a simplified version of these interactions fits very well with the rest of the content and concepts in the Magnetics Lab project.
Planetarium
Now that I had all of the interaction types developed and a simple intro scene put together to introduce the user to interaction type, I wanted to put together a small use case example scene. This example scene would demonstrate how these fields and objects could be implemented to create educational material for more specified topics. My inspiration for this example scene came from the sample demo scene build into the PuppetJump framework. This PuppetJump demo scene labeled the “Core Demo” contains a set of planet like spheres that rotate around a central point above the middle of the room. These spheres can be grabbed by the user, then when released they implement the Forcibles system to navigate back to invisible predefined target object positions. I decided to create a similar scene for my example, however instead of the planets following predefined paths the planets in my example scene would move based on the gravitational field created by the central “Sun” object.
So, I created the example scene which I have been referring to as the Planetarium. This scene does not accurately represent the size or placement of planets in our real-world solar system, but it does demonstrate how the gravitational interactions in the Magnetics Lab can be used. The planet objects of different sizes and masses are drawn to rotate around the Sun in the middle of the room. The user can reach up and grab any of these planets and when thrown or released the planets will be drawn back into orbit using gravitation. The users can even grab the sun and throw the sun in order to witness how changes in its placement and orientation affect the orbits of the surrounding planets.
Planetarium HD
The last step in this stage of development for the Magnetics Lab was to add a little bit of flare to the planetarium example scene. While interviewing for my current immersive experience developer job with the Center for Immersive Experiences at Penn State, I was given a week to create a small game project based a specific set of requirements. While working on the final versions of this game, I found out that NASA has a large catalog of publicly available assets which include texture images of the surfaces of most of the planets and many of the moons in our solar system. I had used these assets in the final version of my game to add character and a space theme to the basic requirements of the assignment and to create a Planetarium minigame.
Since I still had these NASA planet texture assets, it seemed like a simple and logical move to apply them to the planets in the Magnetics Lab planetarium example scene. In doing so I created the Planetarium HD scene. Functionally these two scenes are identical, but the addition of these planet textures and a skybox containing accurate depictions of the stars gave this example scene the extra wow factor I was looking for to finish the playable demo of the Magnetics Lab with a bang.
Leave a Reply