Script

VTK – adjust the camera

Publication ID: ICY-Q1V9K9

Short Description

This script illustrates how to adjust (some of) the camera parameters in a 3D VTK viewer

Versions

  • Version 1 • Released on: 2015-09-15 10:43:45
    Download
    Description:

    initial version

    // Title: VTK - adjust the camera
    // Author: Alexandre Dufour
    // Description: This is a script for the Icy software
    // that adjusts (some of) the parameters of the camera
    // of an active 3D viewer
    
    
    // Retrieve the active viewer
    viewer = getSequence().getFirstViewer()
    
    // assuming a 3D (VTK) viewer, retrieve the camera
    camera = viewer.getCanvas().getRenderer().GetActiveCamera()
    
    // mess around with it (see www.vtk.org/doc/nightly/html/classvtkCamera.html
    camera.Azimuth(20)
    camera.Roll(10)
    camera.Zoom(1.05)
    
    // refresh the canvas
    viewer.getCanvas().refresh()
    
    
    
    
    

Leave a Review