[vtkusers] VRML orientation problem

bthomas bthomas at engineering.uiowa.edu
Thu Apr 25 12:28:49 EDT 2002


I am working on a program written in python using VTK.  I have successfully 
saved VRML files using the VRMLexproter and I can import them using the 
VRMLimporter.  The problem is the orientation saves to the file correctly but 
I can't get my application to read it.  My code is:

opener = vtk.vtkVRMLImporter()
opener.SetRenderWindow(self.renWin)
opener.SetFileName(filename)
opener.Read()

# the importer created the renderer
renCollection = self.renWin.GetRenderers()
renCollection.InitTraversal()
ren = renCollection.GetNextItem()

#get actors from the VRML file
actCollection = ren.GetActors()
actCollection.InitTraversal()

for n in range(actCollection.GetNumberOfItems()):
            act = actCollection.GetNextItem()
            print act.GetOrientationWXYZ()
	    print act.GetOrientation()

These print statements print:
(0.0, 0.0, 0.0, 1.0)
(0.0, 0.0, 0.0)
which is incorrect because the rotation of the VRML file reads: 
rotation 0.878868 -0.458779 -0.130815 1.99451

Everything else imports fine.  Thanks for any suggestions.

Benjamin Thomas




More information about the vtkusers mailing list