POV-Ray : Newsgroups : povray.general : visibility : Re: visibility Server Time
4 Aug 2024 06:18:43 EDT (-0400)
  Re: visibility  
From: Chris Amshey
Date: 13 Jul 2003 15:50:01
Message: <web.3f11b716ce84657e61b99e900@news.povray.org>
Kevin Loney wrote:
>not quite what I'm looking for. probably should have said viewing frustum
>instead of fov
>
>Kevin
>http://www.geocities.com/qsquared_1999/
>#macro _(r)#if(r<12)#local i=asc(substr(
>"oqshilacefg",r,1))-97;disc{<mod(i,7)-3,
>div(i,7)-1,6>,z,.4pigment{rgb 10}}_(r+1)
>#end#end _(1)//KL
>

It should work out with the same math, though if the camera isn't pointing
along
an axis you'll need to work harder, but all the basic formulae are there for
figuring it out. The problem is just phrased differently in this case, but
fundamentally 'is point P inside this shape' is solvable from 'how wide is
this
shape at distance D' ... ie, the formula for describing the shape is there.
Between the location of the camera, the direction of the camera, and the
viewing rectangle at distance D, you can find the four lines that border the
fustrum, and from four lines you just check if P is between them.

 I may make some macros for this later, but right now I'm busy
with getting some cylinders to touch tangentially (which I can do when they
are
outside each other but not when one is inside the other... have to
double-check
my math, obviously.)

--Chris


Post a reply to this message

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