Commit 352df17f authored by Kaleb Keithley Keithley's avatar Kaleb Keithley Keithley
Browse files

Initial revision

parents
#include "objcube.h"
#include "objico.h"
#include "objocta.h"
#include "objpyr.h"
#include "objplane.h"
This diff is collapsed.
.\" $XConsortium: ico.man,v 1.14 94/04/17 20:45:16 gildea Exp $
.\" $XFree86: xc/programs/ico/ico.man,v 1.3 2001/01/27 18:21:03 dawes Exp $
.TH ICO 1 __xorgversion__
.SH NAME
ico \- animate an icosahedron or other polyhedron
.SH SYNOPSIS
.B ico
[-display display] [-geometry geometry]
[-r] [-d pattern] [-i] [-dbl] [-faces] [-noedges]
[-sleep n] [-obj object] [-objhelp] [-colors color-list]
.SH DESCRIPTION
.I Ico
displays a wire-frame rotating polyhedron, with hidden lines removed,
or a solid-fill polyhedron with hidden faces removed.
There are a number of different polyhedra available;
adding a new polyhedron to the program is quite simple.
.SH OPTIONS
.TP
.B -r
Display on the root window instead of creating a new window.
.TP
.B -d pattern
Specify a bit pattern for drawing dashed lines for wire frames.
.TP
.B -i
Use inverted colors for wire frames.
.TP
.B -dbl
Use double buffering on the display.
This works for either wire frame or solid fill drawings.
For solid fill drawings, using this switch results in substantially
smoother movement.
Note that this requires twice as many bit planes as without double buffering.
Since some colors are typically allocated by other programs,
most eight-bit-plane displays will probably be limited to eight colors
when using double buffering.
.TP
.B -faces
Draw filled faces instead of wire frames.
.TP
.B -noedges
Don't draw the wire frames.
Typically used only when -faces is used.
.TP
.B -sleep \fIn\fP
Sleep n seconds between each move of the object.
.TP
.B -obj \fIobject\fP
Specify what object to draw.
If no object is specified, an icosahedron is drawn.
.TP
.B -objhelp
Print out a list of the available objects, along with information
about each object.
.TP
.B -colors \fIcolor color ...\fP
Specify what colors should be used to draw the filled faces of the object.
If less colors than faces are given, the colors are reused.
.SH PROGRAM TREMINATION
.LP
Pressing "q" will close a window. If compiled with threads support, the
program will stop only when all threads terminate. You can also close an
animation window using the ICCCM \fIdelete\fP message (deppending on your
window manager, you will have a decoration button or menu to send such
message).
.SH ADDING POLYHEDRA
.LP
If you have the source to ico, it is very easy to add more polyhedra.
Each polyhedron is defined in an include file by the name of objXXX.h,
where XXX is something related to the name of the polyhedron.
The format of the include file is defined in the file polyinfo.h.
Look at the file objcube.h to see what the exact format of an objXXX.h
file should be, then create your objXXX.h file in that format.
.LP
After making the new objXXX.h file (or copying in a new one from elsewhere),
simply do a 'make depend'.
This will recreate the file allobjs.h, which lists all of the objXXX.h
files.
Doing a 'make' after this will rebuild ico with the new object information.
.SH "SEE ALSO"
X(__miscmansuffix__)
.SH BUGS
.LP
Pyramids and tetrahedrons with filled faces do not display correctly.
.LP
A separate color cell is allocated for each name in the -colors list, even
when the same name may be specified twice. Color allocation fails in
TrueColor displays and option \fI-faces\fP does not work well.
.SH COPYRIGHT
Copyright ([\d,\s]*) X Consortium
.br
See \fIX(__miscmansuffix__)\fP for a full statement of rights and permissions.
/* objcube.h - structure values for cube */
{ "cube", "cube", /* long and short names */
"octahedron", /* long name of dual */
8, 12, 6, /* number of vertices, edges, and faces */
{ /* vertices (x,y,z) */
/* all points must be within radius 1 of the origin */
#define T 0.577
{ T, T, T },
{ T, T, -T },
{ T, -T, -T },
{ T, -T, T },
{ -T, T, T },
{ -T, T, -T },
{ -T, -T, -T },
{ -T, -T, T },
#undef T
},
{ /* faces (numfaces + indexes into vertices) */
/* faces must be specified clockwise from the outside */
4, 0, 1, 2, 3,
4, 7, 6, 5, 4,
4, 1, 0, 4, 5,
4, 3, 2, 6, 7,
4, 2, 1, 5, 6,
4, 0, 3, 7, 4,
}
}, /* leave a comma to separate from the next include file */
/* end */
/* objico.h - structure values for icosahedron */
{ "icosahedron", "ico", /* long and short names */
"dodecahedron", /* long name of dual */
12, 30, 20, /* number of vertices, edges, and faces */
{ /* vertices (x,y,z) */
/* all points must be within radius 1 of the origin */
{ 0.00000000, 0.00000000, -0.95105650},
{ 0.00000000, 0.85065080, -0.42532537},
{ 0.80901698, 0.26286556, -0.42532537},
{ 0.50000000, -0.68819095, -0.42532537},
{-0.50000000, -0.68819095, -0.42532537},
{-0.80901698, 0.26286556, -0.42532537},
{ 0.50000000, 0.68819095, 0.42532537},
{ 0.80901698, -0.26286556, 0.42532537},
{ 0.00000000, -0.85065080, 0.42532537},
{-0.80901698, -0.26286556, 0.42532537},
{-0.50000000, 0.68819095, 0.42532537},
{ 0.00000000, 0.00000000, 0.95105650}
},
{ /* faces (numfaces + indexes into vertices) */
/* faces must be specified clockwise from the outside */
3, 0, 2, 1,
3, 0, 3, 2,
3, 0, 4, 3,
3, 0, 5, 4,
3, 0, 1, 5,
3, 1, 6, 10,
3, 1, 2, 6,
3, 2, 7, 6,
3, 2, 3, 7,
3, 3, 8, 7,
3, 3, 4, 8,
3, 4, 9, 8,
3, 4, 5, 9,
3, 5, 10, 9,
3, 5, 1, 10,
3, 10, 6, 11,
3, 6, 7, 11,
3, 7, 8, 11,
3, 8, 9, 11,
3, 9, 10, 11
}
}, /* leave a comma to separate from the next include file */
/* end */
/* objocta.h - structure values for octahedron */
{ "octahedron", "octa", /* long and short names */
"cube", /* long name of dual */
6, 12, 8, /* number of vertices, edges, and faces */
{ /* vertices (x,y,z) */
/* all points must be within radius 1 of the origin */
#define T 1.0
{ T, 0, 0 },
{ -T, 0, 0 },
{ 0, T, 0 },
{ 0, -T, 0 },
{ 0, 0, T },
{ 0, 0, -T },
#undef T
},
{ /* faces (numfaces + indexes into vertices) */
/* faces must be specified clockwise from the outside */
3, 0, 4, 2,
3, 0, 2, 5,
3, 0, 5, 3,
3, 0, 3, 4,
3, 1, 2, 4,
3, 1, 5, 2,
3, 1, 3, 5,
3, 1, 4, 3,
}
}, /* leave a comma to separate from the next include file */
/* end */
/* objplane.h - structure values for plane */
{ "plane", "plane", /* long and short names */
"cube", /* long name of dual */
4, 4, 1, /* number of vertices, edges, and faces */
{ /* vertices (x,y,z) */
/* all points must be within radius 1 of the origin */
#define T 1.0
{ T, 0, 0 },
{ -T, 0, 0 },
{ 0, T, 0 },
{ 0, -T, 0 },
#undef T
},
{ /* faces (numfaces + indexes into vertices) */
/* faces must be specified clockwise from the outside */
4, 0, 2, 1, 3,
}
}, /* leave a comma to separate from the next include file */
/* end */
/* objpyr.h - structure values for pyramid */
{ "pyramid", "pyramid", /* long and short names */
"cube", /* long name of dual */
5, 8, 5, /* number of vertices, edges, and faces */
{ /* vertices (x,y,z) */
/* all points must be within radius 1 of the origin */
#define T 1.0
{ T, 0, 0 },
{ -T, 0, 0 },
{ 0, T, 0 },
{ 0, -T, 0 },
{ 0, 0, T },
/* { 0, 0, -T }, */
#undef T
},
{ /* faces (numfaces + indexes into vertices) */
/* faces must be specified clockwise from the outside */
3, 0, 4, 2,
/* 3, 0, 2, 5, */
/* 3, 0, 5, 3, */
3, 0, 3, 4,
3, 1, 2, 4,
/* 3, 1, 5, 2, */
/* 3, 1, 3, 5, */
3, 1, 4, 3,
4, 0, 2, 1, 3,
}
}, /* leave a comma to separate from the next include file */
/* end */
/* polyinfo.h
* This is the description of one polyhedron file
*/
/* $XFree86: xc/programs/ico/polyinfo.h,v 1.3 2000/02/17 14:00:32 dawes Exp $ */
#define MAXVERTS 120
/* great rhombicosidodecahedron has 120 vertices */
#define MAXNV MAXVERTS
#define MAXFACES 30
/* (hexakis icosahedron has 120 faces) */
#define MAXEDGES 180
/* great rhombicosidodecahedron has 180 edges */
#define MAXEDGESPERPOLY 20
typedef struct {
double x, y, z;
} Point3D;
/* structure of the include files which define the polyhedra */
typedef struct {
const char *longname; /* long name of object */
const char *shortname; /* short name of object */
const char *dual; /* long name of dual */
int numverts; /* number of vertices */
int numedges; /* number of edges */
int numfaces; /* number of faces */
Point3D v[MAXVERTS]; /* the vertices */
int f[MAXEDGES*2+MAXFACES]; /* the faces */
} Polyinfo;
/* end */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment