POV-Ray : Newsgroups : povray.binaries.images : no water in the garden : Re: no water in the garden Server Time
17 May 2024 23:08:19 EDT (-0400)
  Re: no water in the garden  
From: Bald Eagle
Date: 16 Nov 2017 09:05:00
Message: <web.5a0d9a75b458f717c437ac910@news.povray.org>
"Fractracer" <lg.### [at] gmailcom> wrote:

> Yes, a lot of. I have made a debug file to see the values output by
> asin(2.*_x/_l-1.0) // in the #while (_x<=_l-_xp) loop drawing spheres and
> cylinders for the barbs //. SOme of this values are > to 1.5 (when _x = 0). In
> fact the errors appears at the start and at the end of the loop. Maybe easy to
> fix, I will see this this evening.

I noticed that it was just a string of errors in two lines of the code.
That's where the cylinders are generated.
And it's only in the second calculation where (_x+_xp) is used
I just did a quick
#declare _X = (2.*(_x+_xp)/_l-1.0);
and then did 2 sequential #if statements to check if <-1 or >1, and then set it
to -1 or 1 to eliminate out-of-bounds values.
That got rid of all the errors.

There might be a more elegant faster way with select(), but it was getting late.



> The barbs may also made with sphere_sweep (like on my previous picture), but
> this need a lot of objects to obtain a tighten feather.

Right - as it is, these feathers take up a lot of memory.  The 10 feathers I'm
testing with gobble [sic] up >700 MB.  :O

Modeling a bald eagle - with 7000 feathers - wouldn't be possible.
Perhaps one of the things to look at is adjusting the number of steps in the
loop to get a feather with fewer primitives.
Of course, somehow generating a mesh that could be instantiated would be pretty
great as well.


> > Yes, I was wondering how to get something other than a banded pattern, and
> > more of a realistic pattern.  Possibly as another parameter for the macro so
> > that the pattern can be defined in the scene and passed to the macro.
> >
> See the picture, I made it fast...

Excellent - I'm glad it's that easy.
Another common coloration is a slightly different color going up the edge of one
side of the feather.


> > There also seems to be some unnecessary calculations, and "magic numbers" - it
> > would be great to simplify a lot of that, move the equations out into some
> > descriptive #declare or #local statements, and then use those meaningful
> > variable names in the calculations so that it's easier to follow what's going
> > on.
>
> Some cleaning...
> Two brains are better than one.

We hope   ;)


― Robert A. Heinlein


Hope you have a great day  :)


Post a reply to this message

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