[vtkusers] Aligning a cylinder between two points

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Thu Aug 29 18:52:04 EDT 2002


If you can't be bothered to do the sums to work out the end points, cheat...

use a vtkLineSource. Put the ends where you want them. Then run the output through a tube filter!

JB


----- Original Message ----- 
From: "Tarjei Knapstad" <tarjeik at chemcon.no>
To: "VTK Users" <vtkusers at public.kitware.com>
Sent: Thursday, August 29, 2002 10:44 PM
Subject: [vtkusers] Aligning a cylinder between two points


> Hi.
> I've got a bit of a tranformation/rotation problem at hand. I want to
> draw a cylinder where the top and bottom are aligned to two points,
> p1=(x0, y0, z0) and p2=(x1, y1, z1), something like:
> 
>       ---------
>   p1 -> |       | <- p2
>       --------- 
> 
> I'm using a vtkCylinderSource, vtkPolyDataMapper, and a vtkActor
> 
> I'm a bit new to 3D visualization in Vtk, so have me excused if this is
> completely trivial, but my attempts so far have miserably failed in one
> way or another. Could anyone give me a solution/hints to how to obtain
> this in Vtk?
> 
> Regards,
> Tarjei
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers




More information about the vtkusers mailing list