|
 |
William F Pokorny <ano### [at] anonymous org> wrote:
>
> Adding to that:
>
> //---
> #version 3.7;
>
> #declare V = <1,2,3>;
> #declare OBJ = torus { 5,1 }
>
> // #declare F = function { inside(OBJ, V) }
> #declare F = function { pattern { object { OBJ } } }
>
> plane { -z, 0
> pigment { function { F(x,y,z) } }
> finish { emission 1 }
> }
So, by moving the z plane in increments-- as 2-D slices-- we get a nice *visual*
representation of which parts of the torus are 'inside' or 'outside'.
But can the V vector here still be used in some way-- with the object
*function*-- to determine if that particular point is inside/outside? (I admit
that I have trouble understanding some of the subtleties and limitations of
function use.)
I tried two naive tests, but both resulted in fatal parse errors for one reason
or another:
1) As a purely visual test, to see if the plane object would appear either fully
white or fully black:
plane { -z, 0
pigment { function { F(V.x,V.y,V.z) } }
finish { emission 1 }
}
2)
#if(inside(F(x,y,z),V))
// -- do something--
#else
#end
In one of the old posts mentioned previously (from 2010), Thorsten posted the
following...although I might be taking his remarks out of context:
> As you can see, "inside" is not in the list of built-in functions for use in
> "function" statements.
>
> However, you can still access an object inside a function by using the object
> pattern. This works because you can declare pattern functions...
I'm not sure what 'access' means... but does it imply that there *is* a way to
use the V vector in the example here?
Post a reply to this message
|
 |