[vtk-developers] How to do Next and Prevous frame in VTK python

JohnR johnrim20 at gmail.com
Fri Sep 5 07:55:11 EDT 2014


Hello,

I am doing a program  which should able to do
Next frame and previous frame on button clicks. I have added
a sphere vtk object in render window as an actor. Don't understand
frame functionality and how to do previous and Next frame. I am able to do
set positions but I don't think it can achieve the frame functionality out 
of this
could anyone please help me or share a sample code for this?
Please note my code below

I am using Tkinter python with VTK

[code]

    def sphere_render(cone_Obj,obj_renwin):

        
        obj_renwin.sphereSource = vtk.vtkSphereSource()              
        obj_renwin.sphereSource.SetRadius(.5)    
        obj_renwin.actor = vtk.vtkActor()
        obj_renwin.mapper = vtk.vtkPolyDataMapper()
       
obj_renwin.mapper.SetInputConnection(obj_renwin.sphereSource.GetOutputPort())
        obj_renwin.actor.SetMapper(obj_renwin.mapper)       
        obj_renwin.prop = obj_renwin.actor.GetProperty()        
        global actor_Status
        actor_Status=obj_renwin.add_actors(obj_renwin.actor)        
        obj_renwin.renwin.Render()
        return obj_renwin.actor

   
    def do_Next_Frame(self,obj_renwin):

       obj_renwin.actor.SetPosition(0, 1, 0)


    def do_Prv_Frame(self,obj_renwin):

        obj_renwin.actor.SetPosition(0.0, 0.0, 0.0)


[/code]



--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-do-Next-and-Prevous-frame-in-VTK-python-tp5728585.html
Sent from the VTK - Dev mailing list archive at Nabble.com.


More information about the vtk-developers mailing list