sábado, 4 de mayo de 2013

Implementing Physics

This week i decided to implement physics in my sidescroller. The game map is a Blender scene exported with a custom python script i coded. One problem i ran through was when i tried to implement correct coordinate handling.

Usually, when exporting geometry outside blender, it is a common practice to use XZY ordered vectors when using OpenGL as backend. It turns out, this over-complicates things on the physics side, because you're mixing and matching coordinates incorrectly.

It is a LOT easier to just use whatever Blender exports and adapt your work to it, i.e. using Positive Y as your forward vector instead of Positive Z (as Blender does).

Why is this? It turns out Blender interprets the Z coordinate as the axis going upwards from a cartesian plane, which is a little different to what you're used to in OpenGL, where the Z coordinate is the forward axis.

Well, enough text, here's a video of the game in action:
As you can see, the graphics are somewhat simple right now, but it is just test art right now. More is coming in the future, but i'm focused right now exclusively in the gameplay, which is what is fun in the long run.

No hay comentarios:

Publicar un comentario