[vtkusers] Re: How can I change the Y local axe to a specified direction?

Scott J. Pearson scottjp at CLEMSON.EDU
Tue May 10 15:36:14 EDT 2005


The most useful way to achieve something like this is by a transformation.
For example, if you have a vtkUnstructuredGrid ugrid_, the following code
would allow you to transform.

vtkTransform *ugridTransform = vtkTransform::New();
ugridTransform_->Identity();
ugridTransform_->Scale(1.0, -1.0, 1.0);    // reverses y-axis
// you could do other functions, but I'll let you read the API

vtkTransformFilter *ugridFilter_ = vtkTransformFilter::New();
ugridFilter_->SetTransform(ugrid_Transform_);
ugridFilter_->SetInput(ugrid_);

scalmapper_->SetInput(ugridFilter_->GetOutput());
...


You can stretch, reverse, contort, etc. data sources like this.

I believe that you can also change the matrix of the viewport to achieve
various translations upon all of your actors, but I don't have any
experience with such matters. Just look for the associated matrix and see
how you could modify it.

Scott





More information about the vtkusers mailing list