[vtkusers] newbie question on GetActiveCamera

fred fred at redcloud.scd.ucar.edu
Thu Nov 1 14:27:04 EST 2001


I recently bought the book "Visualization Toolkit User's Guide"
and installed the software on an SGI from the disc enclosed
in the book.

In looking at the Python example Cone.py (included below) I
get a quite different result if I simply insert the line

cam = ren.GetActiveCamera()

after the line

ren = vtkRenderer()

Inserting this line results in an apparent zoom effect.  Also,
it seems to change the clipping planes.  I do not understand
why the insertion of the inquiry should affect the output.

Thanks,

Fred Clare

---------------------------------------------
Fred Clare     fred at ucar.edu     303-497-1284
Visualization & Enabling Technologies Section
NCAR Scientific Computing Division
---------------------------------------------

Source for Cone.py:

#!/usr/local/bin/python
import os
try:
  VTK_DATA = os.environ['VTK_DATA']
except KeyError:
  VTK_DATA = '../../../vtkdata/'

from libVTKCommonPython import *
from libVTKGraphicsPython import *

# create a rendering window and renderer
ren = vtkRenderer()
renWin = vtkRenderWindow()
renWin.AddRenderer(ren)

iren = vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)

# create an actor and give it cone geometry
cone = vtkConeSource()
cone.SetResolution(8)
coneMapper = vtkPolyDataMapper()
coneMapper.SetInput(cone.GetOutput())
coneActor = vtkActor()
coneActor.SetMapper(coneMapper)

# assign our actor to the renderer
ren.AddActor(coneActor)

# enable user interface interactor
iren.Initialize()

iren.Start()



More information about the vtkusers mailing list