POV-Ray : Newsgroups : povray.general : how to prevent overlapping random objects? : Re: how to prevent overlapping random objects? Server Time
30 Jul 2024 04:11:26 EDT (-0400)
  Re: how to prevent overlapping random objects?  
From: Alain
Date: 21 Aug 2010 14:49:30
Message: <4c701fba$1@news.povray.org>


> Yeah, it's really horrible. POV's SDL wasn't meant to be quick at
> everything...
>
> So far, my C++ implementation is very fast, for not being coded with ASM
> and all. I was able to implement a few speedups, like not using
> sqrt(x*x+y*y) for *every pixel*, but instead making a 1/4 circle 2D
> array and picking from that.
>
> But now I'm stuck on trying to convert an int to a char, and
> vice-versus. It always comes down to something like that with C :( To
> make a utility like this useful, the user need to be able to change
> certain settings... This one might take awhile.

What's the fastest? sqrt(x*x+y*y) or sqrt(x^2+y^2)
In POV-Ray SDL, the second, as sqrt(pow(x,2)+pow(y,2)), is faster. Don't 
know how it compare in C/C++ or other compiled languages.

May be worth testing.



Alain


Post a reply to this message

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