[vtkusers] Changing the direction of Z

Paul Harris harris.pc at gmail.com
Sun Oct 17 08:50:49 EDT 2010


The models and other data points are usually in a East,North,Elevation
coordinate system, but often some datasets will be in a West,South,Depth or
some variant in between, due to legacy reasons.

I would like to be able to just flick a switch and have everything displayed
the "right way" around, however if its going to involve
vtkTransformPolyData, what I might be forced to do is flip everything around
at the point of importing/loading the data, and then flip the numbers around
again when I display grids, coordinates and stuff in tables...

However it would be ideal if I could just tell VTK which way around the
world coordinates are, without worrying about normals pointing the wrong way
etc.

On 17 October 2010 11:11, Bill Lorensen <bill.lorensen at gmail.com> wrote:

> The vtk coordinate system is right-handed. Are your models in a left
> handed system?
>
> On Sat, Oct 16, 2010 at 11:10 PM, Bill Lorensen <bill.lorensen at gmail.com>
> wrote:
> > Yes, user matrix should work. But a negative scale will mess up the
> > shading calculation. The user matrix is used by opengl. Not sure why
> > reverse sense did not work.
> >
> > Try the same thing (as an experiment) with vtkTransformPolyData.
> >
> > On Sat, Oct 16, 2010 at 7:46 PM, Paul Harris <harris.pc at gmail.com>
> wrote:
> >> On 16 October 2010 21:25, Bill Lorensen <bill.lorensen at gmail.com>
> wrote:
> >>>
> >>> You can use the vtkTransformPolyDataFilter
> >>>
> >>
> >> That will make a copy of the points and then adjust all the values,
> right?
> >>
> >> There is quite a lot of points to plot, I was hoping to use an approach
> that
> >> wouldn't involve using more memory.
> >>
> >> Earlier, I tried this approach:
> >> vtkTransform * flipform = vtkTransform::New();
> >> flipform->Identity();
> >> flipform->Scale(1,1,-1);
> >> actor_flip->SetUserMatrix( flipform->GetMatrix() );
> >>
> >> And that worked find *except* that all of the surfaces look dark, as if
> they
> >> are facing away from the camera.
> >>
> >> I looked around and tried adding vtkReverseSense to the chain, but that
> >> didn't make any difference at all.
> >>
> >> Should I be able to use SetUserMatrix?
> >>
> >>
> >>
> >>>
> >>> On Sat, Oct 16, 2010 at 9:06 AM, Paul Harris <harris.pc at gmail.com>
> wrote:
> >>> > The models themselves.   Flipping the ViewUp seems to be the same as
> >>> > turning
> >>> > the monitor upside down, but that is not the result I want.
> >>> > The problem is that Z in model coordinates is "downwards", but vtk
> seems
> >>> > to
> >>> > insist that Z is "upwards".
> >>> > This problem is not just for Z either,
> >>> > I also have the situation where in some circumstances, the Y should
> >>> > point
> >>> > the other way.   ie, Y means South rather than North.
> >>> >
> >>> >
> >>> > On 16 October 2010 03:32, Bill Lorensen <bill.lorensen at gmail.com>
> wrote:
> >>> >>
> >>> >> Do you want the models flipped, or just the view of the models?
> >>> >>
> >>> >> If it is the latter, you can set the ViewUp of the camera to 0,0,-1.
> >>> >>
> >>> >>
> >>> >> On Fri, Oct 15, 2010 at 3:17 PM, Paul Harris <harris.pc at gmail.com>
> >>> >> wrote:
> >>> >> > Hi all,
> >>> >> >
> >>> >> > I have a VTK scene with some vtkPolyDataMappers and actors, plus
> an
> >>> >> > orientation widget.
> >>> >> >
> >>> >> > I want to change the fundamental direction of the Z axis, so that
> it
> >>> >> > points
> >>> >> > down rather than up.  I want all of the models, the orientation
> >>> >> > widget,
> >>> >> > etc
> >>> >> > to flip, so that they point down instead of up.
> >>> >> >
> >>> >> > I've tried lots of things but have gotten nowhere...
> >>> >> >
> >>> >> > how do I make this happen?
> >>> >> >
> >>> >> > thanks
> >>> >> > Paul
> >>> >> >
> >>> >> >
> >>> >> >
> >>> >> > _______________________________________________
> >>> >> > 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
> >>> >> >
> >>> >> >
> >>> >
> >>> >
> >>
> >>
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101017/3c49a457/attachment.htm>


More information about the vtkusers mailing list