To convert from wx coordinates to display coordinates (that is the
display coordinates of VTK and viewport coordinates of opengl) you just
simply did this :<br><br>x = x;<br>y = height - y; // height of the renderer<br><br>
And doing this stuff (java syntax) :<br><br>vtkCoordinate coord = new vtkCoordinate();<br>coord.SetValue(x,y,0);<br>coord.SetCoordinateSystemToDisp<div id="1fqt" class="ArwC7c ckChnd">lay();<br></div><br><br><div class="gmail_quote">
2008/6/26 Julian Ibarz <<a href="mailto:julian.ibarz@gmail.com">julian.ibarz@gmail.com</a>>:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
To convert from wx coordinates to display coordinates (that is the display coordinates of VTK and viewport coordinates of opengl) you just simply did this :<br><br>x = x;<br>y = height - y; // height of the renderer<br><br>
And doing this stuff (java syntax) :<br><br>vtkCoordinate coord = new vtkCoordinate();<br>coord.SetValue(x,y,0);<br>coord.SetCoordinateSystemToDisplay();<br><br><br><br><div class="gmail_quote">2008/6/26 Sercani <<a href="mailto:sercanimailgroups@gmail.com" target="_blank">sercanimailgroups@gmail.com</a>>:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p>Hi everyone;</p>
<p>I am trying to get the points where user clicks and drags
the mouse and create shapes by using these points. I've written a class
that looks like wxVTKRenderWindowInteractor which doesn't handle
interaction but shows vtk scene in wxWindow. When user selects one of the
toggle toolbar buttons (for drawing line, angle, rectangle etc.) mouse events
are sent to a class named GlassPanel that handles all drawing stuff. When user
clicks a point, that point is taken as p1, and when user starts dragging the
mouse , position of mouse is taken as p2, depending on what shape is selected a
shape must be created by using these two points. Firstly I decided to use
vtkLineWidget for drawing lines but I couldn't manage it, because
wxWidgets coordinate system's origin is upper left hand corner, and vtk
uses lower left hand corner as origin. I tried to convert wxWidgets event coordinates
to vtkCoordinate system, but I even couldn't find which coordinate system
is used by vtkRenderer. Wherever i click on wxWindow lines are drawn at the
windows center. How should I convert these coordinates?Or what is the best way
to draw 2D shapes using vtk?</p>
<p>Thanks already…</p>
<p> </p>
<p> </p>
</div>
</div>
<br></div>_______________________________________________<br>
This is the private VTK discussion list.<br>
Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><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></blockquote></div><br><br clear="all"><br>-- <br><font color="#888888">Julian Ibarz
</font></blockquote></div><br><br clear="all"><br>-- <br>Julian Ibarz