Two windows of stereo passive dual mode
- shinhujune
- Topic Author
- Offline
- Posts: 4
Hi,
I am trying to plot stereo camera's views into two separate windows. However, some objects in world are not displayed in one of two windows. I programmed my code based on the example '18-endoscope'.
I attached a screenshot of two windows.
Attachment StereoProblem.PNG not found
As you can see, only blue and yellow bars are not displayed in left image.
Following is a part of graphic loop.
while (!glfwWindowShouldClose(windowL) && !glfwWindowShouldClose(windowR) )
{
////////////////////////////////////////////////////////////////////////
// RENDER WINDOW R
////////////////////////////////////////////////////////////////////////
// activate display context
glfwMakeContextCurrent(windowR);
// get width and height of window
glfwGetWindowSize(windowR, &widthR, &heightR);
// render graphics
updateGraphicsR();
// swap buffers
glfwSwapBuffers(windowR);
////////////////////////////////////////////////////////////////////////
// RENDER WINDOW L
////////////////////////////////////////////////////////////////////////
// activate display context
glfwMakeContextCurrent(windowL);
// get width and height of window
glfwGetWindowSize(windowL, &widthL, &heightL);
// render graphics
updateGraphicsL();
// swap buffers
glfwSwapBuffers(windowL);
When I change order of "Render Window R" and "Render Window L", the blue and yellow bars does not show up in right image. So it looks like the order of rendering matters. If left image is updated first, it shows every objects but those two bars are missing if the left image is updated after right image.
Please give me comments on this problem.
I am using Windows 10, GPU: GTX 1080 ti, Haptic device: phantom omni
Please Log in or Create an account to join the conversation.
You have probably enabled the display list functionality on the object in question which stores the model on the graphics card for one display context.
In order for the data to be shared among multiple display contexts, you need to specify this when creating the second window. More information can be found here (Context object sharing):
www.glfw.org/docs/latest/context_guide.html#context_sharing
Please Log in or Create an account to join the conversation.
- shinhujune
- Topic Author
- Offline
- Posts: 4
Thank you very much. It is working after I changed code like below
windowR = glfwCreateWindow(w, h, "RightView", NULL, windowL);
Please Log in or Create an account to join the conversation.