Our Journey

Since our last blog entry, we have spend a lot of time and effort into this project. The result speaks for itself.

On the Oculus Rift side, we were able to reuse many parts of our Touch controller hand tracking code from Project 1. On the Leap Motion side, we have successfully integrated the Orion SDK. Integrating the Orion SDK was mostly uneventful and we were able to start tracking hand positions after this. Due to the difference between platforms, we applied different scaling factors to the raw sensor data in order to harmonize the coordinates.

We then compiled rpclib for both the Oculus Rift application and the Leap Motion application. We spent a long time on this. We were first burned by run-time library types mismatch. After figuring that out, we went through many iterations of trial-and-error before we figure out the correct way to do two-way communication between the server and the client asynchronously so that it does not block rendering code. Along the way, we also learned a lot about C++ std::future. Thanks to rpclib, we are able to continuously update and display both players' head and hand positions on both sides.

Anaglyph code is completely rewritten. Our proof-of-concept code (shown in the previous blog entry) used the glColorMask + glBlendFunc approach. It does not work well when one object is on top of another. Our new solution was inspired by our CAVE project. It uses two framebuffers to render both eyes' view of objects with their corresponding shaders as two textures and then use another shader to mix the two textures appropriately before rendering it to the screen. The rendering quality improvement is very significant.

We also enhanced our shaders to add texture and lighting support. We spent a long time creating and tweaking our hand-written physics code so that interactions with the ball feel natural. Our physics code handles gravity, velocity and collision course change (including energy attenuation!). Finally, we utilized OpenAL to add background music and sound effects to our applications, further enhancing the gameplay experience.

Watch Project Pong in action:

Popular posts from this blog

Welcome to Project Pong