[vtkusers] Translation and scaling

Paul Tait paul at opes.com.au
Mon Dec 22 02:32:37 EST 2003


Prolem solved

used SetOrigin()


----- Original Message ----- 
From: "Paul Tait" <paul at opes.com.au>
To: <vtkusers at vtk.org>
Sent: Monday, December 22, 2003 12:58 PM
Subject: [vtkusers] Translation and scaling


> Hi All
>
> Well my last post didn't get any takers so I'll try a different tack
>
> my data has the following range
>
> Bounds:
> Xmin,Xmax: (545700, 549900)
> Ymin,Ymax: (9.96e+006, 9.9656e+006)
> Zmin,Zmax: (-6138, -5455)
>
> I would like to translate (I think thats the correct term) the data so
that
> it sits around the 0,0,0 origin. I need this so when I Scale() my data in
> the Z axis it increases uniformly above and below the origin and gives me
an
> exagerrated or bumpier surface
>
> I'm trying
>
> float bounds[6];
> Threed->GetBounds(bounds);
> vtkTransform *trans = vtkTransform::New();
> trans->Translate(-(bounds[0] + (bounds[1] - bounds[0]) / 2),
>                             -(bounds[2] + (bounds[3] - bounds[3]) / 2),
>                             -(bounds[4] + (bounds[5] - bounds[4]) / 2));
>
> prop->SetUserTransform(trans);
>
> I've also tried
>
> prop->AddPosition(-(bounds[0] + (bounds[1] - bounds[0]) / 2),
>                              -(bounds[2] + (bounds[3] - bounds[3]) / 2),
>                              -(bounds[4] + (bounds[5] - bounds[4]) / 2));
>
> but I'm not getting the same effect as I used to when I adjusted my source
> data before adding it to the various vtk objects I use
>
> Thanks Paul
>
> _______________________________________________
> 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://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list