<div dir="ltr">VTK uses the standard transformation process used in OpenGL. There are a few tutorials online that give an overview of this, one that I've found useful in the past is here:<br><br><a href="http://www.songho.ca/opengl/gl_transform.html">http://www.songho.ca/opengl/gl_transform.html</a><br><br>As for the VTK-specific implementation, the code that implements this process is spread out across several locations in vtkOpenGLCamera, vtkRenderer, and vtkViewport. The class vtkCoordinate provides a convenient API to convert coordinates between display/world or to any intermediate coordinate system.<br><br>If you're only concerned with world <-> display and are interested in seeing the math used, a more compact replication of this transformation logic can be found in the (internal) FastDepthAwareCoordinateConverter class here:<br><br><a href="https://github.com/Kitware/VTK/blob/master/Rendering/Core/vtkBillboardTextActor3D.cxx#L62-L193">https://github.com/Kitware/VTK/blob/master/Rendering/Core/vtkBillboardTextActor3D.cxx#L62-L193</a><br><br>HTH,<br>Allie<br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 31, 2018 at 2:08 AM, vinmean <span dir="ltr"><<a href="mailto:iamdpak@gmail.com" target="_blank">iamdpak@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I want to recreate the transformation from display to world and world to<br>
display coordinate system. Where is the math behind coordinate conversion<br>
implemented? I am unable to trace it from the viewport class that provides<br>
the member function WorldToDisplay and DisplayToWorld.<br>
<br>
renderer->SetWorldPoint(wrld_<wbr>cord);<br>
renderer->WorldToDisplay();<br>
renderer->GetDisplayPoint(scr_<wbr>cord);<br>
<br>
Please point me to the math either in the code or in some tutorials.<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.<wbr>com/VTK-Users-f1224199.html</a><br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://vtk.org/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://vtk.org/mailman/<wbr>listinfo/vtkusers</a><br>
</blockquote></div><br></div></div>