After sorting some of my issues with trig (though not all of them), I spun up some simple maze views this morning, based on Ray's maze generator. Assume we have this maze (straight out of genMaze(10, 10) and into a printing loop like Ray demoed at CFUnited):
## ###################################### ## ## ## ## ## ## ## ## ###### ###### ## ###### ## ## ## ## ## ## ## ## ## ## ## ## ###### ## ###### ## ## ## ## ## ## ## ## ## ## ## ## ################## ########## ## ## ## ## ## ## ## ## ############## ## ###### ## ## ## ## ## ## ## ## ## ## ## ############## ## ############## ## ## ## ## ## ## ############## ## ########## ###### ## ## ## ## ## ## ## ###### ## ############## ## ## ## ## ## ## ## ## ## ## ## ## ################## ## ###### ## ## ## ## ## ## ## ## ## ## ## ## ###################### ## ## ## ## ###################################### ##
From the model (a two-dimensional array), I can make a pretty map of it (demoing the camera rotation in both horizontal and vertical directions). I discuss the obviously erroneous curvature below.
And then we can also stand in front of the doorway and look down the initial hallway (much like the original version did, though this hallway is far less interesting).
Both of these captures are generated the "right" way, with the maze plotted in three-space and then rendered into a 2D image.
The curvature of the map view is due to the issues still remaining in my camera/POV rotation logic. The camera rotates correctly (both vertically and horizontally), but it also "curls" the world based on the degree of vertical rotation. I'm not sure what I've actually done wrong, other than not understanding anything about how to do 3D rendering. : ) But everything at least lays out correctly now, even if it's on a weird curve, so that's a large improvement. Real6
That particular map capture was from a very high camera position and a correspondingly large "tip down" of the camera to accentuate the curvature issue. With a smaller rotation, the curvature is far less grotesque, though still noticeable.
UPDATE: Here's another capture (of the same "world" as the image in my original post) that illustrates the curve issue in better detail.
In the maze map at the top, every block is drawn individually, so the curve seems uniform. But in this capture you can see how that smoothness is localized. The grid is a collection of lines from end to end, but the lines themselves don't curve, just the endpoints. So you get horribly wonky drawing when you don't have a uniform distribution of localized segments. As such, fixing this is rather essential for this to have any sort of utility beyond academic pursuits.
Barney. For the record, these posts are completely useless…and utterly fascinating! Keep up the good work, I am enjoying reading these. P.S. Great finally meeting you at CFUnited.
I dunnoknow dude. When Homer Simpson was walking through space/time in Homer3, he was bending it. Maybe Homer's just a smidge stage right?
Or have you tried setting graphicsStage.quitFuckingBending()?
I think the curvature looks pretty slick. I mean if you fix it now you might never be able to figure out how to do it again. Mark it as a feature and move along. Next!
@Brian,
Thanks. Was good to meet you as well; always nice to have a person to associate with the name (and no, avatars don't cut it).
@Marc
I tried that method, but it said it didn't exist. Did you misspell it? Or perhaps I have a beta version. Who knows.
@Brad
Yeah, the curve is kind of slick, but it causes horrific problems as it is today. I added another capture to the end of the post that illustrates the curve issue a little better, as well as how it manifests itself in problematic ways. If you look at that one, I'm sure you'll agree it warrants resolution. : )
Ouch, I see what you mean. Reminds me of a Dr. Seuss world. Will you be posting the code anywhere for us to play with/help out?