|
![](/i/fill.gif) |
Andrew Coppin <orp### [at] btinternet com> wrote in message
news:3db6dd90@news.povray.org...
Here are a few things which I do. Some mentioned already, some not. I am
probably breaking some rules here, because I don't have any programming
experience except for SDL and a tiny bit of C++ which I learned off the net.
**Create a new folder for each project.
**Create a folder within that folder to store files which I will likely not
need again
**Save macro files with an *.inc extension
**Save object files like macro generated mesh and union objects which will
not be further edited with a *.txt extension. This hides the files when
looking in the folder for pov extensions and allows you to see only these
files by selecting *.txt from the drop-down menu. (at least in windows)
**Naming conventions. I use: My_Macro, MY_MACRO_PARAMETER, my_file, and
MyVariable.
**File naming conventions. I prefix each descriptive file name with the file
"type." This makes a file easy to locate when I want to open it. example:
create_dish.inc, view_building.pov, math_triangle.inc, mesh2_cover.txt etc.
**Create several versions of a macro or hide less often changed macro
parameters with the method I described in the "Macros in Macros?" thread.
**Comment *every* line of code
**Put a good description of every file and the date of the current version
at the top of the file in case I make an updated version from scratch or my
file name becomes unclear to me
**Keep parts of the scene in separate files so I can switch them off and on.
This works better for me than bool switches and #if blocks because the
mechanism is hidden more.
**Make a sample scene at the bottom of each macro page with a full scene set
up. I comment the scene out, but leave it there so I have a quick example of
what the macro does and the effects of the various parameters.
**Include my included object name declaration in my PoV file. Maybe an
example is better.
<included object file>
#macro Name_Object (NAME)
#local NAME = mesh2 ..........
#end
<pov file>
#local UpperPlatform = 0;
Name_Object (UpperPlatform)
This makes for a lot of typing, but I don't have to remember the name I used
a month ago when I made the include file, and anyone looking at the file
will not have to wonder where the Hell the variable UpperPlatform came from.
**When writing a short macro, I give very long names to the parameters so
that it will be very clear what they do. I then rename them within the
macro.
example: #macro Compare_Vectors (COMPARE_THIS_VECTOR, TO_THIS_VECTOR)
That's all that comes to mind right now.
-Shay
Post a reply to this message
|
![](/i/fill.gif) |