CHAI3DCHAI3D

normal Passive Stereo - Dual Display

More
23 Jun 2016 04:58 #1

Hi

I use a stereo system in which both left and right eye images are simultaneously conveyed to the intended eye through independent channels.

So, I set the following.


(Visual Studio 2013)

int main(int argc, char* argv[])
{
...

camera->setStereoMode(C_STEREO_PASSIVE_DUAL_DISPLAY);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE | GLUT_STEREO);


video_grab_LEFT = new cBitmap();
video_grab_RIGHT = new cBitmap();

camera->m_backLayer->addChild(video_grab_RIGHT);
...
}

void updateGraphics(void)
{
...
glDrawBuffer(GL_BACK_RIGHT);
camera->renderView(displayW, displayH, 0, C_STEREO_RIGHT_EYE);


camera->m_backLayer->removeChild(video_grab_RIGHT );
camera->m_backLayer->addChild(video_grab_LEFT );

glDrawBuffer(GL_BACK_LEFT);
camera->renderView(displayW, displayH, 0, C_STEREO_LEFT_EYE);


camera->m_backLayer->removeChild(video_grab_LEFT );
camera->m_backLayer->addChild(video_grab_RIGHT );
...
}


(NVIDIA control panel)

Manage 3D Settings - Stereo Display Mode - nView Clone mode
Manage 3D Settings - Stereo Enable - On

Set up multiple displays - Duplicate displays



However, both monitors display only left eye image.

How to make a passive dual display system ??

Please Log in or Create an account to join the conversation.

More
23 Jun 2016 22:05 #2

Would you have more information about the type of display that you are using?

Is this a stereo display that requires using an NVIDIA QUADRO graphic card?

Please Log in or Create an account to join the conversation.

More
24 Jun 2016 02:15 #3

Thank you for your reply.



When testing, I use one graphic card (quadro K4200) with 2 displays (nView clone mode) and two genernal DVI monitors. (The monitors also support HDMI/DisplayPort display.)

I expect one monitor displays a left gldrawbuffer and the other diaplays a right gldrawbuffer because my target stereo system has two independent channels.

The target system works at 1080i,1920x1080 30Hz.


I tried a PASSIVE_LEFT_RIGHT stereo mode, too.

camera->setStereoMode(C_STEREO_PASSIVE_LEFT_RIGHT);

As a result, one window has two frames.

A left frame displays a left eye view and a right frame displays a right eye view about objects that are attached at "world".

However, bitmap images (video_grab_RIGHT, video_grab_LEFT) that are attached at camera->m_backlayer do not display separately. In other words, both frames display a right image.

I wonder if glDrawBuffer function works well or not....

Please Log in or Create an account to join the conversation.

More
29 Jun 2016 15:34 #4

From your description, it appears that you are using two monitors and would like to render the left eye image on one monitor and the right eye image on the other. There are two ways of doing this:

Single Window Application:

  1. Through the NVIDIA panel, configure your desktop to support both monitors side by side.
  2. Create an application that runs in full screen mode and spans the entire desktop, therefore covering both monitors.
  3. Enable the C_STEREO_PASSIVE_LEFT_RIGHT mode as illustrated in the CHAI3D examples
  4. Both left and right images are rendered in a single pass by calling method camera->renderView(windowW, windowH); (see CHAI3D examples)
Dual Window Application:
  1. Create an application where two individuals window displays (viewports) are instantiated and placed in full screen on each monitor.
  2. Enable the C_STEREO_PASSIVE_DUAL_DISPLAY mode
  3. For each individual window, you may call methods camera->renderView(windowW, windowH, 0, C_STEREO_LEFT_EYE) or camera->renderView(windowW, windowH, 0, C_STEREO_LEFT_RIGHT) depending of which eye view you want to render in that window.

Please Log in or Create an account to join the conversation.

More
30 Jun 2016 04:51 #5

Thank you for your reply~

As you said,
I use two monitors and would like to render the left eye image on one monitor and the right eye image on the other.

In addition, I would like to render two object types : mesh objects that are attached at "world" and bitmap objects that are attached at "camera->m_backLayer".


1)
Could you tell me what CHAI3D example runs at the C_STEREO_PASSIVE_LEFT_RIGHT mode?

I saw 31 CHAI3D examples : "Release\chai3d-3.1.1-VisualStudio\chai3d-3.1.1\examples\GLUT"
They all run at the C_STEREO_DISABLED mode.

I saw 4 CHAI3d examples : "Release\chai3d-3.1.1-VisualStudio\chai3d-3.1.1\modules\OCULUS\examples\SDL"
They call method camera->renderView(size.w, size.h, 0, C_STEREO_LEFT_EYE, false).
They don't call method camera->renderView(size.w, size.h, 0, C_STEREO_RIGHT_EYE, false).

I cannot find any example for the C_STEREO_PASSIVE_LEFT_RIGHT or C_STEREO_PASSIVE_DUAL_DISPLAY mode.



2)
I tried to do the way "Single Window Application"

But, if I make my application runs in full screen, the application just covers one main monitor.

I can make my application spans the entire desktop that covers both monitors.

However, I don't know how my application runs in full screen and covers two monitors at the same time.


