automation of 3d maze

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.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

You don't have any parenting of nodes going on do you? As that would mean relative positions are basically meaningless on their own.
Image Image Image
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

elapj wrote:ive tried changing the co ordinated but its impossible to get a starting point
If I understand you, you're just looking to generate a list of co-ordinate points now, yes?

How about flying through the maze manually, then hooking up a key event to print the camera's current position, and press that key when you're at the appropriate junctions. To make it easier on yourself, literally print out the code that you'll need, i.e.:

Code: Select all

    if (event.EventType == EET_KEY_INPUT_EVENT && 
        KEY_SPACE == event.KeyInput.Key &&
        event.KeyInput.PressedDown)
    {
        vector3df camPos = camera->getAbsolutePosition();
        printf("    points.push_back(core::vector3df(%ff, %ff, %ff)));",
                 camPos.X, camPos.Y, camPos.Z);
    }
Untested, and you'll need to make your camera (or scene manager) available at the point where that code uses it. Also, you could probably use a fixed Y height rather than the camera's height, depending on your application.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
elapj
Posts: 34
Joined: Tue Nov 06, 2007 1:34 pm

Post by elapj »

really struggling, havent a clue where to go from here.#

the co ordinates make no sence ive tried using settarger() but doesnt work eather just get a load of rubbish

help !!!!
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Help with what? Take deep breaths! Ask yourself: What Would SHATNER Do?

Can you back up a little and explain exactly what it is that you're having problem with?

Is it finding appropriate positions for the splines in your animator?

Is it in having your camera move between those positions?

Is it in having your camera look in a sensible direction as it's moving?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
elapj
Posts: 34
Joined: Tue Nov 06, 2007 1:34 pm

Post by elapj »

breathe in and out ...........................


right ive loaded a simple 3d maze i made in irredit out of square and circles in the .irr tutorial.

then i can move around my simple maze / 3d world with the key bord arrow buttons.

what i want is the camera to move around by its self throught the maze. just the once and only one route.

ive looked at the demo tutorial and used a peace of code that pan the camera around it maze. and sure enought it pans round mine exactly the same.

what i need to do is change the co ordinates so the camera moves through my maze


but the co ordinates dont make sensor the nearest ive come is a birds eye view over the maze , but i want it to look as it you were walking throught it


thakyou for your help
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

OK, it sounds like you're still at the stage of needing to generate positions for your spline animator.

We covered that up here. Fly around manually, and output the camera position (with a key press) every time you make a significant change in direction. Then use those positions to create your spline animator.

Are you clear on the theory of that? If so, see how far you get with the implementation and give us a shout when you get stuck.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
elapj
Posts: 34
Joined: Tue Nov 06, 2007 1:34 pm

Post by elapj »

ok cool were is event defined

also doesnt like thisline

vector3df camPos = camera->getAbsolutePosition();
Swarmer
Posts: 100
Joined: Mon Apr 16, 2007 7:23 am

Post by Swarmer »

A much simpler algorithm (although not as fast) is to always turn right (or left). Just follow one direction always and you'll find your way out. Although I don't think that's your problem right now.
elapj
Posts: 34
Joined: Tue Nov 06, 2007 1:34 pm

Post by elapj »

still no joy

not sure where in the .irr tutorial i should put this event handler
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Look at the other tutorials and see how they use the event receiver.

It seems like you need to learn a bit more about how Irrlicht works by studying each one of the tutorials fully before embarking on your own project!
Image Image Image
Post Reply