POV-Ray : Newsgroups : povray.object-collection : Contribution Drive? : Re: Contribution Drive? Server Time
3 Dec 2024 21:14:34 EST (-0500)
  Re: Contribution Drive?  
From: John VanSickle
Date: 22 Jan 2008 17:21:22
Message: <47966c62$1@news.povray.org>
Chambers wrote:
> One of the problems I've noticed with object downloads is that, for 
> simple objects, its often easier to make it myself using CSG while, for 
> complex objects, the object doesn't quite fit my needs.

For some of my more recent prop items I have striven to make as many of 
the parameters dependent on settings that can come from the calling code.

It's simple:

#ifndef(LegRadius)
   #local LegRadius=1;
#end

and then write the SDL for the object to use LegRadius instead of some 
value written into every sphere, cylinder, and torus statement in the 
Leg object.

The dimensions of objects like furniture, eating and drinking utensils, 
and even many kinds of vehicles can be greatly expanded in this way.

Another .INC file I commonly use creates a picture that can be hung on a 
wall.  The corners of the frame, and the edges of the frame, are 
specified by means of creating one object for each, which are then 
scaled, rotated, and translated to create the frame; the content of the 
picture is accomplished with a texture specification (so that the 
picture can be a mirror with just one change to the calling code).  The 
width and height of the picture are also set by the calling code, as well.

The textures are the most easily changed setting.  Every texture used in 
an object should be controlled by code of this form:

#infdef(CasingTexture)
   #local CasingTexture = texture { /* default texture code here */ }
#end

The immediate effect of all this is that an object that is useful in the 
early stage of scene layout can be specified with a minimum of parameter 
settings, and then quickly refined later in the process.

Regards,
John


Post a reply to this message

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