<div dir="ltr">Better late then never? Someone asked me off list for my patch so I am posting it here as well. I haven't tested this particular patch, because I had to remove some other changes I made, but I think this will work.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 1, 2012 at 1:01 PM, Aashish Chaudhary <span dir="ltr"><<a href="mailto:aashish.chaudhary@kitware.com" target="_blank">aashish.chaudhary@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Very nice.. Could you please send me the patch?<br>
<br>
Thanks,<br>
<br>
<br>
On Fri, Jul 6, 2012 at 5:24 PM, Krzysztof Kamieniecki<br>
<div class="HOEnZb"><div class="h5"><<a href="mailto:krys@kamieniecki.com">krys@kamieniecki.com</a>> wrote:<br>
> I have a patch available (i'm not sure where to send it). I changed<br>
> vtkCamera and vtkOpenGLGPUVolumeRayCastMapper to produce and expect<br>
> GetEyePosition() to give the actual eye position in world space. This seems<br>
> to fix my problem. I think there may still be a clipping issue because of<br>
> the use of GetEyePlaneNormal in vtkRenderer. I have to fix some of my own<br>
> code to get more testing done and I would like to hear more about the<br>
> original intent of EyePosition before making any more changes.<br>
><br>
> On Fri, Jul 6, 2012 at 1:54 PM, Krzysztof Kamieniecki <<a href="mailto:krys@kamieniecki.com">krys@kamieniecki.com</a>><br>
> wrote:<br>
>><br>
>> Hi Aashish,<br>
>><br>
>> I would like to try to take a stab at it.<br>
>><br>
>> Based on the only use of GetEyePosition in VTK it seems like<br>
>> GetEyePosition should return the world space positions. (This expectation<br>
>> also explains the problems I have been seeing with weird clipping)<br>
>><br>
>> from vtkRenderer::ResetCameraClippingRange<br>
>> ...<br>
>> if(!this->ActiveCamera->GetUseOffAxisProjection())<br>
>> {<br>
>> this->ActiveCamera->GetViewPlaneNormal(vn);<br>
>> this->ActiveCamera->GetPosition(position);<br>
>> this->ExpandBounds(bounds,<br>
>> this->ActiveCamera->GetModelTransformMatrix());<br>
>> }<br>
>> else<br>
>> {<br>
>> this->ActiveCamera->GetEyePosition(position);<br>
>> this->ActiveCamera->GetEyePlaneNormal(vn);<br>
>> this->ExpandBounds(bounds,<br>
>> this->ActiveCamera->GetModelViewTransformMatrix());<br>
>> }<br>
>> ...<br>
>><br>
>> My current understanding is that the OffAxisProjection perspective<br>
>> transformation matrix is being used by the GPU Renderer to setup to outer<br>
>> polygons.<br>
>><br>
>> So the main thing to do would be to produce world coordinate Eye Positions<br>
>> and use those instead of the Camera Position in the volume Renderer, so the<br>
>> shaders would get the proper ray directions?<br>
>><br>
>> What is the desired functionality of EyeTransform? WorldToEye, EyeToWorld,<br>
>> CameraToEye, EyeToCamera?<br>
>><br>
>> Best Regards,<br>
>> Krys<br>
>><br>
>> On Fri, Jul 6, 2012 at 1:41 PM, Aashish Chaudhary<br>
>> <<a href="mailto:aashish.chaudhary@kitware.com">aashish.chaudhary@kitware.com</a>> wrote:<br>
>>><br>
>>> Hi Krzysztof,<br>
>>><br>
>>> On Fri, Jul 6, 2012 at 1:12 PM, Krzysztof Kamieniecki<br>
>>> <<a href="mailto:krys@kamieniecki.com">krys@kamieniecki.com</a>> wrote:<br>
>>> > Hi,<br>
>>> ><br>
>>> > How is the EyePosition and EyeTransform functionality supposed to<br>
>>> > behave,<br>
>>> > should the positions be in CameraSpace or WorldSpace?<br>
>>> ><br>
>>> > Should they be syncronized with EyeSeparation / LeftEye when in<br>
>>> > Off-Axis<br>
>>> > Projection mode?<br>
>>><br>
>>> ><br>
>>> > I am trying to get the GPU Volume renderer to work with Stereo 3D in<br>
>>> > Off-Axis projection mode, one problem seems to be that the Camera<br>
>>> > position<br>
>>> > is used instead of the Eye position.<br>
>>><br>
>>> This is a known problem and based on my prior discussions with volume<br>
>>> rendering experts here at Kitware, I believe that this needs to be<br>
>>> fixed on the volume rendering side of things.<br>
>>> If you want to make it work by yourself then we could provide you<br>
>>> guidance for this task.<br>
>>><br>
>>> Thanks,<br>
>>><br>
>>><br>
>>><br>
>>> ><br>
>>> > Thanks,<br>
>>> > Krys<br>
>>> ><br>
>>> > _______________________________________________<br>
>>> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>>> ><br>
>>> > Visit other Kitware open-source projects at<br>
>>> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>>> ><br>
>>> > Please keep messages on-topic and check the VTK FAQ at:<br>
>>> > <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
>>> ><br>
>>> > Follow this link to subscribe/unsubscribe:<br>
>>> > <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
>>> ><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> | Aashish Chaudhary<br>
>>> | R&D Engineer<br>
>>> | Kitware Inc.<br>
>>> | <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
<br>
<br>
<br>
--<br>
| Aashish Chaudhary<br>
| R&D Engineer<br>
| Kitware Inc.<br>
| <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
</div></div></blockquote></div><br></div>