NOTE: Yesterday I posted this question with some images attached. Since the 
post size was bigger than the allowed, I received a mail that stated the post 
was awaiting approval and that I could either wait for it or cancel the post. I 
decided to cancel it and, instead of attaching the images, upload them to 
PostImage and use the links.
I received the newsletter update and didn't see my post, but I can still see it 
in the forum.
If and admin see this, please delete the older post since it weights too much.
Thanks.
End of note

Hi,

here I come again. We have an app that uses OSG for the visualization and 
interaction with point clouds (PCL format). 
We have implemented a viewer class that inherits both from QWidget and 
osgViewer, following the example of Qt integration in the Cookbook (in fact, 
the camera creation code is the same).

Everything works fine except for the zoom. When zooming in, there's a limit. 
Once reached, we can't zoom in anymore, it seems like the camera is "blocked". 
When zooming out, there's no problem.


This image (http://postimg.org/image/ufmtggy3l/d87070e0/) shows one point 
cloud. Then, when zooming in, we can zoom only until what the image shows 
(http://postimg.org/image/7nittuilv/9815d784/). No more zoom in from there.

A curious thing, when we're about to reach that point, the zooming starts to 
slow down, until it completeley stops.

Now, playing a bit with the camera, I tried the setNode method. Every time we 
load a new point cloud, it is added to a node group and then I do:


Code:
getCameraManipulator()->setNode( group )



With this, we can zoom in forever, even passing through the clouds. See, for 
example, this. (http://postimg.org/image/3nrxxvpdx/7861b8a8/)


But!! Using setNode "breaks" other code. 

For each set of point clouds we have a recorded trajectory and we can "run" the 
trajectory and the camera in the viewer will change its position to point to 
the equivalent point in the  cloud group. This allow us to make videos so we 
can run the trajectory and check the point clouds as if we're in the car.

Without setNode, if I zoom in the cloud, then play the trajectory, the zoom 
remains the same. We have 5 clouds loaded for this example.

Check the  initial state (http://postimg.org/image/nlj2x8bxv/a72c7867/) and 
what happens when running the trajectory 3 steps 
(http://postimg.org/image/bhyjukncf/11cfe530/).

Doing this with setNode enabled, changes the zoom level. Check 
the initial step (http://postimg.org/image/landhc40b/46d4eac9/) and what 
happens with only one step (http://postimg.org/image/8z08d69wz/e2a93220/)

So, my question at last. 

Is there a way to let the camera zoom in without a limit?

PS: When running the trajectory, we re-center the camera. First we change the 
position of the sphere and then, we change the camera's home position so it 
will point to the sphere.

PS 2: When using setNode and running the trajectory, we can pause the run, then 
we can zoom in again without limit. But once the run is started, the zoom 
"resets" itself.

PS 3: Without setNode, we can bypass the zoom limit if and only if the clouds 
are linked  to a trajectory. This means that the spehere is created and 
visualized. The spehere marks the current trajectory point in the cloud group.
... 

Sorry for this humongous post! If you want to check our viewer code, feel free 
to ask.

Thanks and cheers!

Adrián

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=59710#59710





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to