A touching story
A lot of work went into this project. A lot of work, a lot of coffee, and a lot of complaining. I have to thank all my friends at various coffee shops for keeping me sane.
Here are some note worthy things that I will talk about one by one:
Collisions
Basketball and Hoop "scoring"
Sound attenuation due to object velocity
Transparency rendering
Sound Effects - finding, editing, combining
Modeling and Textures - finding, editing, applying
Animations
COLLISIONS
To understand almost all of these I need to first talk about how interactive objects are classified in my program. They are either: tractoring, grabbed, or "moving." These are all very important distinguished states.
Tractoring - If I'm tractoring I want all my objects to go through everything. This is because often the ball goes out of the court or the darts go out of the bar and I can't have them sticking on the outside walls when I just want them back in my hand. Additionally, the darts can hit eachother as they are coming together in my hand.
Grabbed - if the objects are grabbed then I need to attach them to the world tracker that electro supplies. This will keep them "stuck" in the right place.
Moving - when the objects are flying through the air they need to again obey all collisions back in order to interact with, not only the physical objects, but my virtual "scoring" objects as well.
BASKETBALL AND DART SCORING
I score the basketball by putting a small virtual cube just in the hoop. The hoop itself is made up of a ring of virtual capsules to guide the ball into the hoop. Additionally I must make sure the basketball is hitting the virtual cube from above and not below. We don't want anyone cheating :).
The darts are bit more complicated because of the intricacies of the dart board. Basically I detect when they hit the board then I find the distance from the center of the dart board they are using the collision point given to me by electro. I then figure out what radial circle that is in (miss, double, single, triple, bullseye) and also figure out the theta difference between the normalized collision point and 1,0. This theta tells me how far along the circle from the far right position I am in terms of degrees. That's all the info I need to give a score.
SOUND ATTENUATION
I knew from the get go that I wanted to do realistic sound. Electro provides some of this easily by using sound emitters and recievers. But I also wanted the sounds to be softer if the objects didn't collide as HARD. If a sound is part of the "moving" objects category, I continually pull and store its current velocity. When it hits something I then have the appropriate information to attenuate the sound played back.
TRANSPARENCY RENDERING
Rendering transparent objects is most certainly a challenge. I had to figure out how to orient my transparent objects in the scene graph so they are drawn at the right time. In order for them to be drawn right, they need to be drawn after other objects that are behind them. It still isn't perfect in my program, but its believable.
SOUND EFFECTS
I definitely spent a lot of time on getting just the right sound for things. It's amazing how much difference a single sound makes in these environments. I even spent time mixing some of my own sounds using clips I had found online. Here's a pic of me mixing a jet disengaging sound, with a flying sound, and a landing sound to get my perfect "landing on the platform out of the air" sound. However, I couldn't implement the mechanics in time, so you won't hear it in the environment just now.
MODELING AND TEXTURES
I probably spent more time doing this than I should of. But I'm a creative guy, and I loved this aspect of making the bar. There is a lot of work in getting the textures to line up on the wall. And you'll notice in my environment very complicated combinations of texture positioning. Its not just "slap a texture on a wall" and go for me. I constructed special geometry just to be able to do that in most cases.
I of course did all the modeling myself as per the project requirement (except for andy's original "hand" model). I think I actually got better at modeling as this project went on. I'm looking forward to making models for the next one.
Probably the most challenging thing to make was the jukebox. There are some pictures below of me making it.
ANIMATIONS
The animations you are seeing took considerable time. I hate things that look artificial and coordinated in VR environments. So you'll notice that most things that are animating, down to the small electric balls in some of the bar stools, are moving independently of each other. For these types of objects, I tried to find ways to minimize overhead while making sure that there was enough randomness in the system.
You'll also notice great care was taken in animating things like the jukebox page turns. If you click the button repeatedly, the page will not "jump and snap" into place to catch up with your input. It finishes the animation smoothly before animating the next page. It does not "ignore" your key presses.
Lastly, when you do happen to select a song the mood in the bar changes. I had many more ideas for this. But right now, lights change colors, some of the change out intervals are modified (the ones that govern the glowing balls in the bar stool), and the dance floor tempo is changed. I didn't get time to really check to see that this was happening. If it's not happening, it's a mere lines of code away.
SCREENSHOTS
Various screen shots of modeling and such:













