[vtkusers] Changing the direction of Z
Bill Lorensen
bill.lorensen at gmail.com
Sat Oct 16 23:11:30 EDT 2010
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
>>> >> >
>>> >> >
>>> >
>>> >
>>
>>
>
More information about the vtkusers
mailing list