|
|
Le 18-03-27 à 23:30, Sven Littkowski a écrit :
> Thanks Alain and Stephen. :-)
>
> The item is what is to be checked for (like the name of a Declare union,
> I would assume).
>
> The first coordinate is from where the search ray is starting?
>
> The second coordinate is towards which direction (destination) the
> search ray is heading?
>
> Norm contains the coordinates of a hit?
>
>
> ---
> Diese E-Mail wurde von AVG auf Viren geprüft.
> http://www.avg.com
>
The correct way to use trace with an arbitrary, oddly shaped, target
object is :
#declare Normal =<0,0,0>;
#declare SurfacePoint= trace(<PosX, 1000, PosZ>, -y, Normal);
#if(vlength(Normal))
...do your stuff...
#end
"SurfacePoint" will contain the location of the point directly under
<PosX,1000,PosZ>, or <0,0,0> it the trace miss the object. As a
legitimate point may be at that location, this is not a reliable way to
know if the trace hit or not.
"SurfacePoint" contain the location that interest you.
If the trace miss the target object, Normal have a zero length. If it
find the object, Normal contain the normal of the surface at that point
as an a unit length vector.
Alain
Post a reply to this message
|
|