Generating Mazes

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
onesixtyfourth
Posts: 21
Joined: Mon Nov 03, 2008 10:18 am

Generating Mazes

Post by onesixtyfourth »

Hi, I am attempting to build a program that can generate a maze and then render it and allow me to navigate through it using a camera. I can generate the maze (prims algorithm) and I am now attempting to create the maze as 3d objects and I have got stuck. I am having problems with creating the mesh buffers so that I can generate the walls and the floors of each cell. I obviously don't understand the docs properly as I thought I should be able to create a mesh and then work out my vertices for the walls and the floors. I was intending to have these in two separate meshbuffers which I then add to the mesh and then add the mesh to a meshscenenode which I then add to the scene with the manager.

What I need is information on:
  • how to create the vertices (should I be using vertex3d or array of ints/floats or even the geometrycreator for cubes and plains)
    how to create meshbuffers using the vertex arrays (keep getting errors "cannot allocate to abstract type" using SSharedMeshBuffer)
    how to set a material for each of the buffers as I don't see a setMaterial only getmaterial for a buffer and I want two different materials for the floor and the wall
    When I have created all the walls and floors there are bound to be some doubles is this a problem or should I go over the buffers to remove them.
Any information on this would be useful mostly at this point I could do with some information on creating and manipulating meshbuffers correctly.

Thanks

[edit] just realised tutorial 23 is close so reading through that to see if I can make sense. It refs SMeshBuffer which doesn't seem to be in the docs anymore.
Glasys
Noli illegitimi carborundum
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Generating Mazes

Post by CuteAlien »

SMeshBuffer is now a typedef for CMeshBuffer.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Generating Mazes

Post by hybrid »

getMaterial returns a reference, so you can alter it. The problem with SSharedMeshBuffer is fixed in SVN and will work with the next release.
onesixtyfourth
Posts: 21
Joined: Mon Nov 03, 2008 10:18 am

Re: Generating Mazes

Post by onesixtyfourth »

Ok so I will use the Cmesh and see how I get on.
Glasys
Noli illegitimi carborundum
Post Reply