|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
The function that calculates the cells pattern is as follows:
static DBL cells_pattern (VECTOR EPoint)
{
int temp;
DBL tf;
temp = POV_GET_OLD_RAND(); /* save current seed */
/* select a random value based on the cube from which this came. */
/* floor the values, instead of just truncating - this eliminates
duplicated cells
around the axes */
POV_SRAND(Hash3d((int)floor(EPoint[X]+Small_Tolerance),
(int)floor(EPoint[Y]+Small_Tolerance),
(int)floor(EPoint[Z]+Small_Tolerance)));
tf = FRAND();
POV_SRAND(temp); /* restore */
return min(tf, 1.0);
}
Why is Small_Tolerance being added to EPoint? That just offsets the pattern
by a little bit. What's the point?
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Slime wrote:
>
> The function that calculates the cells pattern is as follows:
>
> static DBL cells_pattern (VECTOR EPoint)
> {
> int temp;
> DBL tf;
>
> temp = POV_GET_OLD_RAND(); /* save current seed */
>
> /* select a random value based on the cube from which this came. */
>
> /* floor the values, instead of just truncating - this eliminates
> duplicated cells
> around the axes */
>
> POV_SRAND(Hash3d((int)floor(EPoint[X]+Small_Tolerance),
> (int)floor(EPoint[Y]+Small_Tolerance),
> (int)floor(EPoint[Z]+Small_Tolerance)));
>
> tf = FRAND();
>
> POV_SRAND(temp); /* restore */
>
> return min(tf, 1.0);
> }
>
> Why is Small_Tolerance being added to EPoint? That just offsets the
> pattern by a little bit. What's the point?
Probably so that when the cell border is coincident with the surface
being textured there will be no speckling. This would be the case if
it was applied to a plane facing along a coordiante axis at an
integral distance from the origin.
Regards,
John
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Probably so that when the cell border is coincident with the surface
> being textured there will be no speckling. This would be the case if
> it was applied to a plane facing along a coordiante axis at an
> integral distance from the origin.
Oooh. Good point.
The annoying thing is, when applied to a box from <0,0,0> to <1,1,1>, the
very edges of the box are in different cells than the rest of the faces that
they belong to.
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|