Second try

I’m starting from scratch with my game engine.

I have started writing a little editor using QT, and have got a scene graph pretty well implemented.

editor01

The features have changed a little, mainly I will not be supporting DirectX, and I will be using the STL or SC++L.

The scene will be loaded and saved into XML files, but nodes can be added like following.

Renderer *renderer = new Renderer;
SceneManager *sceneManager = new SceneManager(fRenderer);

RootNode *rootNode = sceneManager->getRootNode();
MeshNode *mesh = new MeshNode("mesh", rootNode, fSceneManager);
mesh->setMesh("data/crate.mesh");
mesh->setLocalTranslation(Vector3(2.2, -2.2, 0));
mesh->setLocalRotation(Vector3(0, 0, 45));

And they can be deleted at any time, without causing any problems.

Advertisements

First Look

Some more info, the engine is written in c++ using the code::blocks IDE (which is awesome), and I will not be using the STL at all, and if the engine actually gets to a respectful state, I plan on releasing it under some open source license 🙂

Following is an example of a main function, initiating the engine and loading some meshes.

int main ( int argc, char** argv )
{
    CRenderer *renderer;
    CMesh mesh;
    CFlyCamera camera;

    bool running = true;

    renderer = new COpenGLSDLRenderer;
    renderer->init();

    mesh.load("platform.mesh");

    renderer->addMesh(&mesh, CVector3f(0.0f, 0.0f, 0.0f));
    renderer->addMesh(&mesh, CVector3f(0.8f, 0.1f, 0.0f));
    renderer->addMesh(&mesh, CVector3f(0.8f, 0.2f, 0.8f));
    renderer->addMesh(&mesh, CVector3f(0.0f, 0.3f, 0.8f));

    camera.set(CVector3f(0.0f, 0.0f, -2.0f), 3.4f, 0.0f, 0.0f);
    camera.setInput(&input);
    renderer->setCamera(&camera);

    while(running)
    {
        running = handelEvents();
        camera.updateMovement();
        renderer->startScene();
        renderer->renderMeshNodes();
        renderer->endScene();
    }

    delete renderer;
    return 0;
}

untitled

I have created a binary mesh file, which is basically a list of vertex data, texels and polygonal stuff, and most likely will evolve a lot through the early stage of the engines development, and as you can see in the screen shot, there is no texturing yet.

3D Engine

I’m going to try to write a feature complete 3D engine, mainly as a learning experience, and to exercise/perfect my programming style.  It will not be the fastest thing out, but I hope that it will be the most beautiful.  I would like it to be self contained, apart from the graphics and sound api’s everything will be coded by me.

Features

  • Crossplatform
  • Multi API, it will support OpenGL and DirectX for graphics, SDL, Win32 and DirectX for window creation/input handeling etc.
  • Full physics simulation with support for rigid bodies, partical systems, soft bodies etc.
  • Terrain rendering, with LOD, generation of height maps and textures.
  • Generation of trees/shrubs.
  • And whatever else I think it needs.
  • Anyways, thats the plan, I dont know how far I’ll get, how quick it will develop but I’ll give it a go.