POV-Ray : Newsgroups : povray.general : About the unit : Re: About the unit Server Time
5 Aug 2024 04:22:38 EDT (-0400)
  Re: About the unit  
From: Christopher James Huff
Date: 27 Nov 2002 13:46:20
Message: <chrishuff-88C488.13433627112002@netplex.aussie.org>
In article <3de4eb79$1@news.povray.org>,
 "Sir Charles W. Shults III" <aic### [at] cflrrcom> wrote:

>     If you know where your camera is in POVray (in coordinates or units) and 
> you also know where your object is, the distance is sqrt( (x2 - x1)^2 
> + (y2 - y1)^2 + (z2 - z1)^2 ), the old and venerable Pythagorean 
> theorem.
>     <x1, y1, z1> should be your camera location, and <x2, y2, z2> should be 
> your object location.

vlength(Pt - CamPos) is a bit easier and faster parsing. You only really 
need the Pythagorean equation when you are writing functions. Similar to 
using vrotate() instead of sin() and cos(), or vtransform() or transform 
functions instead of doing the transformations manually.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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