Actually, R is not the radius of the cone's base. Rather, the radius is calculated based on the values of R and H.<div>One more thing. A question about your example:</div><div><br></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">Renderer->SetDisplayPoint(x, y, z);<br>
Renderer->DisplayToWorld();<br>double p[3];<br>Renderer->GetWorldPoint(p);</span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><br></span></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Let me see if I understood it correctly.</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">If I set Z to a value that is equal to the Near Clipping Plane's distance, then the output will be a point that lies on the near clipping plane?</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Thank you for your answers!</span></font></div>
<div><br><div class="gmail_quote">Em 17 de dezembro de 2010 20:30, 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/17 Vinicius Rogério Araujo Silva <span dir="ltr"><<a href="mailto:vinicius.ras@gmail.com" target="_blank">vinicius.ras@gmail.com</a>></span><br><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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>
</blockquote><div><br></div></div><div>As far as I know, any plane that is parallel to the near or far clipping planes can be considered a "view plane". But since you need to know the distance, you have to choose one specific plane: usually the near plane, the far plane, or the focal plane.</div>
<div class="im">
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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>
</blockquote><div><br></div></div><div>You lost me here. First you say that the user chooses R and H, and then you say that R will be calculated.</div><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<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>
</blockquote><div><br></div></div><div>The viewplane that you choose should be the plane at the base of your cone. I'm guessing that your cone has its tip at the camera position, and has its base either at the far clipping plane or at some position in between the near and far clipping plane. Wherever its base is, I'm guessing that you should use that position as your view plane. So the distance to the view plane is H, i.e. whatever you choose as the height of the cone. I might be misunderstanding, though.</div>
<div><br></div><font color="#888888"><div> David</div></font><div><div></div><div class="h5"><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<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" target="_blank">david.gobbi@gmail.com</a>></span> escreveu:<div><div>
</div><div><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" target="_blank">vinicius.ras@gmail.com</a>>:<br>
<div><div></div><div>> 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></div></div><br></div>
</blockquote></div></div></div><br>
</blockquote></div><br></div>