PDA

View Full Version : StereoScopic



SeeDAreW
03-01-2002, 02:28 AM
Iwanna open a second window in the same prg in so that I can see in VR a stereoscopic Image. Help!!!!!!!

nemesis
03-01-2002, 02:55 AM
Are you asking how to open a second window or how to render a stereoscopic image?

SeeDAreW
03-01-2002, 02:58 AM
yes!!


Originally posted by nemesis:
Are you asking how to open a second window or how to render a stereoscopic image?

nemesis
03-01-2002, 03:08 AM
Well...
In fact, there are two questions here.
I will try to answer the second one. To render a stereoscopic image you have to:

1) Set the geometry for the view from left human eye
2) Set the left eye rendering buffers
3) Render the left eye image
4) Clear Z-buffer (if the same Z-buffer for left and right image is used)
5) Set the geometry for the view from right human eye
6) Set the right eye rendering buffers
7) Render the right eye image
8) Swap buffers

It's explained in http://mysak.umbr.cas.cz/~husakm/Public/StereoOpenGL/StereoscopicOpenGLTutorial.htm

Maybe there are other faster ways to do that.

Hope it helps,
Nemesis

SeeDAreW
03-02-2002, 12:44 AM
What I want is to render the left eye image in one window and the right eye image in an other window!! Both windows must move with the mouse at the same time!! Can you help me, please????

john
03-03-2002, 01:31 PM
howdy

why don't you just partition the single window with viewport and glscissor?

1) you'll have two views of the same thing
2) they'll be attached, and autoresized the same
3) its less hassle then dealing with two window handles
4) its just cool

cheers,
JOhn

Gavin
03-03-2002, 11:57 PM
That is not the way stereoscopic rendering works. You need to do it in the same window, alternating left and right eye images.

JML
03-04-2002, 03:03 AM
Originally posted by Gavin:
That is not the way stereoscopic rendering works. You need to do it in the same window, alternating left and right eye images.
That depends on the way your stereoscopic 'viewer' works actually.
If you have some sort of shutter-glasses, then you have to alternately display the left and right eye image in the same window while synchronising with the glasses.
But simple 3d effects can be achieved by displaying the two images side by side and looking 'through' them (either straight or 'cross-eyed': right eye focuses on left image and v.v.).
I've also seen binocular-like gadgets that help focussing each eye on a separate image displayed on a regular monitor.

BTW, when using a 'proper' 3d card with suitable openGL drivers, you get separate buffers to draw to (GL_LEFT_BACK, GL_RIGHT_BACK iirc) and the hardware takes care of displaying the left and right images at the right moment.

HTH

Jean-Marc.

03-04-2002, 10:37 AM
Originally posted by JML:

Originally posted by Gavin:
That is not the way stereoscopic rendering works. You need to do it in the same window, alternating left and right eye images.
That depends on the way your stereoscopic 'viewer' works actually.
If you have some sort of shutter-glasses, then you have to alternately display the left and right eye image in the same window while synchronising with the glasses.
But simple 3d effects can be achieved by displaying the two images side by side and looking 'through' them (either straight or 'cross-eyed': right eye focuses on left image and v.v.).
I've also seen binocular-like gadgets that help focussing each eye on a separate image displayed on a regular monitor.

BTW, when using a 'proper' 3d card with suitable openGL drivers, you get separate buffers to draw to (GL_LEFT_BACK, GL_RIGHT_BACK iirc) and the hardware takes care of displaying the left and right images at the right moment.

HTH

Jean-Marc.

SeeDAreW
03-04-2002, 10:38 AM
What I want is to display the right eye image in one window and the left eye image in an other window!!! Can somebody help me????????????????????? Please!!!!

tcobbs
03-04-2002, 12:01 PM
Originally posted by SeeDAreW:
What I want is to display the right eye image in one window and the left eye image in an other window!!! Can somebody help me????????????????????? Please!!!!

The reason you aren't getting the answers you are looking for is because what you are asking to do isn't really all that great an idea. Possible? Certainly. Advisable? Definitely not. Do I know how to do it off the top of my head? Definitely not. Could I figure out how to do it? Certainly.

Having said all that, your best bet has already been suggested: make a window that is wide enough for both images. Then use glViewPort to draw each image. The images will show up side by side (just like you want), and since they are in the same window, they will move in sync with each other (just like you want). In a little more detail:

Clear the screen. I don't think glClear pays attention to the viewport settings, but I could be wrong. If it does, make sure your viewport is set up for the whole window.

Use glViewport to set your viewport to go from 0, 0 to width/2, height. Render the scene from the point of view of the eye you want to go on the left side. For cross-eyed viewing, this would be the right eye. For "wall-eyed" viewing, this would be the left eye. A quick and dirty way to do this is to translate X some small amount before rendering the scene. You'll have to play with this amount yourself to empirically determine an appropriate value, or you can calculate it if your scene uses real-world units.

Next, use glViewport to set the viewport from width/2, 0 to width, height. Now render the other eye. To do this, simply invert the sign of your tranlation from before.

The above works fine in my program. I don't use glScissor at all, but you may have to. If you do, go look at the glScissor documenation. I believe that glScissor will effect the clearing, so if you want to clear the left/right sides independently you can use it. If you don't want to clear them independently, the glViewport should be sufficient.

SeeDAreW
03-05-2002, 04:24 AM
Thanx a lot!! Could I see a sample of your code for what you are saying above??

tcobbs
03-06-2002, 11:07 AM
Originally posted by SeeDAreW:
Thanx a lot!! Could I see a sample of your code for what you are saying above??

