POV-Ray : Newsgroups : povray.advanced-users : Inaccurate sqrt-function? Server Time
1 Nov 2024 15:26:17 EDT (-0400)
  Inaccurate sqrt-function? (Message 1 to 3 of 3)  
From: Tim Nikias
Subject: Inaccurate sqrt-function?
Date: 10 Dec 2001 18:43:54
Message: <3C154855.4DC3D893@gmx.de>
Hi there!

I've experienced this problem with POV3.1 and 3.5, so I think it's just
some
detailed-calculation-problem kinda thing.

What I am doing:
I have blob-particles which vary in size, something around .5 and 4 in
radius.
The threshold is .2, the strength of each particle is 1.

When calculating an actual radius of the particle based on the distinct
settings,
I'd have to resolve the density-algorithm from

density=strength*pow( 1- pow( distance/radius) ,2) ,2)

to

distance = radius*sqrt( 1-sqrt( density/strength) )

Now, I'm thinking:
Is this solution the right one or not? I've interpreted density from the
docs
as threshold value, which is the only way the whole algorithm makes
sense.

The problem:
The components hover around. If they have larger radius than average
value
of 2 (which is the base value that is being turbulenced by random value
with algorithm: (rand(Seed)*2-1)*Percentage_Of_Turbulence/100) ),
they intersect the ground plane, if they are smaller, they hover above.
Strange is, that with unmodified radius, they are on the exact position
they're
supposed to. So changing the radius in the above mentioned algorithm
should
solve the problem, but somehow, doesn't.

The scene this takes place in is rather huge, and since I'm using a
whole
include-system for particles around it, it's rather useless to post
something.
I'll come up with an easy version and post it sometime later.

Hope somebody knows a solution to this one...

Tim


Post a reply to this message

From: Tim Nikias
Subject: Re: Inaccurate sqrt-function?
Date: 10 Dec 2001 19:02:59
Message: <3C154CCE.834E2FA0@gmx.de>
Sorry folks!

Problem was, within all those hundreds lines of code, there was a line that
applied the generated resize again. So, after all, still looks like
POV-Ray is perfect (with exception of those few new-release bugs which
simply occur during development...)

Tim


Post a reply to this message

From: Rune
Subject: Re: Inaccurate sqrt-function?
Date: 11 Dec 2001 11:02:11
Message: <3c162e03@news.povray.org>
"Tim Nikias" wrote:
> Sorry folks!
>
> Problem was, within all those hundreds lines of code,
> there was a line that applied the generated resize again.

Yep, I knew that before I saw this reply...

The thing is, when you have a scene with hundreds of lines of code and it
acts strange it's almost *always* a bug in *your* code and not in POV-Ray.
So generally a bug should never be assumed before you have a minimum scene
where the problem is triggered a specific place where it definitely
shouldn't.

With some experience you get the ability to do a qualified guess if a
strange behavior is caused by a bug in your own code or in POV-Ray. I could
tell that the problem you described was almost definitely a flaw in your
code... :)

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated Nov 5)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

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