POV-Ray : Newsgroups : povray.newusers : Shoot a ray at a mesh : Re: Shoot a ray at a mesh Server Time
28 Jul 2024 16:19:52 EDT (-0400)
  Re: Shoot a ray at a mesh  
From: Kenneth
Date: 7 Jun 2008 13:10:01
Message: <web.484abf7e784caf0d78dcad930@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> "daviddoria" <nomail@nomail> wrote in message
> news:web.4849a25ff5d589ac145cec320@news.povray.org...

> #declare MyStart = <1, 1, 1>;
> #declare MyDirection =  <0, 0, 0> - MyStart;

The resulting MyDirection vector in this case would be <-1,-1,-1>...kind of an
odd direction in which to shoot a trace ray, *assuming* that the mesh occupies
some area on an x/z plane...i.e., horizontal. Far better would be to shoot the
trace ray straight 'down.'

Let's assume that the mesh extends from <0,0,0> to <1,0,1>--like a POV-Ray
height_field. Would it not be better to say
#declare MyStart =
<*some value between 0 and 1*,100,*some value between 0 and 1*>; // y is just an
// arbitrary large number, to place it well above the mesh

#declare MyDirection = <0,-1,0>; // pointing straight down

OR
#declare MyDirection = <0,0,0> - <0, MyStart.y,0>; // using dot notation to pick
// one value out of a vector

OR
#declare MyDirection = <0, -MyStart.y,0>;

These three MyDirection's all all equivalent...but <0,-1,0> is far easier to
write!

Ken W.


Post a reply to this message

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