[vtkusers] how to use the renWin Erase ...please HELP ME!! :(

german german_leung at hotmail.com
Thu Dec 28 01:28:53 EST 2000


Dear all vtk user:
I want to move the object (cutActor) to the new position such as (cutActor SetPosition 2 2 2) but I want to keep the old image on the screen such as (2 2 1). How can I use the renWin EraseOff?
The following is my code:--
# Create the RenderWindow, Renderer and both Actors
#
vtkRenderer ren
vtkRenderer ren1
vtkRenderWindow renWin
    renWin AddRenderer ren
 renWin AddRenderer ren1
vtkRenderWindowInteractor iren
    iren SetRenderWindow renWin

#input the hipjoin image
vtkSTLReader hip
    hip SetFileName $VTK_DATA/ballJoint60.stl
vtkPolyDataNormals normals
    normals SetInput [hip GetOutput]
vtkPolyDataMapper   hipMapper
    hipMapper SetInput [normals GetOutput]
vtkLODActor hipActor
    hipActor SetMapper hipMapper
eval [hipActor GetProperty] SetColor 1 0 0

#vtkOutlineFilter outline
    #outline SetInput [normals GetOutput]
#vtkPolyDataMapper mapOutline
    #mapOutline SetInput [outline GetOutput]
#vtkActor outlineActor
    #outlineActor SetMapper mapOutline
    #[outlineActor GetProperty] SetColor 0.9 0 0


hipActor SetOrigin 0 0 0
hipActor RotateX -90
hipActor SetPosition 0 2.73 2.244

#input the cutter1 image
vtkSTLReader cut
    cut SetFileName $VTK_DATA/cutter1.stl
vtkPolyDataNormals normal
    normal SetInput [cut GetOutput]
vtkPolyDataMapper   cutMapper
    cutMapper SetInput [normal GetOutput]
vtkLODActor cutActor
    cutActor SetMapper cutMapper
cutActor SetOrigin 0 0 0
cutActor RotateX -90
cutActor SetPosition 0 10 0
# Add the actors to the renderer, set the background and size
#
renWin EraseOff
ren AddActor hipActor
ren1 AddActor cutActor
#ren AddProp outlineActor
ren SetBackground 0.1 0.2 0.4
renWin SetSize 600 600

#vtkCubeAxesActor2D axes
    #axes SetProp hipActor
    #axes SetCamera [ren GetActiveCamera]
    #axes SetLabelFormat "%6.3g"
    #axes ShadowOff
    #axes SetFlyModeToOuterEdges
   #axes SetFlyModeToClosestTriad
    #axes SetFontFactor 1.5
    #[axes GetProperty] SetColor 1 1 1
#ren AddProp axes 
#vtkCubeAxesActor2D axes1
    #axes1 SetProp cutActor
    #axes1 SetCamera [ren GetActiveCamera]
    #axes1 SetLabelFormat "%6.3g"
    #axes1 ShadowOff
    #axes1 SetFlyModeToOuterEdges
   #axes1 SetFlyModeToClosestTriad
    #axes1 SetFontFactor 1.1
    #[axes1 GetProperty] SetColor 1 1 1
#ren AddProp axes1 

# render the image
#
iren SetUserMethod {wm deiconify .vtkInteract}
set cam1 [ren1 GetActiveCamera]
$cam1 Zoom 1.1
iren Initialize

#renWin SetFileName "ballJoint50.stl.ppm"
#renWin SaveImageAsPPM

# test regeneration of the LODMappers
# stlActor Modified

 

# prevent the tk window from showing up then start the event loop
wm withdraw .
#
--------------------------------------
But the image can not move properly......please HELP ME!!  

Thank for any advise
German Leung :(
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20001228/e4719359/attachment.htm>


More information about the vtkusers mailing list