[vtk-developers] Potential Change to Viewport Coordinates

David Gobbi david.gobbi at gmail.com
Tue Aug 25 13:09:40 EDT 2015


Hi Ken,

This change looks good. OpenGL defines the viewport as going from (0, 0,
winWidth, winHeight) in display coords, and the definition of Normalized
Viewport Coordinates should follow naturally from that.

Also, using pixel centers doesn't work well if you want your displays to be
resolution-independent.  Consider retina displays, for example: they take
the original pixel, and divide it into four.  This causes the centers of
the pixels at the outer corners of the viewport to shift.  But if
everything is computed relative to the outside corners of those corner
pixels, then dealing with different resolutions is no big deal.

I'm guessing that this change should have no impact on most users, because
users generally stick to WorldCoords and DisplayCoords.

 - David


On Tue, Aug 25, 2015 at 8:44 AM, Ken Martin <ken.martin at kitware.com> wrote:

> So there is an odd issue with normalized viewport coordinates that has
> been around for a long time. If you draw a rectangle from 0.0 to 1.0 I
> would expect it to completely cover the viewport. But currently it is
> logically missing a half pixel on the left and right/top and bottom. See
> the picture below of what is happening given a small four pixel window.  I
> seem to recall we originally wanted pixels to be based on their centers and
> then later as we added more coordinate systems realized we had an issue but
> left it as it was. The idea here would be to make viewport coordinates(and
> normalized VPC) behave like display coordinates with a left corner origin.
> The only difference between them and display coordinates would be that they
> are relative to their viewport.  This change would require about 15 updated
> valid images as some labels move a tad here and there. Thoughts?
>
>
>
>
>
>
>
> Ken Martin PhD
>
> Chairman & CFO
>
> Kitware Inc.
>
> 28 Corporate Drive
>
> Clifton Park NY 12065
>
> ken.martin at kitware.com
>
> 919 869-8871 (w)
>
>
>
>
>
> This communication, including all attachments, contains confidential and
> legally privileged information, and it is intended only for the use of the
> addressee.  Access to this email by anyone else is unauthorized. If you are
> not the intended recipient, any disclosure, copying, distribution or any
> action taken in reliance on it is prohibited and may be unlawful. If you
> received this communication in error please notify us immediately and
> destroy the original message.  Thank you.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150825/7d6ee430/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 17921 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150825/7d6ee430/attachment-0001.png>


More information about the vtk-developers mailing list