enthought / mayavi

3D visualization of scientific data in Python
http://docs.enthought.com/mayavi/mayavi/
Other
1.3k stars 284 forks source link

tvtk actor rotate_wxyz not working as expected #1136

Closed ninaleechie closed 2 years ago

ninaleechie commented 2 years ago

I have an sphere created with: sphere_actor = tvtk.Actor(mapper=sphere_mapper, texture=texture, orientation=(0, 0, 90))

it wraps an image of the moon around a sphere. This looks good. I place it in space using: sphere_actor.position = (384400000, 0, 0) then I try to rotate it in space using: sphere_actor.rotate_wxyz(45, 0, 0, 1) this only rotates the sphere about its own axis just as sphere_actor.rotate_z(45) does. It does not move it in space. Did I misinterpret how this method works?

prabhuramachandran commented 2 years ago

This is not really a TVTK issue, you will need to look at https://vtk.org/doc/nightly/html/classvtkProp3D.html to see what you can do. TVTK is just wrapping the functions of the underlying VTK object. You may also find some useful examples here: https://kitware.github.io/vtk-examples/site/