POV-Ray : Newsgroups : povray.general : ANNOUNCE: Thoroughly Useful Macros! Server Time
16 Nov 2024 01:19:16 EST (-0500)
  ANNOUNCE: Thoroughly Useful Macros! (Message 1 to 1 of 1)  
From: John VanSickle
Subject: ANNOUNCE: Thoroughly Useful Macros!
Date: 22 Oct 1998 21:45:18
Message: <362FDF34.2B460CD9@erols.com>
Thanks to the POV-Ray #macro directive and support for arrays,
operations that formerly had to be done with in-line code, #include files,
or even external programs, can now be done with simple macro calls. I put
several of these functions into an .INC file, which makes them a lot easier
to use.

  The file is available for download at:

http://www.erols.com/vansickl/macs.htm

  This is a bug fix that was uploaded at about 0200 Greenwich Time on
Oct 23, so if you have the older one already, update!

  The thoroughly usefule macros are:

Connect(StartPoint,StartRadius,EndPoint,EndRadius)
- This macro creates a cone object which will smoothly connect two spheres.

RoundedBar(StartCorner,EndCorner,Radius)
- This macro creates a bar with four of its edges rounded.

RoundedBox(StartCorner,EndCorner,Radius)
- This macro creates a box with all of its edges and corners rounded.

AxisRotate(Axis,Angle)
- This macro rotates an object (or texture component) by a given angle
  around an arbitrary axis.

Reorient(StartAxis,EndAxis)
- This macro takes something that lies along a given axis and turns it so
  that it lies along another.

FlipXY
FlipXZ
FlipYZ

- These three items are not macros, but because they are thoroughly useful
  I have included them. They are declared transforms, and do to an object,
  texture, or texture component what the name describes: It flips them
  along two of the axes, leaving the object unchanged along the third axis.
  Many objects in POV-Ray are oriented along the y or z axis by default;
  these transforms will orient them along the other axes as well. FlipYZ
  can also be used to change an object designed in a y-up scene to an
  object that will work fine in a z-up scene, and vice versa. 

Transition(Start,End,Swerve,Phase)
- This is a "semi-spline" function, useful mainly for animation work. It
  facilitates moving objects smoothly from one point to another, and allows
  for movement to the side in mid-flight.

SmoothSeed(Array,Sequence)
SmoothRand(Array)
- This pair of macros will yield a random-number that varies smoothly over
  time.

Note:  This file uses the #macro directive, so you'll need version 3.1
for it to work.

Enjoy,
John
-- 
"Have the manners not to be hittin' the man until he's your husband, and
entitled to hit back!"


Post a reply to this message

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