Still experimenting with OpenGL, Today's example is about Collision Detection. As you can see from the screenshot... There's two crates and a wire sphere (I've no texture for that).. from the post title, you can imagine that the sphere moves in the direction of a crate and when it collided with the crate it changes its direction.
All the magic is under the hood, in the hit.c engine file. I've implemented a couple of methods that test collision between Box and Box, Box and Sphere, Box and Point, Sphere and Sphere, Sphere and Box, Sphere and Point. In this way you can easily handle the most common meshes, just checking glDataHitCollision(obj1, obj2).
The Source code is available here: GLData Collision Detection Example Source Code. Just type python build.py to build and run (Linux, Mac).
Sunday, November 22, 2009
Nokia Certified Qt Developer!
Friday, I've received the congratulations mail to have successfully passed the Qt Essential exam, with the nice logo that you can see below... so, this post is just to place this sticker somewhere. I still prefer the Qt T-Shirt and the QtCentre paper of the Qt Centre Programming Contest.
Thanks to Giovanni Bajo and Develer, for the opportunity.
Thanks to Giovanni Bajo and Develer, for the opportunity.
Sunday, November 1, 2009
OpenGL: Walk Around Camera
Again, another week spent on OpenGL. I don't know why but I cannot stop to experiment with Meshes, Vertexes, Faces and Textures. It's too amusing! But Todays, post it's just an update of GLData, the small gl data library that I use for my experiments.
The new features, for this update are: Speed-up in GL throughput, and Camera. I've adjusted data structure to use directly glVertexPointer() and related gl*Pointer() functions. The main.c file was adjusted to handle direction keys (Up, Down, Left, Right) to allows you to walk in your 3d world, like any First-Person shooter video game.
You can download the GLData Walk Around Source Code it. (Mesh not Included)
PS: For my Qt followers, and for those which they are waiting for my File-System/Distributed Computational System: I haven't forget Qt and the lovely memset(); I'm just exploring a bit (give me some week), a world that I've completely ignored.
Subscribe to:
Posts (Atom)