|
Hello:
I have tried to changed position of the camera focal point to zoom in/out the point cloud. I fixed the view up vector, the camera position and the direction betweeen the camera position and the camera focal point. I only changed the distance between the camera focal point and the camera position. My observations have been that no matter how I change this distance value, the view I see on the screen do not change! Any suggestion on this is appreciated. Thanks. Ziyou |
|
Administrator
|
Have you tried calling Render through spinOnce () to see if that updates the screen? If not I believe this might be a
VTK issue, as we're using the underlying camera model from VTK directly. Cheers, Radu. -- http://openperception.org On 08/01/2012 09:10 AM, ziyou wrote: > Hello: > > I have tried to changed position of the camera focal point to zoom in/out > the point cloud. I fixed the view up vector, the camera position and the > direction > betweeen the camera position and the camera focal point. I only changed the > distance between the camera focal point and the camera position. My > observations have been that no matter how I change this distance value, the > view I see on the screen do not change! > > Any suggestion on this is appreciated. > > Thanks. > > Ziyou > > > > -- > View this message in context: http://www.pcl-users.org/Why-did-changing-camera-focal-point-position-NOT-result-in-zooming-in-out-tp4020991.html > Sent from the Point Cloud Library (PCL) Users mailing list archive at Nabble.com. > _______________________________________________ > [hidden email] / http://pointclouds.org > http://pointclouds.org/mailman/listinfo/pcl-users > [hidden email] / http://pointclouds.org http://pointclouds.org/mailman/listinfo/pcl-users |
|
Radu:
Thanks for your reply. I tried your suggestion, but it did not work. I looked into this problem a bit further. It turns out just like the camera model OpenGL uses, where the exact value of the camera focal point position does not matter when it comes to zooming. Only the direction between the focal point and the camera center position plays a role in rendering, not the distance between them. To perform zooming, either the camera center position needs to move ( as in function Dolly() in VTK), or the camera ViewAngle needs to change by changing . camera_.fovy. This exposes a bug in file "../visualization/src/pcl_visualizer.cpp" with the following two functions where camera_.fovy is not initialized or updated. pcl::visualization::PCLVisualizer::initCameraParameters () pcl::visualization::PCLVisualizer::updateCamera () This also explains why the 5th parameter in "-cam p1/p2/p3/p4/p5/p6/p7" for pcd_viewer is ignored as it is always set to be the default value of 0.5253 (radians, i.e. 30 degrees). Thanks. Ziyou |
|
Administrator
|
Thanks for the analysis! Can you please submit a patch through http://dev.pointclouds.org?
Cheers, Radu. -- http://openperception.org On 08/03/2012 02:07 PM, ziyou wrote: > Radu: > > Thanks for your reply. > > I tried your suggestion, but it did not work. > > I looked into this problem a bit further. It turns out just like the camera > model OpenGL uses, where the exact value of the camera focal point position > does not matter when it comes to zooming. Only the direction between the > focal point and the camera center position plays a role in rendering, not > the distance between them. To perform zooming, either the camera center > position needs to move ( as in function Dolly() in VTK), or the camera > ViewAngle needs to change by changing . > camera_.fovy. > > This exposes a bug in file "../visualization/src/pcl_visualizer.cpp" with > the following two functions where camera_.fovy is not initialized or > updated. > > pcl::visualization::PCLVisualizer::initCameraParameters () > > pcl::visualization::PCLVisualizer::updateCamera () > > This also explains why the 5th parameter in "-cam p1/p2/p3/p4/p5/p6/p7" for > pcd_viewer is ignored as it is always set to be the default value of 0.5253 > (radians, i.e. 30 degrees). > > Thanks. > > Ziyou > > > > > -- > View this message in context: http://www.pcl-users.org/Why-did-changing-camera-focal-point-position-NOT-result-in-zooming-in-out-tp4020991p4021087.html > Sent from the Point Cloud Library (PCL) Users mailing list archive at Nabble.com. > _______________________________________________ > [hidden email] / http://pointclouds.org > http://pointclouds.org/mailman/listinfo/pcl-users > [hidden email] / http://pointclouds.org http://pointclouds.org/mailman/listinfo/pcl-users |
|
Radu:
My solution is: (1) added statement: camera_.fovy = 0.5235987667; to the last line in function pcl::visualization::PCLVisualizer::initCameraParameters () (2) add statement: renderer->GetActiveCamera ()->SetViewAngle(camera_.fovy * 180 / M_PI); after renderer->GetActiveCamera ()->SetClippingRange (camera_.clip); in function pcl::visualization::PCLVisualizer::updateCamera () FYI, both of these functions are in file pcl_visualizer.cpp. Thanks. Ziyou |
|
Administrator
|
Ziyou,
Can you please add this information to the issue as a patch? Thanks. Cheers, Radu. -- http://openperception.org On 09/18/2012 07:11 AM, ziyou wrote: > Radu: > > My solution is: > > (1) added statement: > > camera_.fovy = 0.5235987667; > > to the last line in function > pcl::visualization::PCLVisualizer::initCameraParameters () > > (2) add statement: > > renderer->GetActiveCamera ()->SetViewAngle(camera_.fovy * 180 / M_PI); > > after renderer->GetActiveCamera ()->SetClippingRange (camera_.clip); > > in function pcl::visualization::PCLVisualizer::updateCamera () > > > FYI, both of these functions are in file pcl_visualizer.cpp. > > Thanks. > > Ziyou > > > > -- > View this message in context: http://www.pcl-users.org/Why-did-changing-camera-focal-point-position-NOT-result-in-zooming-in-out-tp4020991p4022368.html > Sent from the Point Cloud Library (PCL) Users mailing list archive at Nabble.com. > _______________________________________________ > [hidden email] / http://pointclouds.org > http://pointclouds.org/mailman/listinfo/pcl-users > [hidden email] / http://pointclouds.org http://pointclouds.org/mailman/listinfo/pcl-users |
| Powered by Nabble | Edit this page |
