xyz2rgb
|
1crn.gif,
PDB3D.zip,
README.jkl,
_index.html,
babel-mod.tar.gz,
c50_pent.zip,
c50lib,
c50lib.tar.gz,
cc-prize.html,
cones.jpg,
crambin.mpg,
deter-response.gz,
globus-tube.gif,
globus-xyzs,
globus-xyzs.tar.gz,
lisp2c.lsp,
lucier-email.gz,
m3dxyz.c,
make-cones,
ncad021,
ncad021.tar.gz,
ncad021.zip,
ncad022,
ncad022.tar.gz,
ncad022.zip,
ncad023,
ncad023.tar.gz,
ncad023a,
ncad023a.tar.gz,
ncad023b,
ncad023b.tar.gz,
pdb2ps.c,
tv,
verl-fun.zip,
verlet-fun,
verlet-fun.tar.gz,
x-app,
x-app.tar.gz,
xyz2rgb,
xyz2rgb.c,
xyz2rgb.html,
xyz2rgb.tar.gz,
|
|
|
#!/usr/local/bin/perl
# Make illustration of overlapping cones, produce a xyz2rgb-readable wall
# file. Name this file make-cones, and do something like this:
# make-cones > cones
# xyz2rgb -latitude 30 -longitude 20 -distance 45 -walls cones > cones.rgb
# convert -size 640x480 -interlace line cones.rgb cones.bmp
# xv cones.bmp
$pi = 3.1415926;
$slices = 200;
$opacity = 0.28;
$height = 15;
$rbottom = 10;
$rtop = 0;
$sep = 5;
printf "%d\n", 2 * $slices; # number of walls
sub one_cone
{
$cy = $_[0];
for ($x = 0; $x < $slices; $x++)
{
# the cones' 360 degrees are sliced into $slices
$a1 = $x * (2 * $pi / $slices);
$a2 = ($x + 1) * (2 * $pi / $slices);
# red, green, blue, opacity
printf ("%d %d %d %f\n",
$_[1], $_[2], $_[3], $opacity);
# xyz coordinates for four corners of wall
printf ("%f %f %f\n",
$rtop * cos($a1),
$cy + $rtop * sin($a1),
$height / 2);
printf ("%f %f %f\n",
$rtop * cos($a2),
$cy + $rtop * sin($a2),
$height / 2);
printf ("%f %f %f\n",
$rbottom * cos($a2),
$cy + $rbottom * sin($a2),
-$height / 2);
printf ("%f %f %f\n",
$rbottom * cos($a1),
$cy + $rbottom * sin($a1),
-$height / 2);
}
}
&one_cone(-$sep / 2, 255, 140, 50);
&one_cone($sep / 2, 50, 140, 255);
|