25
Jul 09

Particle-challenge part 2: OK – the math-part is a little bit hard…

Matrix Transformation It’s summer. I’m 500 km from home, and I’m trying to find some time to continue on the particle-challenge.  In the last post, I didn’t decide where to go next; The world, the particles or physics. After some thinking, I found the first one most important, and chose to read a little about how the coordinate system in OpenGL works. It sounds simple enough, but after some coding, I really feel that I need more math skills to get control of this. I have now started to read ‘Beginning Math and Physics for Game Programmers’ to see if I can get the hang of it.

I have started on a camera class, but can’t make it work quite like I want to. There ain’t much functionality in it yet, either.

The camera consist of three vectors: eye position, forward direction and up direction. In theory, the class should make a rotation-matrix from the forward and up vectors, and then translate the matrix by the eye vector.

For now, it uses gluLookAt( ) to do the transformations instead. The reason why is simply that I can’t get the math to work… I’ll have to look at it some more at a later time, but now, I want more particle-fun and less math-hassle.

snapshot of the code is available.


10
Jul 09

1st particle-challenge: Getting something unto the screen

No firework, but it's somethingA couple of days ago, I took a challenge to show that making a particle engine is not that hard. I also stated that the first part of the challenge would be to get something unto the screen, and that is as far as I have come. I have enough code to emit particles unto the screen, beautifully rendered as small triangles in various colors.

Well – its no firework, but it’s a start…

For those who are interested in the code, it’s available for  download here. The lib-folder contains two libraries that I use. First of all, there is the Free Pascal OpenGL Headers used for rendering. Second, there is a folder called ‘SDL’, which is a older version of the Delphi Container and Algorithm Library (DeCAL).  I started using it for many, many years ago, back when it was a commercial product. It was called Standard Delphi Library, but was renamed to avoid confusion with ‘Simple DirectMedia Library’. I guess it’s time to find something else, and when I start using Delphi 2009, I will for sure.

So, how did I put something unto the screen? Continue reading →


08
Jul 09

The “Particle-engines-ain’t-that-hard’-challenge

particle firework The other day, a colleague and I where looking at a cool application, Machine Flow. It’s a visual development environment and interpreter for the programming language Machine Flow. The language it self is defined by small lua-scripts, which you visually connect together. The running of the program is illustrated by small marbles carrying data around. It’s quite fun to play with, and the source is open, so there should be one or two things to look at there to.

What caught my colleagues interest, was a small firework-effect when the development environment was cleared. So we started discussing it, and soon I was determined to show that it’s really not that hard to make such effects. Now, I have never before done anything like this before. I lack experience with both graphics programming and the necessary math/physics. But it can’t be that hard, can it?

Well, we’ll just have to wait and see, then. The first challenge will be to get something unto the screen, and than I can start look at how to make it look nice. I will try to steer away from available libraries and tutorials, and rather come up with something completely on my own. The visual part will require  some reading though…