POV-Ray : Newsgroups : povray.programming : Retrieving OBJECT reference from media, pigment or pattern code ? : Re: Retrieving OBJECT reference from media, pigment or pattern code ? Server Time
30 Apr 2024 00:55:30 EDT (-0400)
  Re: Retrieving OBJECT reference from media, pigment or pattern code ?  
From: Antonio Ferrari
Date: 15 Oct 2007 12:15:00
Message: <web.471391cea5f6d2324e64f15d0@news.povray.org>
> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.