POV-Ray : Newsgroups : povray.advanced-users : Multi-usage of an object : Re: Multi-usage of an object Server Time
28 Jul 2024 10:17:24 EDT (-0400)
  Re: Multi-usage of an object  
From: Alain
Date: 20 May 2006 11:05:53
Message: <446f3051$1@news.povray.org>
McHannemann nous apporta ses lumieres en ce 20/05/2006 01:49:
>>The idea of reusing an object with little additional memory cost relates
>>to objects that themselves have components such as the mesh{} object and
>>the blob{} object.  But the initial declaration of a mesh{}, say, will
>>require lots of memory if it is comprised of many triangles.  However
>>once declared, it can be instanced multiple times without additionally
>>multiplying the memory needs.
>>IE.
>>#declare M =
>>mesh {
>>     triangle {...},
>>     triangle {...},
>>     ...
>>     triangle {...}
>>};
>>
>>LOOP
>>     object { M transform {...} }
>>END LOOP
>>
>>
>>BUT
>>This effect cannot be achieved by unioning a group of objects:
>>
>>#declare U =
>>union {
>>     triangle {...},
>>     triangle {...},
>>     ...
>>     triangle {...}
>>};
>>
>>LOOP
>>     object { U transform {...} }
>>END LOOP
>>would multiply the memory cost
> 
> 
> 
> ok so if I have a object consistent of several parts I do normally union
> to move them around, I need to not union them and move them all seperate
> right?
> 
> REgards,
> THor
> 
> 
>
You use slightly less memory moving the whole union than each component invidualy.
The saving possible in that case is, mostly, by having your texture applied to the
whole union. You 
don't save if you apply your texture to each individual element.

The real saving is when your objects are mesh objects. The original mash takes a large
amount of 
memory, but each instances only use a referer and a transformation. The sample was
ONLY a 
comparaison between an union of triangles (memory hog) and the same triangles as a
mesh.
You can put several mesh in an union. This won't cause a marked memory increase. The
larger the 
mesh, the greater the gain.

-- 
Alain
-------------------------------------------------


Post a reply to this message

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