home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mega CD-ROM 1
/
megacd_rom_1.zip
/
megacd_rom_1
/
IRIT
/
IRITS.ZIP
/
BUG.IRT
< prev
next >
Wrap
Text File
|
1989-04-18
|
1KB
|
51 lines
#
# A teeth wheel:
# Gershon Elber, Apr 89
#
tm = time(true);
save_mat = view_mat;
save_res = resolution;
# Number of samples per circle:
resolution = 4;
# Note angle must be power of 2 as we multiply it by 2 each iteration, and
# angle_log should hold the base 2 log of the divider in angle: log2 16 = 4.
angle = 360/4;
angle_log = 2;
C = cylin(vector( 0.6, 0.0, -0.1), vector( 0.0, 0.0, 0.3), 0.3);
view(list(C,axes), true);
for ((i=1), 1, angle_log,
(C = C + C * rotz(angle)):
(angle = angle * 2):
view(list(C,axes), true)
);
#
# Now lets create the wheel, make a hole in it to make it looks more real,
# and subtract all the teeth from it:
#
resolution = 32;
wheel = cylin(vector( 0.0, 0.0, 0.0), vector( 0.0, 0.0, 0.08), 0.6);
beep(1200,200);
wheel = wheel - C;
free(C);
beep(1200,200);
view(list(wheel), true);
gdump("bug", wheel);
wheel = convex(wheel);
interact(list(wheel), true);
resolution = save_res;
view_mat = save_mat;