[vtkusers] Changing the direction of Z
Jim Peterson
jimcp at cox.net
Sat Oct 23 10:59:53 EDT 2010
Paul Harris wrote:
>
>
> On 19 October 2010 06:31, Jim Peterson <jimcp at cox.net
> <mailto:jimcp at cox.net>> wrote:
>
> Paul Harris wrote:
>
>
> My models do not have any particular handedness, ...
>
> all 3D models have a "handedness" Right handed says the positive
> Y axis is a 90degree rotation counter clockwise from the positive
> X axis, the positive Z axis is 90 degrees counter clockwise from
> the X/Y plane along the Y positive axis. "Left handed" is the
> same rule with "counter clockwise" replaced with "clockwise". you
> trasnform between the two by either reversing the direction of Z
> or exchanging X and Y.
>
>
> Ok well in that case, some of the models I view are right-handed, some
> are left-handed. I need to support both.
> I might have no choice but to insist on whatever VTK is happy with.
Paul,
the essential problem here is the input polydata (at whatever point that
exists is the manifestation in the current world coordinate system of
the objects represented by the numbers generated by the original
coordinate system. The vtkPolyDataFilter is designed to adjust all model
related aspects of the poly data, it needs to be applied to the poly
data, not the actor. My reasoning is multiple input objects, some right
handed, some left handed, may be processed as inputs to the same mapper
or actor. So in my Java reinterpretation of your program, the dark
surface problem is resolved by applying the vtkPolydata filter to the
output of the cone source, and using the output of the filter in the
mapper.... as:
....
vtkTransformPolyDataFilter xffilt = new
vtkTransformPolyDataFilter();
vtkTransform xform = new vtkTransform();
xform.Identity();
xform.Translate(2,0,0);
xform.Scale(-1,1,-1);
xffilt.SetInput(conef.GetOutput());
xffilt.SetTransform(xform);
coneMapperf.SetInput(xffilt.GetOutput());
....
I also made sure the black object was visible by setting the renderer
background to a tasteful blue....
ren.SetBackground(0.1, 0.2, 0.4);
I believe we would have to class this issue as incorrect pipeline usage,
not a bug.
HTH,
Jim
More information about the vtkusers
mailing list