POV-Ray : Newsgroups : povray.general : Possible bug with "frequency" in maps : Re: Possible bug with "frequency" in maps Server Time
2 Aug 2024 06:18:35 EDT (-0400)
  Re: Possible bug with "frequency" in maps  
From: Jellby
Date: 8 Jan 2005 08:26:12
Message: <41dfdf73@news.povray.org>
Among other things, myself wrote:

> It looks like the positive part
> is forced to have a period of 1 unit "superimposed" on whatever other
> period there might be.

That's exactly what's happening. In the source file pattern.cpp we find this
piece of code:

============================
static DBL gradient_pattern (VECTOR EPoint, TPATTERN *TPat)
{
  DBL Result;
  VDot( Result, EPoint, TPat->Vals.Gradient );

  /* Mod to keep within [0.0,1.0] range */
  return ((Result > 1.0) ? fmod(Result, 1.0) : Result);
}
============================

Replacing the last line with "return Result;" fixes the bug with my scene
file.

What's the purpose of this restriction to [0.0 1.0]? Isn't that the job of
the Evaluate_TPat routine (which has another fmod instruction)?
If this further enforcing is needed, shouldn't it be applied to negative
numbers too?

From my limited knowledge of povray innards, this looks to me like a genuine
bug. Is it?

-- 
light_source{9+9*x,1}camera{orthographic look_at(1-y)/4angle 30location
9/4-z*4}light_source{-9*z,1}union{box{.9-z.1+x clipped_by{plane{2+y-4*x
0}}}box{z-y-.1.1+z}box{-.1.1+x}box{.1z-.1}pigment{rgb<.8.2,1>}}//Jellby


Post a reply to this message

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