POV-Ray : Newsgroups : povray.newusers : Distance to a spline from a camera Server Time
4 Nov 2024 21:22:32 EST (-0500)
  Distance to a spline from a camera (Message 1 to 3 of 3)  
From: Bathurstfreak
Subject: Distance to a spline from a camera
Date: 12 Oct 2004 08:00:00
Message: <web.416bc643209a174ab2d60bc10@news.povray.org>
Still working on my first animation, a vehicle travelling around a track, so
how do I measure the distance between a point on a spline and the camera?
(distance needed to set the appropriate viewing angle of the camera to make
sure the car takes up the right amount of frame at all times. This task
done using atan and other trig functions)

Current animation
www.maelstromcreations.com/bathurst/mpegs/basicvideo.wmv

James


Post a reply to this message

From: Tim Nikias
Subject: Re: Distance to a spline from a camera
Date: 12 Oct 2004 08:27:26
Message: <416bcdae@news.povray.org>
Well, just subtract the position from the camera's location, slap a
vlength(...) around it, and the resulting float is the distance in POV-Units
from position to location. An example:

#declare Camera_Location = <0,5,10>;
camera{location Camera_Location look_at <0,0,0>}

#declare Position = <4,6,12>;

#declare Distance = vlength(Camera_Location-Position);

Nice animation for a beginner, though the car is a little jerky at the
curves...

Regards,
Tim

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: Bathurstfreak
Subject: Re: Distance to a spline from a camera
Date: 12 Oct 2004 08:45:00
Message: <web.416bd13aa8b59355b2d60bc10@news.povray.org>
Cheers, works beautifully

"Tim Nikias" <JUSTTHELOWERCASE:timISNOTnikias(at)gmx.netWARE> wrote:
> Well, just subtract the position from the camera's location, slap a
> vlength(...) around it, and the resulting float is the distance in POV-Units
> from position to location. An example:
>
> #declare Camera_Location = <0,5,10>;
> camera{location Camera_Location look_at <0,0,0>}
>
> #declare Position = <4,6,12>;
>
> #declare Distance = vlength(Camera_Location-Position);
>
> Nice animation for a beginner, though the car is a little jerky at the
> curves...
>
> Regards,
> Tim
>
> --
> "Tim Nikias v2.0"
> Homepage: <http://www.nolights.de>


Post a reply to this message

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