Menu

First, a preview

Hello viewers, how are you? PhotoMaze is a small project that I started a few months ago, firstly in order to learn C. As with most things that I start, if it doesn't go into the trash can within a month, it evolves. This is one that has evolved.

It started out, as I've said, as a way of learning C. At work, if I'm programming, I'm predominantly I'm using Visual Basic and SQL, and only at home do I get to satisfy my need to learn something different. I recalled from my childhood a program that I had that generated mazes, so I figured that that would be my first C project, to generate mazes.

Well, it started out as simple as that. OK, I've got a maze now, so how do I show it? Hmm... My first option was to use Excel to do this, by exporting the specs of the maze and then use Excel to place borders around cells in order to see the maze. I was fortunate in that I got the maze algorithm right first time! ( Depth-first search if you're interested... http://en.wikipedia.org/wiki/Maze_generation_algorithm#Depth-first_search .)

Of course, that's not very satisfactory. So the next port of call was to use SDL to draw it in 2D. Then, I decided to use OpenGL to do the 2D drawing. Then I added objects to traverse the maze. Then, of course, the next step is to go 3D, and the fruits of my labour are on show.

The first Windows preview version of Photomaze is available as is. I just had a brainwave and decided to put it up, as it is right now, for all to see. There's a few sample pictures in the res/photos folder that you can replace with your own, or alternatively use a command line option "--wall-texture-path=path to photos" to point it to a different folder (note that it's best to include the quotes, as any spaces will cause an error). There's a README file in the archive which gives some more options that you can experiment with.

Some of the features:
- Uses OpenGL for rendering, including some GLSL (and you get to see the fact that I'm experimenting still)
- Per-pixel-lighting is available (press L) which creates a spotlight. It may not be obvious at first, press - (minus, not on the keypad though) a few times and the spotlight will shrink and become clear.
- It is dual-threaded when loading up your photos. The photos are resized and clipped to squares in a secondary thread, which signals the main thread to add it as a texture to the OpenGL context. Once available, the texture will be displayable (and in fact will push other textures out of the way, so to speak, as they are displayed).
- There are three different camera modes; 1) auto-navigation around the maze, 2) a space-sim style free camera, 3) a first-person-shooter style camera. Note that there is no collision detection at this stage, so there's nothing to stop you going through walls.
- Press X to see a couple of effects when using per-pixel-lighting (press L) - normal, black and white, and a 'toonify' effect. These are all done through GLSL.

So anyway, this is the first submission of a binary for this project. Source code will follow in the next few days.

Look forward to receiving people's feedback!

Cheers
Kelsey

Posted by Kelsey Petterson 2011-02-20

Log in to post a comment.