3-D Anaglyph in GM

Posted by Balding Chimp on April 6, 2009, 2:26 p.m.

Well, it's been about 3 1/2 months since I last submitted a game here. (Mine Race 3-D). It is still listed as number 2 in the Queue system, but I don't see the file in my list. If anybody want's to snag it, you can download it at…

http://www.savefile.com/files/2068052

Now I already did 3-D Kaboom ages ago, which used pre-rendered sprites for the bombs (created with 3-Space… a program I have used for creating graphics in many of my games) and used a program called 3-D Combine to make them in 3-D anaglyph format.

I wanted to try an make a more "true" 3-D game with Game Maker. Not Pre-Rendered graphics, but something that would calculate the difference in a real 3-D world environment.

That was my experiment called Mine Race 3-D. It's nothing fancy…it was more based on testing a method of displaying real 3-D graphics in Game Maker (using the old Red/Cyan 3-D movie glasses) and kinda a speed test before the effect would break down.

These are two views from the game. I appologize for the quality since they are shrunk down. It looks much better if full screen.

Why two images? Well as you can see one is Cyan and the other is Red. The way I displayed real 3-D in Game Maker was to display the view for the right eye (Cyan) and then in the next frame have it draw the left eye (Red). It flip-flops rapidly between these two views.

Without the 3-D glasses it would look like a flickering mess. With the 3-D glasses on the right eye only sees the right view, the left eye only sees the left view. (In principle anyways….)

So how do you achive a real 3-D view in GM? As you can see my game looks pretty much "wire frame" style…kinda vector graphic-ish for the most part. This is not by accident!

Why not go with full solid graphics? The flicker from the screen starts to be overwhelming the more solid images apear….even with the glasses on. The 3-D effect breaks down. With just a wire frame look the flicker effect is greatly reduced with the glasses on.

There is a way to kina display 3-D graphics nicely without a wireframe look. It has to do with displaying the main view, then the left and the right views "added" to them without wiping out the original image. This would only be sutible for stuff where you are maybe taking "steps" in a game. Like how you move in games like Myst or Riven… You got one nice looking picture…move ahead, and it jumps to another view with no transition. As long as the previous images are not wiped out. It would only clear the screen to draw a new view if you moved. Very slow in real time!

So how does this 3-D work? Many already get the concept of how 3-D with the glasses work but here is a general example…

It has to do with what is visible and what is blocked out when you wear the 3-D glasses, and where it tricks your eyes to focus on.

The red lense can see red but not cyan. The cyan lense can see cyan but not red. This "allowing one color to be seen and one is blocked out" is what makes your eyes focus on what is "believed" to be the depth of an object.

In the simple diagram, red lense only sees red, cyan lense only sees cyan. Imagine the black line being the front of your monitor displaying the graphics. The position of the red and cyan objects determines the precieved depth of an object (the black circle).

So with Game Maker….if you know how to make a game in "3-D" already, it's just a matter of flip-floping between two different views. Instead of just one view where "X" is where you are focusing your camera on and Y is where you are looking from…you just change Y a couple pixels either left or right from that "from" view.

I hope that made sense. Your target X,Y,Z locations where the camera is focused on can stay the same, but where you are looking from you need to change one axis a few pixels for the effect. (Depending what angle you are looking from).

So when it comes time to draw the view, just have the program flip-flop between two views. Like view=-view.

If the view is negative draw in red one view. If it is positive, draw in cyan the other view.

Other factors to consider…room speed (seems to effect how fast your screen is refreshed). Try to find a number where the flicker effect becomes a minimum with the glasses on. Colors to use…I tried absolute red and cyan (255) but could see both with the 3-D glasses on kinda. I toned them down a bit so red should only see red and cyan only sees cyan…or as close as I could get.

Try not to have images "jump" off the screen too much. If you have images coming "off the screen" you need to make sure both red and cyan views fit fully on the screen. Going to extremes your eyes will have problems fousing on the images as well. (Having the red and cyan images a mile apart expecting it to be 2 inches from your face)

Try to keep the depth centered where the front of the screen should be. That is, try to have the images come out no farther than how far behind the screen they should apear. As red and cyan spread out, it gets harder to focus your eyes.

Oh yeah, side note…

Way back I made a game called Mount Neverest. Some people thought it was "too hard". Here is a video showing that it is more than posible to get thru all the holes easily.

http://www.youtube.com/watch?v=SRDWT3hwcys

Audio gets off track after a while, but you see it can be done.

Comments

Xxypher 15 years, 8 months ago

A 3D game would be great! I may implicate something similar to this in [HITS]. It is a great idea.

Balding Chimp 15 years, 8 months ago

Yeah, stuff like Tempest and Battle Zone type clones could look quite nice if pulled off. Just wish I knew a way to do "full" 3-D with it. (Meaning "solid" objects drawn real time.) Not just a wire frame look.

PY 15 years, 8 months ago

That looks awesome, I may need to repair my old 3D glasses.

Xxypher 15 years, 8 months ago

Maybe using cellshading, and then adding a wireframe styled image in the foreground. If you understand what I am getting to.

SixWinged 15 years, 8 months ago

:O That sounds awesome, too bad I don't have any of those glasses, I had a pair once, not sure what happened to them.

Xxypher 15 years, 8 months ago

I'd rather use the new type of 3D glasses that uses millions of shades of grade to project the image. It is like wearing sunglasses to a slightly brighter movie theater.

Iluvfuz 15 years, 8 months ago

Nice diagram, made it look like a good concept.

Cesar 15 years, 8 months ago

Wouldn't this make people dizzy? Or have you tested this throughly? Awesome concept either way.

sk8m8trix 15 years, 8 months ago

Quote:
I'd rather use the new type of 3D glasses that uses millions of shades of grade to project the image. It is like wearing sunglasses to a slightly brighter movie theater.

Those work differently, they require CRT monitors with a 100hz refresh rate. At least that's what I read.

Balding Chimp 15 years, 8 months ago

As for making people dizzy, that's why if I do a 3-D game I try to make them short. 3-D Kaboom! or Mine Race 3-D (download link above). You wear those things too long your eyes start seeing different colors when you take them off.

I got the best results on my monitor. It works on my T.V. as well but I need to play with the settings a bit too try and make it where red only sees red and cyan only sees cyan…close as posible anyway. (I got video out on my PC). I don't have widescreen stuff. How fast the screen is refreshed does seem to play a factor in effectiveness. The more solid images become though, (using this method), the more noticeable the flicker becomes even with glsses on.

Found an old link for people that reaally want to try this out, that don't have access to 3-D glasses…

http://stereo.gsfc.nasa.gov/classroom/glasses.shtml

I never made my own, but sounds like it would work.