home *** CD-ROM | disk | FTP | other *** search
- /*
-
- STAR OBJECT INCLUDE FILE v1.0 - main include file
- Copyright (C) 1997 Thomas Willhalm
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-
- */
-
- /*
- Declare star object with given number of vertices
-
- Usage:
- PRE: <s_nmb> number of vertices (default is 0.05)
- <s_rad> radius of edges
- <s_maj> radius of the star (default is 1)
- POST: <star> contains the star
- SIDE: <s_pos> altered
-
- */
-
- #ifndef (s_maj)
- #declare s_maj=1
- #end
- #ifndef (s_rad)
- #declare s_rad=0.05
- #end
-
- #if (s_nmb=4)
- #declare star =
- union {
- #declare s_pos=0
- #while (s_pos<s_nmb)
- sphere { y*s_maj,s_rad rotate 90*s_pos*x}
- cylinder{
- y*s_maj, vaxis_rotate(y*s_maj,x,90), s_rad
- rotate 90*s_pos*x
- }
- #declare s_pos = s_pos+1
- #end
- }
- #else
- #declare star =
- union {
- #declare s_pos=0
- #while (s_pos<s_nmb)
- sphere { y*s_maj,s_rad rotate 360/s_nmb*s_pos*x}
- cylinder{
- y*s_maj, vaxis_rotate(y*s_maj,x,360/s_nmb*2), s_rad
- rotate 360/s_nmb*s_pos*x
- }
- #declare s_pos = s_pos+1
- #end
- }
- #end
-