[vtkusers] Using vtkLineSource as guide for imported 3D object

Sebastien Jourdain sebastien.jourdain at kitware.com
Wed May 1 08:52:04 EDT 2013


Hi Enzo,

you can not bind 2 objects together the way you want without extra
computation...
You need to basically from the line source that you move, figure out the
orientation and position (I think you don't scale the line) and then apply
the transformation that needs to happen to your STL object in the 3D world
so it could follow that line.

The way to link the line source and the transformation on the vtkActor of
your STL model could be by using vtkObserver, although depending on how you
change the line position, you can trigger the transformation update
yourself without linking the 2 objects together.

Hope it is getting clearer,

Seb




On Tue, Apr 30, 2013 at 5:11 PM, Enzo Matsumiya <enzo.ferlin at micromar.eng.br
> wrote:

> Well, I was denied to post the pictures of our STL model here, but I'll
> try to explain it better:
>
> - Imagine I have a simple cylinder that is in a STL file;
> - And I have a rendered vtkLineSource;
> - I import the STL file and bind its contents to the LineSource, so that
> every change I make *to the LineSource*, will change the imported STL in
> the same way.
> - And then I would set the LineSource's alpha to 0 (for eyecandy), but I
> would still be modifying it,, allowing me to bind any other STL model to
> that line
>
> Sebastien,
>
> > In order to handle such use case, you would attach listener to the
> LineSource so you could manually compute the transformation of your STL
> data and update the transformation matrix of its actor automatically.
>
> I'm a layman, I don't understand what you're saying here :( but I really
> appreciate your reply.
>
>
> Thanks again!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130501/a3b4522a/attachment.htm>


More information about the vtkusers mailing list