POV-Ray : Newsgroups : povray.advanced-users : Calculate distance between point and viewport : Re: Calculate distance between point and viewport Server Time
2 Dec 2022 12:01:17 EST (-0500)
  Re: Calculate distance between point and viewport  
From: Bald Eagle
Date: 23 Feb 2020 16:25:00
Message: <web.5e52ed3ddd9dce8e4eec112d0@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:

> No, the first point is somewhere in space and is not connected to the
> camera.
>
>
>
> > Mike Horvath <mik### [at] gmailcom> wrote:
> >> How do I calculate the distance between a point and the camera? Except,
> >> I am using an orthographic camera, so I really need the distance between
> >> a point and the plane formed by the camera's up and right vectors.
> >
> > Or you could use a Graphics Gems macro to actually calculate the shortest
> > (perpendicular) distance between the (transformed) camera point and the
> > (transformed) up-right plane.
> >
> >
>
> The plane doesn't actually have to be the up-right plane exactly, but it
> does need to be parallel to it

OK - that's just the plane equation, IIRC: Ax+By+Cz-D = 0
Also in F. Lohmueller's analytical geometry include file (Insert Menu?)
and you just set the "offset" from the origin with D.
same as you'd do with plane {z, D}

Then you calculate the distance of the point from that plane.

http://news.povray.org/povray.binaries.images/message/%3Cweb.5880fc4d1652a4dcc437ac910%40news.povray.org%3E/#%3Cweb.588
0fc4d1652a4dcc437ac910%40news.povray.org%3E

> and lie somewhere beyond the extents of
> the model.


That's confusing, since usually the image projection plane is "in front of" all
the stuff - between the camera and the "model", not "beyond the extents" of it.

But I think the link gives you exactly what you need.


Post a reply to this message

Copyright 2003-2021 Persistence of Vision Raytracer Pty. Ltd.