|
|
> DBL power_pattern ( VECTOR EPoint, TPATTERN* TPat, OBJECT *Object ). This
> new function do the following:
>
> 1 - If EPoing is inside Object return zero, otherwise go on.
> 2 - Apply sampling to find the minimal distanze of EPoint from the surface
> (I've cabled 100 samples at the moment); let's call Mdist this distance.
> 3 - Find the maximum between Object->BBox.Lengths[X],
> Object->BBox.Lengths[Y] and Object->BBox.Lengths[X]; let's call Lmax this
> value.
> 4 - Mdist = Midst / Lmax (in order to have a value in the range 0..1)
> 5 - return (TPat->Vals.Power_Val1 * pow (Mdist, TPat->Vals.Power_Val2) )
I've tested the code. I've modified the signature of power_pattern. Now it
receives INTERSECTION pointer, and not OBJECT. This allow some checks. At
the beginning of power_patern(...) there is the following line:
if (Isection == NULL) return 0;
Now, what it happens is that this line is always executed and so zero is
always assigned to value in Evalutate_TPat .....
So, how could I retreive a reference to OBJECT (it is necessary for
implementing my idea) ???
Post a reply to this message
|
|