- Programming & Development80%
- Design & Production40%
- Networking60%
- System Administrator65%
Project Video
Project Description
Also done for a school project in 2014, this application was quite something!
If you ever worked with bullet physics engine you know that in order to master it, several hours in front of a screen reading class diagrams are a requisite.
This was no different! Purposed by the school teacher, as a small project that used some sort of collision detection mechanism and a simple openGL functions that would draw some forms... However curiosity is a funny thing, usually bringing more work into the table than what was initially predicted!
This project was done with a collaboration of a colleague, that worked along side me from the app design to the final presentation.
The Idea
Initially the idea was creating a Goldberg machine but soon we realised that a project like that was way to ambitious for the 2 Bullet newbies, hence the idea of creating a pool table, which included all the challenges proposed by the professor.
The Skybox and Objects
Naturally the project started with the creation of a skybox that would imitate a room, in this case one of the university rooms. For this I used my dear friend Fireworks to conceive the walls and the ceiling. The next step was to find some furniture, we managed to find some .OBJ files for this purpose, including a pool table a couch and some flowers...
Finding those objects was the easy part, using Blender to make sure they would match our requirements and also making some adjustments to the OBJ in terms of size, was a walk in a park...
Problems arrived while doing the import of object into memory, several libs and examples found online were tested but somehow they all seem inefficient or presented problems.
That being said, with bit of this and that, we finally managed to implement some code that successfully imported the objects.
The Bullet Physics Engine
We started to pay attention to the bullet engine and playing with their test cases.
Our main goal was to make the balls colliding with the table borders, bouncing back and naturally, collide between them...
One of the issues presented was the "re-coil" effect or making the ball bounce back using the appropriate rate for a pool ball, which we managed to bypass thanks to a function in Bullet that allows to fiddle with object properties.
Another issue was making the balls aware of the table floor, even thought bullet offers functions to detect OBJ forms we could not make it detect the pool table properly in a way that if one of the balls happen to be on top of one of the holes it would just fall into it.
The Hack
In order to go around this problem we developed a class that created transparent static rigid forms, and we basically made a mould of the table. To make the ball fall into the holes we made a transparent box around the holes trying to approximate its dimensions to the table hole as much as we could. This way bullet engine was able to identify these forms and render physics accordingly.
The Stick
Last but not least we imported a pool stick into the animation and made it follow the white ball, it does presents some glitches even thought we have tried some optimization but we got to a stage were we reckon that to make it better it would come as very time consuming, compromising the project schedule.
Applying text in OpenGL
One last bonus to us was the addition of writing into the application. Easier said than done! Not that we couldn't find any lib that would do that in C++ but the simple fact that most of them were not compatible with the system or the application.
Final Notes
It does presents some problems and its far from being perfect but in the 3 months given to us to make it happen and without any previous knowledge of any physics library I think we nailed it!
Project Information
Categories: Application Development
Video Url: https://www.youtube.com/watch?v=DIAvDdmtcvs
Blender : http://www.blender.org/
Bullet : http://bulletphysics.org/wordpress/
Project Timeline
Start: May, 2014
End: July, 2014
Project Video
Project Description
The Conway's Game of Life ... Done for a school project in 2014, it was a very challenging and ambitious project but also very interesting.
After spending some hours analysing Conway's theory, the challenged was proposed to the class to built a Java application that could simulate the Game of Life.
With this came several requirements such as:
- Ability to enable/disable cells via mouse click.
- Ability to read a matrix from a file and load it.
- Ability to write current matrix to file.
- Zoom and Speed
- Spherical Matrix
So naturally there was some pressure to make it all work within the schedule provided.
The "Matrix"
From the beginning, problems soon arrived, main issue was "how to draw a grill that could visually interpret-ate the matrix cells ? ", initially I thought of creating a buffered image that could be manipulated as the simulation occurred, problem with this was the processing time, since it was generating an image on every iteration of the simulation, proving it to be slow and cpu consuming.
In the end, a JPanel was used and lines were drawn within it to make look like a matrix, from there customization was done, spending some hours in the GUI making it looking as good as i could.
The "Engine"
The engine part was very tricky because its when you pass from the theory to the action.
Naturally that happened with a multidimensional array that could accommodate the matrix size, and a cycle was programmed so that it analysed every cell on each iteration pass, this way the system could apply Conway's rules depending on the cell state.
Unfortunately not all went accordingly to plan on this one, as the application bypasses a couple of rules I wrote and does not renders exactly as Conway's describes.
However the GUI part of it works very well and the logic can easily be fixed in a future enhancement.
Final Notes
Very exciting project that took a lot of hours in front of the screen but I was very happy with the end result.
Project Information
Categories: Application Development
Video Url: https://www.youtube.com/watch?v=Ab9fL1kk2Mo&rel=0
Project Timeline
Start: Jan, 2013
End: Feb, 2013