- This topic has 3 replies, 2 voices, and was last updated 9 years, 3 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Programming with SOFA › [SOLVED] viewAll() function
Dear all,
I have noticed that there is a function called viewAll()
in “BaseViewer.h” and “QtViewer.h”, which is most possibly intended to adjust the zooming level so that all of the scene objects become visible. However, it seems that this function is not implemented yet. Are there any other functions with the same functionality?
Regards
Hi Sharif,
Theoretically in SOFA the camera and viewer are implemented so that all objects are visible. This is based on the Bounding Box of the objects, and the camera is positioned according to this.
However, I already faced issues when I simulating heat transfer since the temperatures are degrees of freedom (1DOF) BUT where taken into account in the bounding box computation. In this case, all you need is to set “bbox=”0 0 0” in the associated MechanicalObject.
Hope that helps,
Hugo
Hi Talbot,
Thank you for your quick response. Let’s assume that you have moved a mechanical object out of the visible part of the scene, or gravity (or another force field) has caused a mechanical object to go out of the screen. So, to be precise, I mean are there any functions that automatically change the zooming so that all mechanical objects fit into the visible part of the screen? In other words, can we order the camera to change its zooming level so that all the objects (and of course their bounding boxes) be in the view of the camera?
Thank you,
Sharif
Hi,
Then, at my best knowledge, there is no existing component meeting your requirements. But this should be feasible by implementing a specific camera (heriting from InteractiveCamera) which fits the positions of the MechanicalObjects. For example, the camera could define as input data the bounding boxes of the MechanicalObjects and therefore the camera could check whether the field of view fits or not these inputs.
I unfortunately cannot help more than that !
Next step is to code it 🙂
(again, at my best knowledge)
Hugo
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.