POV-Ray : Newsgroups : povray.beta-test : frequency keyword conflict Server Time
29 Jul 2024 16:26:09 EDT (-0400)
  frequency keyword conflict (Message 1 to 4 of 4)  
From: David Necas (Yeti)
Subject: frequency keyword conflict
Date: 24 Mar 2002 08:21:40
Message: <slrna9rkn4.d3i.yeti@monoceros.physics.muni.cz>
Not exactly a bug, but still needs fixing:

The `frequency' keyword is used for two completely different
things
- in colour_maps to specify how many times they should be
  mapped over the [0,1] interval
- in ripples and waves patterns to specify the wave
  frequency

They conflict.  Consider

  #include "colors.inc"
  camera { location <0, 20, -30> look_at <0, 0, 0> }
  light_source { <30, 30, -30>, White }
  plane {
    y, 0
    pigment { ripples frequency 5 scale 20 }
    clipped_by { box { <-20, -1, -20> <0, 1, 40> } }
  }
  plane {
    y, 0
    pigment { Gray70 }
    normal { ripples frequency 5 scale 20 }
    clipped_by { box { <-20, -1, -20> <20, 1, 40> } }
  }

As normals (right), the ripples are OK, but as pigment
(left) they are broken, because `frequency' was used for
both wave frequency and colour_map frequency.

I suggest using a separate keyword like `wave_frequency' or
so for wave frequencies.  Consider one can't use ripples
in isosurface now (well, can, but can't set frequency).

Yeti


Post a reply to this message

From: bob h
Subject: Re: frequency keyword conflict
Date: 24 Mar 2002 13:36:15
Message: <3c9e1c9f@news.povray.org>
"David Necas (Yeti)" <yet### [at] monocerosphysicsmunicz> wrote in message
news:slr### [at] monocerosphysicsmunicz...
> Not exactly a bug, but still needs fixing:

Not so sure, myself.

> The `frequency' keyword is used for two completely different
> things
> - in colour_maps to specify how many times they should be
>   mapped over the [0,1] interval
> - in ripples and waves patterns to specify the wave
>   frequency
---snip---
 (Notice that you accidentally made the clipping box for the normal extend
to -20 and it needs to be 0 so the two planes show. Just so people know
that.)
---snip---
> As normals (right), the ripples are OK, but as pigment
> (left) they are broken, because `frequency' was used for
> both wave frequency and colour_map frequency.
>
> I suggest using a separate keyword like `wave_frequency' or
> so for wave frequencies.  Consider one can't use ripples
> in isosurface now (well, can, but can't set frequency).

The number_of_waves global setting usually controls this, not frequency. Of
course that doesn't apply to non-ripples and non-waves patterns.
Consider the following, taking your example and changing it a bit:

 global_settings {
        number_of_waves 5
 }

  camera { location <0, 20, -30> look_at <0, 0, 0> }
  light_source { <30, 30, -30>, 1 }

  plane {
    y, 0
    pigment { ripples sine_wave frequency 2 scale 5 }
    clipped_by { box { <-20, -1, -20> <0, 1, 40> } }
  }

  plane {
    y, 0
    pigment { rgb .7 }
    normal { ripples 7 sine_wave frequency 2 scale 5 }
    clipped_by { box { <0, -1, -20> <20, 1, 40> } }
  }

This shows wave_type matters as well, but anyhow I can get a close match. If
there's truly a problem or difficulty in the usage of frequency I couldn't
say if it matters or not. This is just my observation at the moment.

bob h


Post a reply to this message

From: David Necas (Yeti)
Subject: Re: frequency keyword conflict
Date: 24 Mar 2002 16:43:54
Message: <slrna9si4p.it1.yeti@monoceros.physics.muni.cz>
In article <3c9e1c9f@news.povray.org>, bob h wrote:
>---snip---
> (Notice that you accidentally made the clipping box for the normal extend
>to -20 and it needs to be 0 so the two planes show. Just so people know
>that.)
>---snip---

I'm sorry.

>The number_of_waves global setting usually controls this, not frequency.

No, number_of_waves controls number of waves (i.e wave
centers), while frequency controls their frequency.

> Of
>course that doesn't apply to non-ripples and non-waves patterns.
>Consider the following, taking your example and changing it a bit:
>
> global_settings {
>        number_of_waves 5
> }
>
>  camera { location <0, 20, -30> look_at <0, 0, 0> }
>  light_source { <30, 30, -30>, 1 }
>
>  plane {
>    y, 0
>    pigment { ripples sine_wave frequency 2 scale 5 }
>    clipped_by { box { <-20, -1, -20> <0, 1, 40> } }
>  }
>
>  plane {
>    y, 0
>    pigment { rgb .7 }
>    normal { ripples 7 sine_wave frequency 2 scale 5 }
>    clipped_by { box { <0, -1, -20> <20, 1, 40> } }
>  }
>
>This shows wave_type matters as well, but anyhow I can get a close match. If
>there's truly a problem or difficulty in the usage of frequency I couldn't
>say if it matters or not. This is just my observation at the moment.

Using sine_wave and integer frequency _hides_ the problem,
but it's still there.  sine_wave makes the pigment smooth,
not right (and it distorts the wave shapes, one has to use
asin()-like colour_map to get original shapes).  Just try
frequency 1.5 instead of 2 in your example and you'll see
what I mean.

However, one perhaps could get by with your solution in most
practical cases.

Yeti


Post a reply to this message

From: bob h
Subject: Re: frequency keyword conflict
Date: 25 Mar 2002 02:29:55
Message: <3c9ed1f3@news.povray.org>
Followup-To povray.general, since this is likely to be off-topic for the
beta. For now anyway.

"David Necas (Yeti)" <yet### [at] monocerosphysicsmunicz> wrote in message
news:slr### [at] monocerosphysicsmunicz...
>
> No, number_of_waves controls number of waves (i.e wave
> centers), while frequency controls their frequency.
>
> Using sine_wave and integer frequency _hides_ the problem,
> but it's still there.  sine_wave makes the pigment smooth,
> not right (and it distorts the wave shapes, one has to use
> asin()-like colour_map to get original shapes).  Just try
> frequency 1.5 instead of 2 in your example and you'll see
> what I mean.

I can see your point, I was trying to think of something at the spur of the
moment about your message post.
Keeping in mind that a pigment is unlike a normal, they probably can't be
used in identical ways. I was hoping someone else would have discussed this
before I got back to it though, since I don't understand the underlying
factors for the differences. Just apparent that normals don't adhere to the
same method as pigments for how they are formed. Someone must know why that
is.

--
sphere_sweep{b_spline 20<-2,-2,4>.1<-2,-1,4>.15<-1.5,1,4>.1<0,0,4>.1
<-2,0,4>.1<0,-1,4>.1<-2.5,-1,4>.1<-.5,-1,4>.1,<0,0,4>.1<1,-.5,4>.1
<0,-1,4>.1<-.5,-.5,4>.1<0,0,4>.1<1,-1,4>.1<1.5,-.25,4>.1<2,0,4>.1
<2,-.75,4>.1<1,-1,4>.1<1.5,1,4>.1<1.5,1,4>.1pigment{rgb 9}}//v3.5


Post a reply to this message

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