[vtk-developers] vtkOpenVRRenderWindow and vtkWin32OpenGLRenderWindow

Ken Martin ken.martin at kitware.com
Wed May 3 12:58:20 EDT 2017


Nope that looks like it - Ken

On Wed, May 3, 2017 at 11:31 AM, Carlos Lopez <rcourant at gmail.com> wrote:

> Ok, am I missing a step?
>
> I create the classes as you suggest, since turning off the factory option
> makes OpenVRRenderer initialize the wrong camera class.
> (I rebuilt vtk with the openvr factory on, and initialized both sets
> explicitly)
>
> I set:
>
> renWin->AddRenderer(ren1);
> iren->SetRenderWindow(renWin)
> ren1->SetActiveCamera(camera);
>
> is there some other connection that should be done explicitly?
>
> thanks,
> carlos
>
>
>
>
>
>
>
> On Wed, May 3, 2017 at 11:20 AM, Ken Martin <ken.martin at kitware.com>
> wrote:
>
>> Make sure you also explicitly create the OpenGL/OpenVRCamera for each
>> renderer as they are different. And I would create the
>> OpenVRRenderWindowInteractor Win32OpenGLRenderWindowInteractor
>> explicitly and assign them. Those are the 4 key classes you have to
>> explicitly create as leaf nodes
>>
>> OpenVRRenderWIndow
>> OpenVRRenderer
>> OpenVRCamera
>> OpenVRRenderWIndowInteractor
>>
>> Win32OpenGLRenderWindow
>> OpenGLRenderer
>> OpenGLCamera
>> Win32OpenGLRenderWIndowInteractor
>>
>>
>>
>>
>> On Wed, May 3, 2017 at 11:08 AM, Carlos Lopez <rcourant at gmail.com> wrote:
>>
>>> Hi Ken,
>>>
>>> Thanks for your reply.
>>>
>>> There seems to be something else going on.
>>>
>>> In my example, I create 2 of source (cubesource),mapper, actor ,
>>> renderer, and renderwindow; for the last 2 one is win32 and the other
>>> OpenVR.
>>>
>>> I add the cube to the win32 render window and call render, it appears
>>> and renders correctly.
>>>
>>> Calling renwin->Render() in a loop only for the OpenVR render window,
>>> running under the debugger, makes the OpenVR window on the screen show in
>>> sequence, a black screen and then the VR circles. It does not update the
>>> graphics and seems to be showing an old frame.
>>>
>>> If I run the OpenVR loop, before the win32 window renders, then it works
>>> ok, it tracks and renders the geometry and the controllers, but then
>>> calling render on the other one, one single time and going back to its own
>>> loop, breaks the rendering as described above.
>>>
>>> There also seems to be an issue with the order of initialization if I
>>> add an interactor to the win32 window.
>>>
>>> any suggestions are welcome.
>>>
>>> thanks,
>>> carlos
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Wed, May 3, 2017 at 8:34 AM, Ken Martin <ken.martin at kitware.com>
>>> wrote:
>>>
>>>> It should work, but you have to be careful, I would not share any
>>>> mappers/actors etc between the two and make sure you are letting the OpenVR
>>>> loop run at least 100 fps.
>>>>
>>>> On Tue, May 2, 2017 at 6:05 PM, Carlos Lopez <rcourant at gmail.com>
>>>> wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> Is it possible to have a vtkOpenVRRenderWindow and  a
>>>>> vtkWin32OpenGLRenderWindow
>>>>> working in the same application?
>>>>>
>>>>> I'm trying it by compiling vtk without the OpenVR render factory
>>>>> enabled and initializing the openvr classes directly.
>>>>>
>>>>> I get to have 2 render windows, one for openvr and a regular one.
>>>>> Calling renwin->Render() inside a loop for the openvr window works as it
>>>>> tracks the HMD and shows the controllers, but if I call Render() for the
>>>>> regular window, the openVRRenderWindow stops tracking the HMD and the
>>>>> rendering starts to flicker.
>>>>>
>>>>> Is there any shared resource between these windows that would break
>>>>> the rendering?
>>>>>
>>>>> thanks,
>>>>> carlos
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Powered by www.kitware.com
>>>>>
>>>>> Visit other Kitware open-source projects at
>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>> Search the list archives at: http://markmail.org/search/?q=
>>>>> vtk-developers
>>>>>
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://public.kitware.com/mailman/listinfo/vtk-developers
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Ken Martin PhD
>>>> Distinguished Engineer
>>>> Kitware Inc.
>>>> 28 Corporate Drive
>>>> Clifton Park NY 12065
>>>>
>>>> This communication, including all attachments, contains confidential
>>>> and legally privileged information, and it is intended only for the use of
>>>> the addressee.  Access to this email by anyone else is unauthorized. If you
>>>> are not the intended recipient, any disclosure, copying, distribution or
>>>> any action taken in reliance on it is prohibited and may be unlawful. If
>>>> you received this communication in error please notify us immediately and
>>>> destroy the original message.  Thank you.
>>>>
>>>
>>>
>>
>>
>> --
>> Ken Martin PhD
>> Distinguished Engineer
>> Kitware Inc.
>> 28 Corporate Drive
>> Clifton Park NY 12065
>>
>> This communication, including all attachments, contains confidential and
>> legally privileged information, and it is intended only for the use of the
>> addressee.  Access to this email by anyone else is unauthorized. If you are
>> not the intended recipient, any disclosure, copying, distribution or any
>> action taken in reliance on it is prohibited and may be unlawful. If you
>> received this communication in error please notify us immediately and
>> destroy the original message.  Thank you.
>>
>
>


-- 
Ken Martin PhD
Distinguished Engineer
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065

This communication, including all attachments, contains confidential and
legally privileged information, and it is intended only for the use of the
addressee.  Access to this email by anyone else is unauthorized. If you are
not the intended recipient, any disclosure, copying, distribution or any
action taken in reliance on it is prohibited and may be unlawful. If you
received this communication in error please notify us immediately and
destroy the original message.  Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20170503/2579b19a/attachment.html>


More information about the vtk-developers mailing list