You can download the source to my program from here: http://home.san.rr.com/tcobbs/LDView/ (there's a link near the bottom). Look in LDrawModelViewer.cpp for the string "stereo". The stereo-specific code is in various parts of the file, so you'll have to keep searching for "stereo" until you have seen it all.

SeeDAreW
03-06-2002, 11:14 AM
Can you help me a litle bit with the code link??????

tcobbs
03-06-2002, 01:22 PM
Originally posted by SeeDAreW:
Can you help me a litle bit with the code link??????



What do you mean? There is a link near the bottom of the indicated page which directs you to my source download page.

Gavin
03-07-2002, 02:13 AM
quote" But simple 3d effects can be achieved by displaying the two images side by side and looking 'through' them (either straight or 'cross-eyed': right eye focuses on left image and v.v.)."

well if you want to be pedantic. But back in the real world of shutter glasses and z screens.....
Displaying a second open gl window is easy. But you want both to move together that would mean you hacking about at a lower level than gl. Splitting one large window into two would be easier.

Furrage
03-07-2002, 05:59 AM
Nice long conversation. But the question is...

Does SeeDAreW want to see a stereoscopic image or does (s)he want two images side by side that if put together by whatever method would result in a stereoscopic image?

Based on SeeDAreW's question the latter seems likely. Some people do want that result to study stereoscopic effects and such. Probably SeeDAreW should clarify.

SeeDAreW
03-08-2002, 01:42 AM
HE wants to create a stereoscopic image in whatever method. With one or two windows, crosseyed or not I don't care! All I want is to create a stereoscopic image!!!

tcobbs
03-08-2002, 07:24 AM
Originally posted by SeeDAreW:
HE wants to create a stereoscopic image in whatever method. With one or two windows, crosseyed or not I don't care! All I want is to create a stereoscopic image!!!

I gave you a detailed description of how to do what you want. When you asked, I posted a link to my source code. When you asked a question about that that made no sense due to its complete lack of specificity, I asked for more information, and you were completely, totally, utterly silent. So far, you haven't impressed me very much, but I am trying my utmost to be helpful.

nemesis
03-08-2002, 09:18 AM
All I want is to create a stereoscopic image!!!

I believe it has been answered already...

zeckensack
03-08-2002, 11:45 AM
HE wants to create a stereoscopic image in whatever method. With one or two windows, crosseyed or not I don't care! All I want is to create a stereoscopic image!!!
Have somebody take photographs of yourself from two slightly different positions. Digital camera preferred. Upload them to your machine. Open them in Photoshop. Put the two images side by side into the work space. Stare at your screen until you see a stereoscopic image.

Good, huh?

Gavin
03-09-2002, 04:18 AM
Before spending ages trying to do quad buffering (i.e. back_left back_right etc) make sure your graphics card supports it!

SeeDAreW
03-09-2002, 12:55 PM
Originally posted by Gavin:
Before spending ages trying to do quad buffering (i.e. back_left back_right etc) make sure your graphics card supports it!

It does!!!!!

zeckensack
03-09-2002, 01:36 PM
I've never tried it, but according to the docs glut (http://www.cs.utah.edu/~narobins/glut.html) has everything you need. You can open multiple windows and assign different rendering and input functions to them.

[This message has been edited by zeckensack (edited 03-09-2002).]

Gavin
03-13-2002, 01:50 AM
Glut happily creates multiple windows if you so wish. Other things to consider...
Have you actually launched opengl in quad buffered mode and checked? Just we had some major driver/os problems. Also you need to be displaying at about 120hz, less than this will cause eye strain and a poor stereo effect. (basically your brain works at 60hz ish). So as well as a good graphics card, and processor/memory, a good monitor is needed.

gav

SeeDAreW
03-13-2002, 02:01 AM
dear gavin,

I am working on a 3DLabs Oxygen GVX420, which I think that it is pretty fine. My monitor is 21" and it supports up to 1600*1200 @ 147hz. Can you tell me again in what speed my brain works???

Thanks a lot
SeeDAreW

Originally posted by Gavin:
Glut happily creates multiple windows if you so wish. Other things to consider...
Have you actually launched opengl in quad buffered mode and checked? Just we had some major driver/os problems. Also you need to be displaying at about 120hz, less than this will cause eye strain and a poor stereo effect. (basically your brain works at 60hz ish). So as well as a good graphics card, and processor/memory, a good monitor is needed.

gav

SeeDAreW
03-13-2002, 02:04 AM
I forgot to tell you I have 1GB of DDR-Ram and my processor is a Pentium 4 @ 2.2GHz

Thanks again
SeeDAreW

Originally posted by Gavin:
Glut happily creates multiple windows if you so wish. Other things to consider...
Have you actually launched opengl in quad buffered mode and checked? Just we had some major driver/os problems. Also you need to be displaying at about 120hz, less than this will cause eye strain and a poor stereo effect. (basically your brain works at 60hz ish). So as well as a good graphics card, and processor/memory, a good monitor is needed.

gav

Gavin
03-13-2002, 03:06 AM
Just be aware when you are looking at your images that this frame rate is very important, so when you think it isn't working, it may be but just not fast enough to be tricking your brain into thinking it is seeing in 3d. I have seen our SGI Onyz chug on what looks fairly simple stuff.

SeeDAreW
03-14-2002, 03:29 AM
Originally posted by Gavin:
Just be aware when you are looking at your images that this frame rate is very important, so when you think it isn't working, it may be but just not fast enough to be tricking your brain into thinking it is seeing in 3d. I have seen our SGI Onyz chug on what looks fairly simple stuff.

OK