[vtkusers] vtkassembly

Jim Peterson jimcp at cox.net
Mon Sep 6 11:25:14 EDT 2010


Denis Martin wrote:
>
> Dear VTK users,
>
>  
>
> i need some sample or explanation about using of vtkassembly.
>
> Even some sample or explanation about parent- child vtkobject.
>
>  
>
> If somebody can help.
>
>  
>
> Thank you
>
>  
>
>  
>
> Denis
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>   
Denis,
Your program is going to define the hierarchy for the movement. All vtk 
is going to do is provide tools to build the hierarchy with.
The vtkAssembly itself is a mechanism for associating one transform rule 
with a set of vtkProp3D Objects. The same object can belong to more than 
one assembly, so this can be a tool for establishing the kind of 
hierarchy you describe. each vtkProp3D objects can be a set of 
vtkPolydata objects created from some source like stl files or fixed 
initial program data.  So assuming you had three stl defined segments ( 
Arm, Forearm and Hand), and a way for identifying the point of rotation 
for each of those elements. we get the Arm rotated at the Shoulder, the 
Forearm rotated at the Elbow, and the Hand rotated at the Wrist. you 
might have three vtkAssembly objects for the respective motions 
(ShoulderMoves, ElbowMoves and WristMoves). ShoulderMoves would have the 
objects Arm Forearm and Hand added to it. ElbowMoves assembly would have 
Forearm and Hand, WristMoves assembly would have Hand. Assuming the 
initial position of this arm lies along the x axis, we would would allow 
specification of the shoulder to rotate to some range in all three axes. 
the elbow would probably only have rotation around the y axis, the wrist 
would probably have rotation around the x and z axes. 

To animate this limb, you would likely apply the WristMoves, then the 
ElbowMoves, then the ShoulderMoves transforms to the original data.

You will probably want to do the Examples/Tutorial in your preferred 
language to just get started with vtk. Then after the initial exercises, 
add some points (you joints) lines (line segment cells connecting the 
joint points)  and use the tube filter to create a stick figure to work 
out the animation.

Hope that helps,
Jim



More information about the vtkusers mailing list