POV-Ray : Newsgroups : povray.advanced-users : Managing Complexity : Re: Managing Complexity Server Time
29 Jul 2024 06:25:56 EDT (-0400)
  Re: Managing Complexity  
From: Warp
Date: 23 Oct 2002 17:06:43
Message: <3db70f63@news.povray.org>
Two words: Hierarchy. Modularity.

  Try to build a logical hierarchy with your scene and make the different
parts of this hierarchy modular (eg. by encapsulation).

  There will probably be some main objects in your scene (which are composed
of tons of subobjects). One way of encapsulating is to put each one of
these big independent objects in their own files (which are then included
in the main pov-file). In these files use #local as much as possible
(which is a great keyword for encapsulation).
  If you are using algorithms to generate objects/locations/whatever, try
to make it as abstract as possible (usually with the use of #macros).
"Abstract" in this context means that the macro declaration does not
imply nor fix the way the macro is internally implemented (or if this is
not possible, then it should do so in a minimalistic way).

  Big objects should form a hierarchy. For example, don't put every and
each one of the primitives it's composed of in one big union, even though
this could be possible. Declare (with #local whenever possible) logical parts
of the object (as unions or whatever) and join them to form bigger logical
parts, etc, and at the end union all the biggest parts together to form
the whole object.
  If these parts can have different positions and orientations (eg. the arms
of a robot), don't fix these parameters inside the object definition, but
make it more abstract (that is, use identifiers to position and orient the
objects, and declare these identifiers in a logical place where they can
be easily found and modified). Also design the parts in such a way that
moving them in a logical way is as easy as possible (eg. to rotate the
arm of the robot it's enough to just modify a declared angle value).

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

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