|
|
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
Post a reply to this message
|
|
|
|
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
|
|
|
|
On Sat, 12 Jul 2003 16:20:30 -0600, "Kevin Loney" <kev### [at] ekoikcom> wrote:
> does someone have the calculations neccesary for determining wherther a
> point is within the fov given the location of the point and all the
> information regarding the camera?
You can use http://news.povray.org/povray.text.scene-files/23663/ for
calculating coordinates on screen. If coordinates returned from Vector_To_Screen
macro are outside <-.5,-.5>-<.5,.5> then original vector is outside fov.
ABX
Post a reply to this message
|
|