POV-Ray : Newsgroups : povray.general : waterman polyhedra, POVRay and VRML : Re: waterman polyhedra, POVRay and VRML Server Time
3 Aug 2024 06:11:28 EDT (-0400)
  Re: waterman polyhedra, POVRay and VRML  
From: Florian Brucker
Date: 12 Apr 2004 05:44:34
Message: <407a6502$1@news.povray.org>
> Actually I'd like any constructive comments on "good style" when
> it comes to how one should export geometry in the POVRay format....
> treading the line between making scene that render as is but also
> easy to modify by a more proficient user.
Just had a quick look at the default output scene. IMHO it would be 
better if you'd handle textures, object postitions, etc. in arrays and 
use a while-loop to create them afterwards. Like

#local SphereCenters = array[4];
#local SphereCenters[0] = <0,3,2>;
//etc.
#local a = 0;
#while (a<4)
	sphere { SphereCenters[a], MyRadius }
	#local a = a + 1;
#end

You could even use array initializers like

#local SphereCenters = array[4] {<8,5,2>, <2,5,2>, <9,0,1>, <0,2,3> }

This would make the code shorter, easier to edit (because you would have 
to change only the object declarations in the loops once, and not for 
each object). Additionally, it would not make the code more complex or 
harder to understand, IMHO.

HTH,
Florian


Post a reply to this message

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