POV-Ray : Newsgroups : povray.general : guys could you help me out once more? : Re: guys could you help me out once more? Server Time
27 Apr 2024 19:00:15 EDT (-0400)
  Re: guys could you help me out once more?  
From: Kenneth
Date: 25 Aug 2017 12:25:01
Message: <web.59a04de161def543883fb31c0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

>
> Not to make it any more complicated, but it might give a more compact code -
> what about calculating the array values by using abs(sin (somthing)), and that
> way when [theta] goes past the max, it automatically goes back to 0...

Yes, I see what you're getting at; very clever. I wouldn't have thought of it.
The only (temporary) trouble I see is that the sin wave has to jump back to zero
when it reaches its PEAK-- then a new positive sin wave needs to begin again
immediately. Etc. OR... the 'descending' part of the (positive) wave needs to
have its values reversed, so that the 'peak' is considered 'zero', and the array
values *increase* as the wave falls back to zero. (This would be for creating
the 2nd group of repeating X-array values.) Then the wave scheme starts over
again.

If either of these scenarios could be made to work, it would be an elegant
solution-- more beautiful than my 'brute-force' #for loop. ;-)

I still like my YY equation, though; seems to be rather compact and elegant
as-is (unless the OP just *wants* to use an array for the Y-values as well.)


Post a reply to this message

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