StereoScopic

Iwanna open a second window in the same prg in so that I can see in VR a stereoscopic Image. Help!!!

Are you asking how to open a second window or how to render a stereoscopic image?

yes!!

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

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

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???

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

That is not the way stereoscopic rendering works. You need to do it in the same window, alternating left and right eye images.

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.

Originally posted by JML:
[b] [quote]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.[/b][/QUOTE]

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!!!

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.

Thanx a lot!! Could I see a sample of your code for what you are saying above??

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.

Can you help me a litle bit with the code link???

Originally posted by SeeDAreW:
[b]Can you help me a litle bit with the code link???

[/b]

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

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.

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.

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!!!

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.

All I want is to create a stereoscopic image!!!

I believe it has been answered already…