|
|
Mahalis wrote:
>
> Could anyone explain to me exactly how one uses the trace() function to
> detect object collisions? The docs say that 'trace() can be used to detect
> the exact point a ray intersects a surface' and then gives a perfectly
> incomprehensible (to me at least) example.
>
You will find une in the insert menu:
// trace function tests for intersection with a specified object
#declare Obj = sphere { 0, 1 }
#declare Norm = <0, 0, 0>;
#declare Start = <0.5, 0.5, 1>;
#declare Pos = trace (
Obj, // object to test
Start, // starting point
-z, // direction
Norm ); // normal
// if intersection is found, normal differs from 0
#if (Norm.x != 0 | Norm.y != 0 | Norm.z != 0)
//...
#end
Christoph
--
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other
things on: http://www.schunter.etc.tu-bs.de/~chris/
Post a reply to this message
|
|