POV-Ray : Newsgroups : povray.advanced-users : Calculate distance between point and viewport : Re: Calculate distance between point and viewport Server Time
19 May 2024 14:21:22 EDT (-0400)
  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.


> 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-2023 Persistence of Vision Raytracer Pty. Ltd.