Well, these conversion functions will help me a lot.<div>But I got a little confused about the viewplane now..</div><div><br></div><div>Can I consider the near clipping plane as the viewplane?</div><div>Are they the same thing?</div>
<div><br></div><div>I'll try to explain my problem a bit further.</div><div>I'm trying to implement a selection algorithm which involves a cone. The user should be able to select points that lie inside of that "virtual cone".</div>
<div>Because of my application's requirements, the user should be able to provide two things to the application: a radius R and an height H.</div><div>Then the application should then be able to calculate the cone in the following way: the height of the cone will be given by H, and the radius will be calculated as a value proportional to H, in such a way that if H equals the distance from the camera to the viewplane, the radius of the cone's base will be R.</div>
<div><br></div><div>That is why it is so important to me to find the distance from the camera to the viewplane.</div><div>Also, I've tried using the near clipping plane as the "viewplane" of my problem, but unfortunately it did not produce the results I've expected.</div>
<div><br></div><div><div class="gmail_quote">Em 17 de dezembro de 2010 02:02, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>></span> escreveu:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2010/12/16 Vinicius Rogério Araujo Silva <<a href="mailto:vinicius.ras@gmail.com">vinicius.ras@gmail.com</a>>:<br>
<div><div></div><div class="h5">> Hi all,<br>
> I'm new to VTK and after spending some time searching, I've decided to join<br>
> the mailing list to see if you guys can help solving my questions.<br>
> It seems pretty simple, yet I just couldn't find a way to solve it.<br>
> Question is:<br>
> Is there any way to retrieve the distance between the eye of projection<br>
> ("camera") and the view plane?<br>
> Or is there any way I can retrieve the plane equation for the view plane?<br>
> Any help is really apreciated. Thank you.<br>
<br>
</div></div>Camera->GetClippingRange() is probably what you want, it will return the<br>
distance from the camera to the near and the far clipping planes. You can<br>
use Camera->GetViewPlaneNormal() to get the normal.<br>
<br>
The renderer also has methods for doing coordinate conversion between<br>
display coordinates (i.e. pixels at the view plane) and world coordinates<br>
(i.e. 3D coordinates in the scene):<br>
<br>
Renderer->SetDisplayPoint(x, y, z); // use z = 0 for view plane<br>
Renderer->DisplayToWorld();<br>
double p[3];<br>
Renderer->GetWorldPoint(p);<br>
<br>
So you can, for instance, give the display coords for the four corners of<br>
your window, and this will provide the 3D coords corresponding to the<br>
corners of the view plane. Display coords start from (0,0) in the lower<br>
left corner of the window.<br>
<font color="#888888"><br>
David<br>
</font></blockquote></div><br></div>