3)
At the C_STEREO_PASSIVE_LEFT_RIGHT mode (not fullscreen)
the left eye image of the mesh objects is displayed on a left side and
the right eye image of the mesh objects is displayed on a right side.

However, bitmap objects are displayed with the same image on both sides.

Could you tell me how to display bitmap objects at the left and right eye view.

I wonder if only world's child objectes are rendered at "stereo mode" and camera's front/back-Layer objectes are rendered at 2D.


4)
I saw an example "18-endoscope".

I make two individuals window displays.

At one window (monitor), I call method camera->renderView(windowW, windowH, 0, C_STEREO_LEFT_EYE) and camera->m_backLayer->addChild(bitmap_left);
At the other windows, I call method camera->renderView(windowW, windowH, 0, C_STEREO_RIGHT_EYE) and camera->m_backLayer->addChild(bitmap_right);

This is right!

However, the application displays "out of memory" in 2 minute after runs

I did not solve the memory problem.


5)

Is it possible to make the "Single Window Application" and the "C_STEREO_PASSIVE_DUAL_DISPLAY mode" at the same time ?


As I said on 23 Jun 2016 04:58,

I tried the single window application and the C_STEREO_PASSIVE_DUAL_DISPLAY mode.
(NVIDIA setting : Stereo Display Mode - nView Clone mode)


// case 1


glDrawBuffer(GL_BACK_LEFT);
camera->m_backLayer->addChild(bitmap_LEFT );
camera->renderView(displayW, displayH, 0, C_STEREO_LEFT_EYE);
camera->m_backLayer->removeChild(bitmap_LEFT );

glDrawBuffer(GL_BACK_RIGHT);
camera->m_backLayer->addChild(bitmap_RIGHT );
camera->renderView(displayW, displayH, 0, C_STEREO_RIGHT_EYE);
camera->m_backLayer->removeChild(bitmap_RIGHT );

glutSwapBuffers();


// case 2

glDrawBuffer(GL_BACK_RIGHT);
camera->m_backLayer->addChild(bitmap_RIGHT );
camera->renderView(displayW, displayH, 0, C_STEREO_RIGHT_EYE);
camera->m_backLayer->removeChild(bitmap_RIGHT );



glDrawBuffer(GL_BACK_LEFT);
camera->m_backLayer->addChild(bitmap_LEFT );
camera->renderView(displayW, displayH, 0, C_STEREO_LEFT_EYE);
camera->m_backLayer->removeChild(bitmap_LEFT );

glutSwapBuffers();


case 1 : Both windows display the right eye image and the bitmap_RIGHT.
case 2 : Both windows display the left eye image and the bitmap_LEFT.

Both windows display the same image that is rendered before calling glutSwapBuffers().


Thank you !

Please Log in or Create an account to join the conversation.

More
01 Jul 2016 18:26 #6

A few answers to your questions:

1)
Could you tell me what CHAI3D example runs at the C_STEREO_PASSIVE_LEFT_RIGHT mode?
I saw 31 CHAI3D examples : "Release\chai3d-3.1.1-VisualStudio\chai3d-3.1.1\examples\GLUT"
They all run at the C_STEREO_DISABLED mode.

By default, all examples are set to C_STEREO_DISABLED. Simply set the variable to C_STEREO_PASSIVE_LEFT_RIGHT and the stereoscopic mode will be enabled.


2)
I saw 4 CHAI3d examples : "Release\chai3d-3.1.1-VisualStudio\chai3d-3.1.1\modules\OCULUS\examples\SDL"
They call method camera->renderView(size.w, size.h, 0, C_STEREO_LEFT_EYE, false).
They don't call method camera->renderView(size.w, size.h, 0, C_STEREO_RIGHT_EYE, false).

Rendering Stereo on the Oculus display requires using a slightly different approach where the left eye is rendered,
the camera is then shifted slightly to where the right eye is located, and then the left eye is rendered again (where the right eye is located).

Support for the oculus is being updated as the Oculus SDK was being finalized.


3)
I cannot find any example for the C_STEREO_PASSIVE_LEFT_RIGHT or C_STEREO_PASSIVE_DUAL_DISPLAY mode.

None are currently available, but we will make sure to include an example in the next release later this summer!


4)
I tried to do the way "Single Window Application"
But, if I make my application runs in full screen, the application just covers one main monitor.
I can make my application spans the entire desktop that covers both monitors.

However, I don't know how my application runs in full screen and covers two monitors at the same time.

On way to address this problem would be to create two GLUT window displays. See the endoscope example.


5)
At the C_STEREO_PASSIVE_LEFT_RIGHT mode (not fullscreen)
the left eye image of the mesh objects is displayed on a left side and
the right eye image of the mesh objects is displayed on a right side.

However, bitmap objects are displayed with the same image on both sides.

In stereo mode the 2D widgets are not shifted as this can create undesired artefacts.
So that we understand you scene, could you please a screenshot of both screens?


I wonder if only world's child objectes are rendered at "stereo mode" and camera's front/back-Layer objectes are rendered at 2D.
This is correct!


6)
Is it possible to make the "Single Window Application" and the "C_STEREO_PASSIVE_DUAL_DISPLAY mode" at the same time ?

No, you need to create two independent windows.
A good framework to manage these developments is Qt as this will allow you to easily create multiple windows that can run of various screens.

Please Log in or Create an account to join the conversation.