Pages

Friday, August 9, 2013

My first collision algorithm


Introduction

When I started 3D programming I soon realized that a lot of things I gave for granted on all the games I played, weren’t so. For example in a 3D world there are only textures and triangles to be drawn. Collisions and a lot of things alike have to be created on your own. That means that if you want the camera not to pass through a wall you have to create an internal geometric representation of the wall and manage the logic yourself.
I want to point out that there are many approaches for handling collisions. I am only showing my approach, I think that everything should be from simple to complex. I have seen so many people trying to enter to the 3D programming world but most of them back out because a lot of tutorials demand previous background of so many areas of knowledge that people get usually overwhelmed.
About the math used in this article, I studied it at school when I was about 12 years old, so I guess you don’t need to have a solid background to understand this and won’t be rocket science.
I say again this algorithm its only my approach I think there are far more better on the web but this one its pretty simple and it puts you on the right way.

Monday, October 29, 2012

3D simulation of a lathe using solids of revolution, C# and openGL

Last month a teacher from my former college call me telling me that they were going to model all the machines in their mechanical workshop and that they will simulate all ther procesess in a 3D enviroment. They were starting with a lathe, but there was a problem, they had no idea how to make the lowering of the pieces with the lathe's blades.

Monday, May 7, 2012

A new version of my 3D asteroid game in OpenGL with C#

 

This article is an update of my first article named “A basic 3D asteroid game in OpenGL with C#”. In this version I added the shooting feature. I will try to explain it briefly here
The first thing to do is to get the mesh that contains the rocket
Mesh misiles; //This goes as a class attribute

misiles = m.GetMeshWithName("avion07");
m.RemoveMeshByName("avion07");

After getting the mesh reference we delete it from the model because we are going to draw and manage it in a different way than the ship.
One drawback is that in the 3d model the four rockets are recognized as a single mesh, that’s why when we shot a missile the four are shot. I don’t have too much knowledge of 3D Max to make the four missiles as single meshes and that brings another complication; the missile position is the same for all, which means that we are going to check collisions on one single point that is the center of the four missiles.