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 / Rendering red/green 3D anaglyphs

Author
Message
SarahCartwright
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location: Chester, UK
Posted: 29th Nov 2003 00:52
I've set myself one hell of a challenge.

I'm setting out to make a realtime red/green image 3D anaglyph viewer for models.

Looking through the API of DarkBASIC, I've come across some big puzzles:

To render my anaglyph, I need to render two greyscale images, then send them to the red and green channels of an image that will be displayed on the screen.

My questions in regard to DarkBASIC therefore are:

How can I render a greyscale image to a buffer, rather than the screen?
How can I combine those two images into one, by sending them to the green/red channels respectively?

I'm presuming memoryblocks can help out, but I can't see how I can render to a texture/image or if a workaround's even possible.

Help!

Sarah
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th Nov 2003 11:32
One way to create a greyscale image is to redraw it offscreen and recapture it. When you redraw the image data, average the three color values, red, green, blue, and then substitute that value in for all three values to get a grey level. That's just my idea on it. As for turning it too just different shades of 1 color, I'm not sure.
But to blend the two together, you can use linear interpolation.
The code below shows how to fade between two different images.


David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 29th Nov 2003 14:49
I did this a while ago, but the source code is DBPro not darkbasic. Here's how I did it.

Have 2 cameras (pro only), one a bit to the left of where it should be, one a bit to the right

render both camera to images (po)

make each image a sprite (add a 3rd one for the G channel)

use set sprite diffuse to control the chanel colours on each sprite

The full code is on my website, http://www.davidtattersall.me.uk. Click "enter darkbasic" then scroll down and click "3d glasses".

Hope it helps.

"Help! My keyboard is stuckkkkkkkkkkkkkkkkkkkkkkkkkkkkk"

Mercenaries in Space demo @ http://www.davidtattersall.me.uk
SarahCartwright
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location: Chester, UK
Posted: 29th Nov 2003 16:37
Thank you everyone, it's been a great help looking at the code.
It's given me a few directions to look in.

David, I don't have DBPro, I'm being cheeky here, but can you write a little bit more code to import a .x mesh to view, and post the .exe on your site?
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 1st Dec 2003 19:54
lol, OK I'll make a simple .x loader that displays a model in 3d for you

I'll email you about it.

"Help! My keyboard is stuckkkkkkkkkkkkkkkkkkkkkkkkkkkkk"

Mercenaries in Space demo @ http://www.davidtattersall.me.uk
SarahCartwright
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location: Chester, UK
Posted: 4th Dec 2003 21:37
Yay!

Thank youuu! that little problem with the corrupt Zip is gone.. i have two .x files and the renderer...

unfortunatly the computers in work dont have dx9, so i'll have my hours of fun later, at home..... when im not getting paid!

HelpMySpaceKeyDoesntWork!
Darkflame
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location:
Posted: 12th Dec 2003 19:19
Why not use the easy way?

Download Nvidia stero drivers, they do it for you
(I have tested them, they work with DBP)

"The man who says it cannot be done is generally interrupted by someone doing it." ~ Elbert Hubbard
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 13th Dec 2003 20:25
'Cause I'm not lazy!

or your PC might not support them.

or I didn't know they existed.

"Help! My keyboard is stuckkkkkkkkkkkkkkkkkkkkkkkkkkkkk"

Mercenaries in Space demo @ http://www.davidtattersall.me.uk
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 14th Dec 2003 13:59
I had a look at those, and it seems to me that you need these weird glasses things to look at 3D stuff, mabey I'm wrong though, you got a link there?

Thanks.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
SarahCartwright
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location: Chester, UK
Posted: 29th Dec 2003 21:03
Yeah, you need glasses with the NVidia anaglyph drivers.

Also the anaglyph drivers arn't currently supported by the newest realeses of the card drivers (They are both seperate downloads), which means you would need to go back a couple of versions to use it.

On a plus point, the drivers support LCD shutter screens so as soon as I have some money I'm getting a pair.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 30th Dec 2003 04:31
Why not have a look at this thread: http://darkbasic.thegamecreators.com/?m=forum_view&t=18831&b=2 It has a bit of a discusion about a 3D monitor that you can get ( Which looks really good!! )

Hope I Helped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy

Login to post a reply

Server time is: 2025-05-22 06:27:22
Your offset time is: 2025-05-22 06:27:22