JOGL based game engine.

I’m new to opengl but I’ve managed to set up a pretty basic engine using the jogl bindings. I made a simple test environment that you can navigate using the mouse and the arrow keys;

http://people.umass.edu/eraboin/gasket.jpg
http://people.umass.edu/eraboin/alpha.jpg
http://people.umass.edu/eraboin/model.jpg

Obvious from the pictures, I’ve borrowed models from other games for testing purposes.

I wrote my own ms3d ascii file parser, as well as a slightly coopted routine for loading in textures. I’ve tried to copy the design patterns used in swing by creating a TextureFactory class to produce abstract instances of Texture objects based on the filetype and characteristics described in a RenderConfig class. There’s also a ModelFactory class, but currently only one file format is supported, and I haven’t tried to do skeletal animations yet.

These commands load in the model and the textures associated with it, then display it on the screen;

[i]Model someModel = ModelFactory.getInstance().createModel(“directory/filename.ext”);

someModel.load(gl);[/i]

…and then in the display routine…

someModel.draw(gl);

The ModelFactory (and TextureFactory, which it calls) keep a Hashtable of all the objects they create, indexed by filename. If two models use the same texture, it makes sure the same object is passed around rather that loading multiple copies into opengl. Most of the work is being performed by the someModel.load(gl) method, since the files aren’t loaded until they’re ready to be bound.

I’m hoping to dress up the rest of the engine in a similar manner, allowing for custom configurations using optional helper classes. Although it’s going to be a while before I get anything that’s really complete.

Looks great! Can we get a test build? ;D

-Chris

Yeah, I’m in the process of cleaning things up right now in the code… but it’s the only thing I’m working on this summer, so perhaps in a week or two I’ll have a playable demo. It’s just the engine, though, since I haven’t really coded any of the gameplay. In the future I plan to make a racing game with it, but I’m not going to worry about the details until I get a simple demo running.