Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / anaglyph dark basic

Author
Message
pr0fess0r cha0s
15
Years of Service
User Offline
Joined: 6th Oct 2008
Location:
Posted: 21st Oct 2008 22:01
I'm using darkbasic classic, with blender, does anyone know a good way to create an analyph game with those programs?
Thank You
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 22nd Oct 2008 19:01
Tricky, but possible. I can think of several ways in DB alone - don't know how efficient any of them would be because I've never tried before. But here's an example I quickly knocked together. Basically, it creates 3 cubes: the subject, a red cube, and a cyan cube. The colored cubes are ghosted to make them transparent. They are "glued" to either side of the subject cube. Pretty simple, not a great effect- it works, but could be improved. Move around with the arrow keys and turn with the mouse:



Now, in Blender, there are so many texturing and modeling options that there are probably some great results you could get. You may be able to adapt this next suggestion for DBC to Blender.

This would probably be slow in DBC unless you use some DLLs but the idea is this. Capture the entire window as an image, logically AND all of it's colors with cyan and set that aside as a new image. Do the same thing, this time with red. Texture 2 3d screen size planes, one with each of the colorized images. Ghost the planes for transparency, and display them on screen offset a little to either side of the screen. Should do it... I may try to come up with an example.

Enjoy your day.
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 22nd Oct 2008 19:16 Edited at: 22nd Oct 2008 19:33
Wouldn't you want to produce polarized stereoscopy, rather than the anaglyph red/cyan? This way you can keep all the crispness and true color of the original, just in 3d. Not sure about you, but the red/cyan glasses made me want to vomit.

and who could pass up these glasses. Especially the Dorky's.

image example...

this


vs,

this



Or better yet just go get an IZ3D monitor

"When I look at that square... I wish FPSC noobs would stay on their side of the forums and stop polluting these boards." - Benjamin
pr0fess0r cha0s
15
Years of Service
User Offline
Joined: 6th Oct 2008
Location:
Posted: 23rd Oct 2008 22:38
FOr this project, I need anaglyph because I am combining it with some other software, however, I do agree that the polarized stereoscopy looks better. This is for a special project in which I must use dark basic, or else I would normally use db pro. Thank you for all of the comments. If anyone has any other Ideas I would appreciate it. This topic does not seem to be discussed often in the forums. I am trying to accumulate a thorough understanding of 3d and what really makes it work. I would like to develop it further in my games. Does anyone has any ideas of how to implement polarized stereoscopy in dark basic?
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 23rd Oct 2008 23:10
Quote: "Capture the entire window as an image, logically AND all of it's colors with cyan and set that aside as a new image. Do the same thing, this time with red. Texture 2 3d screen size planes, one with each of the colorized images. Ghost the planes for transparency, and display them on screen offset a little to either side of the screen."

Doesn't the distance between the red and cyan alter the perceived distance of the object? Then you'd need separate plains for every object! Is that how it works, I'm just kind of guessing here.

I found this in the codebase


A small program that works is better than a large one that doesn't.

DBC Challenge Rank: Rookie
pr0fess0r cha0s
15
Years of Service
User Offline
Joined: 6th Oct 2008
Location:
Posted: 27th Oct 2008 21:21
Thank you for the code snippet. Does anyone know how I could make two objects in red and blue ghost? Would I just color the object? What about texture, or do I have to send it to the buffer and edit the color channels? What commands could do that? That is the only way that I could think of doing it. Blender could do some cool stuff, but I want to develop something for my game and for the code base that takes the distance of all objects and applies these effects accordingly.
pr0fess0r cha0s
15
Years of Service
User Offline
Joined: 6th Oct 2008
Location:
Posted: 27th Oct 2008 21:21
Mr Tank
21
Years of Service
User Offline
Joined: 25th Nov 2002
Location: United Kingdom
Posted: 27th Oct 2008 21:25
I made this a while back. Not sure if it will work in DB classic...

http://forum.thegamecreators.com/?m=forum_view&t=129824&b=5

Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Oct 2008 00:04
Quote: "What about texture, or do I have to send it to the buffer and edit the color channels? What commands could do that?"

You'd need to take a screenshot of the whole scene but keeping each object independent - I would hide all objects except the subject, paint the backdrop black and take a snapshot - then you need to create two images for each object; these images are made by comparing the original screenshot with two colours that don't share RGB in any amount (i.e. cyan and red) using the logic AND (as latch mentioned). The resulting images will be monochrome versions of the original.
The trick is that when looking through the cyan filter, the player wont see the cyan monochrome image; and vice versa for the red image. So each eye can only see one image, and by positioning these images differently you can deceive the eye into perceiving depth.

A small program that works is better than a large one that doesn't.

DBC Challenge Rank: Rookie
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 28th Nov 2008 11:16 Edited at: 28th Nov 2008 11:19
Sorry about bringing this up when the thread's been lying dormant for a month, but I'm intrigued by the stereoscopic 3d that comes with DBPro (I got Dark Game Studio last weekend). The first thing I downloaded to run was the demo that came with Newsletter 67, and although anaglyph 3d looks impressive I can't help but feel that polaroid 3d would work much better.

Zenassem was talking about creating polarized stereoscopy - but wouldn't you need the IZ3D monitor for that? Or can anyone look at any monitor while wearing 3d polaroid glasses, and see the scene in stereoscopic 3d?

Looking at how the monitor is constructed, I'd say not - the IZ3D appears to be two offset displays, each carrying a polaroid filter. Each polaroid filter over the players eye cancels out a part of the monitors display, so each eye recieves a different image.

I remember having a pair of polaroid 3d glasses a long time ago, but threw them out a few years back so I can't do any tests myself . The only thing I do remeber is that when I wore the glasses, any ordinary 2d image appeared to have a sense of depth to it.

So, can I render true 3d without using anaglyph?

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."

Login to post a reply

Server time is: 2024-05-20 09:27:28
Your offset time is: 2024-05-20 09:27:28