|
![](/i/fill.gif) |
Greg M. Johnson <gre### [at] my-dejanews com> wrote:
: 1) a plane at y=1.000 with its normal 'up'
I think that the function is defined so that everything point for which
f(x,y,z) < 0 is inside the surface while every point for which f(x,y,z) > 0
is outside the surface. Every point for which f(x,y,z) = 0 is exactly on
the surface (assuming, of course, that 'threshold' is 0).
So when a normal of a plane is 'up', it's defined that 'up' is outside
the plane and 'down' is inside the plane. Thus, we need to formulate the
function so that for every point "below" the surface f(x,y,z) < 0. And
since we want the surface to be at y=1, it would be:
f(x,y,z) = y-1
If you think about it, what we did was just moving all the items in
the equation "y=1" to the same side of the equation.
Now the surface is defined as "y-1 = 0". Every point below this will
be < 0 (for example if y=0 then 0-1 < 0).
: 2) a plane at y=0.999 with its normal 'down'
Again, we can move all the terms to the same side of the equation, so
we get:
f(x,y,z) = y-.999
However, here 'outside' is still 'up'. So we need to make it the other
way around. Now every point that has the y bigger than .999 has to be inside
instead of outside like in the above function.
That's easy: Just change the sign of the function:
f(x,y,z) = -y+.999
or in other words:
f(x,y,z) = .999-y
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |