POV-Ray : Newsgroups : povray.general : Object "center of mass" macro : Re: Object "center of mass" macro Server Time
30 Jul 2024 12:22:53 EDT (-0400)
  Re: Object "center of mass" macro  
From: Alain
Date: 8 Sep 2009 12:15:07
Message: <4aa6830b$1@news.povray.org>

> Alain wrote:
>> The orientation of the tests can be passed as a parameter,somewhat 
>> like the direction vector used by trace, or a global variable.
>> In the later case, you can have a default orientation that is used if 
>> the user don't set it.
>>
>> That way, if the object been tested have a special shape, the 
>> direction can be chosen to be more effecient. After all, not all 
>> hightfields are used horizontaly.
>>
>>
>> Alain
> 
> Updated macro with your suggestion implemented uploaded to p.t.scene-files
> It will accept any of the three primary axes, and will default to y if 
> the passed parameter isn't at least mostly along one of the axes.
> 
> I haven't done a study on very complex surfaces, so I can't say for sure 
> how accurate it will be vs. iterations for a fractal-based form or even 
> a spikey image heightfield, but I assume that any protrusions small 
> enough to be missed by the tracing will not affect the center location 
> too much, especially as the grid resolution is increased.
> 
> Chris

For a high frequency, high noise object's surface, the spikes that you 
miss are frequently compensated by the pits that you miss.

Alain


Post a reply to this message

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