3d maze screensaver code
There are several objects floating throughout the maze.
This function is used by both the camera and the rat, but the rat calls it twice as often as the camera so they move at different speeds and it's possible to cross. dead end) - rotate right (which will bring you to a state where the right side is open) if just-turned and front is open - forward.if in the middle of moving or turning, continue moving or turning.The goal is to always follow the right wall.
There is a nextMove() function that determines the next step based on the current position, movement, and direction. The lookat function from Maze.js is used, with the eye corresponding to the current location in the maze and the at being the sum of the position vector and the direction vector. So I used GIMP to create the 99x99 image that corresponds to one cell of the maze and then upscaled it to a 128x128 image. The ceiling texture was a 33x33 and this doesn't work well with WebGL because it isn't a Power of Two.
3d maze screensaver code manual#
Most of the wall is red brick, but occasionally there is an image displayed on the wall, taken from a standard rendering example image that must have been used in the OpenGL manual Microsoft used. These files were extracted from the original screensaver. The walls, floor and ceiling each have specific textures.
This array is looked at when determining the next move and when initially sending the vertex data to the GPU. This is randomly generated with recursive backtracking, based on an algorithm I found at. The maze is stored as a 2D array of "cells" with each cell being a four int array describing it's four walls. The matrix libraries used are from here and under the MIT License.įor comparison, a YouTube sample of the original screensaver can be found at Features that have been implemented: This project is a recreation of that screensaver using WebGL and Javascript.
3d maze screensaver code windows#
Last year (it passed me by at the time, alas), someone even realised my fond dream of the time - to create a version of 3D Maze I could play myself.In windows 95 (and a few later versions of Windows) there was a screensaver that rendered and then solved a 3D maze with a a few interactive obstacles. Were its creators conscious that they had made something people would gawp at for hours, locked in a state of unmet anticipation? Or did they just think they were making some pretty walls? I wonder about the thinking behind 3D Maze. Mostly it was just more low-resolution brick walls. I watched and watched, forever feeling as though something magnificent was around the next automatically-navigated corner. I read a lot of books, but I was endlessly drawn to the PC. We lived in the country, the nearest friend was a half-hour bus ride away, there was no internet. In the absence of money to buy new games, I'd fire up 3D Maze more often than I should. Therefore, exciting, as my young mind had by then been programmed to think of anything involving a first-person perspective and lots of walls. By which I mean, watched it for hours.ģD Maze was a screensaver first bundled with Windows 95, notable primarily because:Ī) it was one of the more instant ways to make your computer seem all futuristic after succumbing to the Win 95 hypeī) it looked a whole lot like an early first-person shooter, a Wolfenstein or Doom One a day, every day, perhaps for all time. Have You Played? is an endless stream of game retrospectives.