Announcement

Collapse
No announcement yet.

Suggestions about how to change camera in order to better view a 3D model

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Suggestions about how to change camera in order to better view a 3D model

    Hy to All,

    I'd like to have some suggestions about this scenario:
    in a 3D view i have many 3D models (such as cones, cubes);
    now, without have a mouse interaction (that is to say without performing a mouse pick action), i'd like to change the 3D viewer camera in order to
    "highlight" a certain 3D model (knowing, for example, its own origin, bounding box center vector and so on).

    Please have You suggestions to perform this my own action?

    Thank You in advance,

    Regards,

    Vincenzo

  • #2
    Hi Vincenzo,
    One solution is to use one of the SoCamera::viewAll() methods.
    You can specify either a node (top of sub-graph containing the model), a path to the model or the bounding box of the model. Get the camera from the viewer using the getCamera() method. Similar to viewAll in a viewer, this method will keep the current camera orientation (view direction) and adjust the camera position so the bounding box of the specified sub-graph is centered and (more or less) fills the viewport.
    -Mike

    Comment


    • #3
      Hi Mike,
      thank You for Your fast reply!

      I'll follow Your suggestions.

      Thank You again.

      Vincenzo

      Comment

      Working...
      X