Advertisement

3D maze screensaver

Started by July 04, 2003 09:50 PM
7 comments, last by limon19 21 years, 8 months ago
Hi- I''m trying to start this 3D maze screensaver (C++)...this kind where the person at the monitor is the ''camera''....i have an idea on how to program the maze in 2D...but im perplexed when it came time to attempt the 3D "version...how would i make a screensaver in the first place...i have a separate ''camera'' program...but its all user-input based....how would i go about navigating the camera through the maze on its own?...(forgive the influx of questions)....my professor also mentioned this "you dont have to draw out the entire maze initially- just whats w/in the viewport, or what the viewer sees"....again- if the camera is naviagting on its own...then- hmm- this is where im truly stumped i cant even state my question...sorry- thanks for any suggestion- limon19 edaz19@aol.com
The part where he says you don''t have to draw out the entire maze at once - he probably means to use frustrum culling and some kind of visiblity system. Are you planning on making the maze randomly or load it from a file?
Advertisement
Hi- first off, thanks for the reply!...i think he mentioned using a ''viewport'' for the portion the maze that is being viewed...ans changing the viewport as the ''camera'' moves through the maze...i want to use a maze from a file...(this maybe a stupid question...) but cant i make my maze w/in this screensaver program...if i want to use the same maze?...thanks again (sorry for any confusion)
Small steps your starting too large, get camera movement down, then look up fustrum culling (so you draw what is only on screen).

I''d recomend working up to that and not starting there.
i have programmed a camera- and all its movements...but its all user input based....how would i make the camera ''navigate'' through the maze by itslef?

thanks for the help again

p.s. i tried the opengl live chat- but again as stuppid this may seem...i couldnt find the forum, nor the chat room if such exisits thanks again

p.p.s the opengl live aid- was a link from a banner?? thanks!
Okay, here goes. I''m going to try to give you a hand in the making the camera move by itself part. You have a maze, and consider that it is a grid of squares. Walls consist of one side of each square. You have structure set up that contains all of the turn possibilities of that square. Set the structure up as a two dimensional array so that the x and y positions of the square will be easy to keep track of. Basically, to move the camera on its own, since the maze is essentially a grid of points with squares around each point, move the camera to the next point, depending on if there is a wall or not. Move the camera smoothly, though. Specify current poisition, and the position you''re heading and move incrementally towards that point. Then, use if() statements to determine if you can turn or not.


"Donkey, if it were me, you''d be dead."
I cna ytpe 300 wrods pre mniute.
"Donkey, if it were me, you'd be dead."I cna ytpe 300 wrods pre mniute.
Advertisement
Think of it like a chess board with limitations. Or a chess board, with it''s coordinates, you know? Knight to B3, Pawn to E7.

"Donkey, if it were me, you''d be dead."
I cna ytpe 300 wrods pre mniute.
"Donkey, if it were me, you'd be dead."I cna ytpe 300 wrods pre mniute.
There are a million ways you could do it.

If you have it set up as a grid you could just do a check to see what are the possible ways to go and have it randomly select one.

If its a fixed maze you could set up a path to follow.

Figure out what method you want and im sure you can get help if you get stuck.
Thanks!! that makes it a lot easier to visualize....for some reason - if i cant draw out (literally, like links and queues) the premise of my program, then i have the hardest time...comprehending the project...this helps a lot- i cant wait to get started! thanks again

-most likely ill post some more ''im stumped'' queries

thanks!

This topic is closed to new replies.

Advertisement