Bug in Updating of vtkAssembly SetOrientation?
Yves Starreveld
ystarrev at julian.uwo.ca
Fri Jul 23 02:01:23 EDT 1999
> Hello all,
> The attached is a hacked Cone.py
> There is one line which is commented out (the GetOrientation)
> If that line is commented out, the actor spins like crazy since there is
> no update of the SetOrientation to 0,0,0 before the rotateY is applied
> (I checked the source).
> If you try the same thing on an actor rather than an assembly, you don't
> need the GetOrientation to update things first.
> Is this a bug? Or should I just be calling update.
> The fact that the behaviour is different for vtkActor rather than
> vtkAssembly leads me to believe it is time for the RAID can.
> Yves
> Yves Starreveld
> Image Guided Surgery Group
> Robarts Research Institute, London, Ontario, Canada
>
> #!/usr/local/bin/python
>
> from libVTKCommonPython import *
> from libVTKGraphicsPython import *
>
>
> # create a rendering window and renderer
> ren = vtkRenderer()
> renWin = vtkRenderWindow()
> renWin.AddRenderer(ren)
> renWin.SetSize(300,300)
> 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)
>
> line = vtkLineSource()
> line.SetPoint1(0,0,0)
> line.SetPoint2(30,0,0)
> lineMapper = vtkPolyDataMapper()
> lineMapper.SetInput(line.GetOutput())
> lineActor = vtkActor()
> lineActor.SetMapper(lineMapper)
>
> assembly = vtkAssembly()
> assembly.AddPart(lineActor)
> assembly.AddPart(coneActor)
> assembly.SetOrigin(0,0,0)
>
> ren.AddActor(assembly)
>
> for i in range(100):
> assembly.SetOrientation(0,0,0)
> assembly.RotateY(45)
> # print assembly.GetOrientation()
> renWin.Render()
>
> iren.Initialize()
>
>
> iren.Start()
> +
-----------------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>. For help, send message body containing
"info vtkusers" to the same address. Live long and prosper.
-----------------------------------------------------------------------------
More information about the vtkusers
mailing list