Category : OS/2 Files
Archive   : IRIT-OS2.ZIP
Filename : DINNER.IRT

 
Output of file : DINNER.IRT contained in archive : IRIT-OS2.ZIP
#
# A dinner table scene, to demonstrate the surface constructors of the IRIT
# solid modeller. Do not attempt to run this model on an IBM PC...
#
# Gershon Elber, June 1991
#
# modification to dinner.ray:
# fov 12
# light 1 1 1 point 10 30 10

resolution = 10;
if ( machine, "=", msdos, (resolution = 5));

#
# First model the floor...
#
v1 = vector( -4.0, -4.0, 0.0 );
v2 = vector( 4.0, -4.0, 0.0 );
v3 = vector( 4.0, 4.0, 0.0 );
v4 = vector( -4.0, 4.0, 0.0 );
floor = poly( list( v1, v2, v3, v4 ) );
color( floor, white );
attrib( floor, "texture", "marble" );
attrib( floor, "reflect", "0.6" );
attrib( floor, "rgb", "100,0,0" );

#
# Model the table:
#

cross = ctlpt( E3, 0.0001, 0.0, 1.0 ) +
ctlpt( E3, 1.0, 0.0, 1.0 ) +
ctlpt( E3, 1.0, 0.0, 0.95 ) +
cbspline( 3,
list( ctlpt( E3, 0.1, 0.0, 0.95 ),
ctlpt( E3, 0.1, 0.0, 0.9 ),
ctlpt( E3, 0.1, 0.0, 0.7 ),
ctlpt( E3, 0.2, 0.0, 0.6 ),
ctlpt( E3, 0.2, 0.0, 0.2 ),
ctlpt( E3, 0.4, 0.0, 0.05 ),
ctlpt( E3, 0.4, 0.0, 0.0 ) ),
list( KV_OPEN ) ) +
ctlpt( E3, 0.0001, 0.0, 0.0 );
table = surfrev( cross );
color( table, yellow );
attrib( table, "resolution", "2" );
attrib( table, "texture", "wood" );
attrib( table, "reflect", "0.6" );
attrib( table, "rgb", "244,164,96" );

#
# Make the two chairs.
#
base1 = sweepsrf( circle( vector( 0.0, 0.0, 0.0 ), 0.02 ),
cbspline( 3,
list( ctlpt( E3, 0.5, 0.2, 0.5 ),
ctlpt( E3, 0.5, 0.2, 0.07 ),
ctlpt( E3, 0.5, 0.2, 0.015 ),
ctlpt( E3, 0.43, 0.2, 0.015 ),
ctlpt( E3, 0.25, 0.2, 0.1 ),
ctlpt( E3, 0.07, 0.2, 0.015 ),
ctlpt( E3, 0.0, 0.2, 0.015 ),
ctlpt( E3, 0.0, 0.2, 0.07 ),
ctlpt( E3, 0.0, 0.2, 0.5 ) ),
list( KV_OPEN ) ),
1.0 );
color( base1, white );
attrib( base1, "reflect", "0.9" );
base2 = base1 * trans( vector( 0.0, -0.4, 0.0 ) );

swpcrv = cbspline( 3,
list( ctlpt( E3, 0.6, 0.0, 0.5 ),
ctlpt( E3, 0.3, 0.0, 0.6 ),
ctlpt( E3, 0.0, 0.0, 0.5 ),
ctlpt( E3, -0.1, 0.0, 0.5 ),
ctlpt( E3, -0.1, 0.0, 0.6 ),
ctlpt( E3, 0.0, 0.0, 0.9 ),
ctlpt( E3, -0.1, 0.0, 1.2 ) ),
list( KV_OPEN ) );
swpcrv = crefine( swpcrv, false, list( 0.01, 0.1, 0.2, 0.3, 4.7, 4.8, 4.9, 4.99 ) );

cross = arc( vector( 0.25, 0.05, 0.0 ),
vector( 0.25, 0.0, 0.0 ),
vector( 0.3, 0.0, 0.0 ) ) +
arc( vector( 0.3, 0.0, 0.0 ),
vector( 0.25, 0.0, 0.0 ),
vector( 0.25, -0.05, 0.0 ) ) +
arc( vector( -0.25, -0.05, 0.0 ),
vector( -0.25, 0.0, 0.0 ),
vector( -0.3, 0.0, 0.0 ) ) +
arc( vector( -0.3, 0.0, 0.0 ),
vector( -0.25, 0.0, 0.0 ),
vector( -0.25, 0.05, 0.0 ) ) +
ctlpt( E3, 0.25, 0.05, 0.0 );

coverMain = sweepsrf( cross, swpcrv, 1.0 );
color( coverMain, yellow );
attrib( coverMain, "texture", "wood" );
attrib( coverMain, "rgb", "244,164,96" );

c1 = cmesh(coverMain, ROW, 14);
c2 = c1 * trans( vector( -0.018, 0.0, 0.06 ) );
c3 = c2 * scale( vector( 0.0, 0.83, 0.0 ) ) *
trans( vector( -0.124, 0.0, 1.26 ) );
coverTop = sFromCrvs( list( c1, c2, c3 ) );
color( coverTop, yellow );
attrib( coverTop, "texture", "wood" );
attrib( coverTop, "rgb", "244,164,96" );

c1 = cmesh(coverMain, ROW, 0);
c2 = c1 * trans( vector( 0.06, 0.0, -0.02 ) );
c3 = c2 * scale( vector( 0.0, 0.83, 0.0 ) ) *
trans( vector( 0.66, 0.0, 0.48 ) );
coverBot = sFromCrvs( list( c1, c2, c3 ) );
color( coverBot, yellow );
attrib( coverBot, "texture", "wood" );
attrib( coverBot, "rgb", "244,164,96" );

cover = list( CoverMain, coverBot, CoverTop );

chair = list( cover, base1, base2 );
chair1 = chair * trans( vector( -1.2, 0.0, 0.0 ) );
chair2 = chair1 * rotz( 90 );
chair3 = chair1 * rotz( 180 );
chair4 = chair1 * rotz( 270 );
chairs = list( chair1, chair2, chair3, chair4 );

#
# Create some dishes/cups.
#

# Four Dishes.
cross = cbspline( 3,
list( ctlpt( E3, 0.0001, 0.0, 0.003 ),
ctlpt( E3, 0.1, 0.0, 0.003 ),
ctlpt( E3, 0.12, 0.0, 0.0 ),
ctlpt( E3, 0.15, 0.0, 0.03 ),
ctlpt( E3, 0.15, 0.0, 0.04 ),
ctlpt( E3, 0.14, 0.0, 0.03 ),
ctlpt( E3, 0.12, 0.0, 0.013 ),
ctlpt( E3, 0.1, 0.0, 0.01 ),
ctlpt( E3, 0.0001, 0.0, 0.01 ) ),
list( KV_OPEN ) );
dish = surfrev( cross );
color( dish, white );
attrib( dish, "reflect", "0.2" );
dish1 = dish * trans( vector( 0.75, 0.0, 1.0 ) );
dish2 = dish * trans( vector( -0.75, 0.0, 1.0 ) );
dish3 = dish * trans( vector( 0.0, 0.75, 1.0 ) );
dish4 = dish * trans( vector( 0.0, -0.75, 1.0 ) );
dishes = list( dish1, dish2, dish3, dish4 );

# Wine glasses.
cross = cbspline( 3,
list( ctlpt( E3, 0.0001, 0.0, 0.002 ),
ctlpt( E3, 0.02, 0.0, 0.002 ),
ctlpt( E3, 0.022, 0.0, 0.0 ),
ctlpt( E3, 0.022, 0.0, 0.003 ),
ctlpt( E3, 0.003, 0.0, 0.003 ),
ctlpt( E3, 0.003, 0.0, 0.007 ),
ctlpt( E3, 0.004, 0.0, 0.03 ),
ctlpt( E3, 0.03, 0.0, 0.03 ),
ctlpt( E3, 0.04, 0.0, 0.04 ),
ctlpt( E3, 0.03, 0.0, 0.07 ),
ctlpt( E3, 0.028, 0.0, 0.07 ),
ctlpt( E3, 0.037, 0.0, 0.042 ),
ctlpt( E3, 0.031, 0.0, 0.032 ),
ctlpt( E3, 0.0001, 0.0, 0.032 ) ),
list( KV_OPEN ) );
wglass = surfrev( cross * scale( vector( 1.6, 1.6, 1.6 ) ) );
color( wglass, white );
attrib( wglass, "reflect", "0.2" );
attrib( wglass, "transp", "0.95" );
attrib( wglass, "index", "1.4" );
wglass1 = wglass * trans( vector( 0.75, 0.2, 1.0 ) );
wglass2 = wglass * trans( vector( -0.75, -0.2, 1.0 ) );
wglass3 = wglass * trans( vector( -0.2, 0.75, 1.0 ) );
wglass4 = wglass * trans( vector( 0.2, -0.75, 1.0 ) );
wglasses = list( wglass1, wglass2, wglass3, wglass4 );

# Regular glasses.
cross = cbspline( 3,
list( ctlpt( E3, 0.0001, 0.0, 0.0 ),
ctlpt( E3, 0.02, 0.0, 0.0 ),
ctlpt( E3, 0.022, 0.0, 0.001 ),
ctlpt( E3, 0.022, 0.0, 0.003 ),
ctlpt( E3, 0.03, 0.0, 0.07 ),
ctlpt( E3, 0.03, 0.0, 0.072 ),
ctlpt( E3, 0.028, 0.0, 0.072 ),
ctlpt( E3, 0.028, 0.0, 0.07 ),
ctlpt( E3, 0.02, 0.0, 0.005 ),
ctlpt( E3, 0.018, 0.0, 0.005 ),
ctlpt( E3, 0.0001, 0.0, 0.005 ) ),
list( KV_OPEN ) );
glass = surfrev( cross * scale( vector( 1.6, 1.6, 1.6 ) ) );
color( glass, white );
attrib( glass, "reflect", "0.2" );
attrib( glass, "transp", "0.95" );
attrib( glass, "index", "1.4" );
glass1 = glass * trans( vector( 0.75, -0.2, 1.0 ) );
glass2 = glass * trans( vector( -0.75, 0.2, 1.0 ) );
glass3 = glass * trans( vector( 0.2, 0.75, 1.0 ) );
glass4 = glass * trans( vector( -0.2, -0.75, 1.0 ) );
glasses = list( glass1, glass2, glass3, glass4 );

# Napkins.
cross = cbspline( 3,
list( ctlpt( E2, -0.018, 0.001 ),
ctlpt( E2, 0.018, 0.001 ),
ctlpt( E2, 0.019, 0.002 ),
ctlpt( E2, 0.018, 0.004 ),
ctlpt( E2, -0.018, 0.004 ),
ctlpt( E2, -0.019, 0.001 ) ),
list( KV_OPEN ) );
cross = cross + -cross * scale( vector( 1, -1, 1 ) );

napkin = extrude( cross * scale( vector( 1.6, 1.6, 1.6 ) ),
vector( 0.02, 0.03, 0.2 ) );
color( napkin, red );
napkin1 = napkin * trans( vector( 0.75, -0.2, 1.0 ) );
napkin2 = napkin1 * rotz( 90 );
napkin3 = napkin1 * rotz( 180 );
napkin4 = napkin1 * rotz( 270 );
napkins = list( napkin1, napkin2, napkin3, napkin4 );

# Big dish.
cross = ctlpt( E3, 0.0001, 0.0, 0.003 ) +
cbspline( 3,
list( ctlpt( E3, 0.15, 0.0, 0.003 ),
ctlpt( E3, 0.1, 0.0, 0.01 ),
ctlpt( E3, 0.1, 0.0, 0.035 ),
ctlpt( E3, 0.2, 0.0, 0.15 ),
ctlpt( E3, 0.195, 0.0, 0.15 ),
ctlpt( E3, 0.09, 0.0, 0.03 ),
ctlpt( E3, 0.04, 0.0, 0.01 ),
ctlpt( E3, 0.0001, 0.0, 0.01 ) ),
list( KV_OPEN ) );
bigdish = surfrev( cross * scale( vector( 1.2, 1.2, 1.2 ) ) );
bigdish = bigdish * trans( vector( 0.0, -0.2, 1.0 ) );
color( bigdish, white );
attrib( bigdish, "reflect", "0.2" );
attrib( bigdish, "transp", "0.95" );
attrib( bigdish, "index", "1.4" );
alldishes = list( dishes, wglasses, glasses, napkins, bigdish );

#
# Create some candles staff.
#
cross = cbspline( 3,
list( ctlpt( E3, 0.0001, 0.0, 0.0 ),
ctlpt( E3, 0.03, 0.0, 0.0 ),
ctlpt( E3, 0.035, 0.0, -0.001 ),
ctlpt( E3, 0.02, 0.0, 0.011 ),
ctlpt( E3, 0.015, 0.0, 0.011 ),
ctlpt( E3, 0.014, 0.0, 0.012 ),
ctlpt( E3, 0.014, 0.0, 0.02 ),
ctlpt( E3, 0.02, 0.0, 0.03 ) ),
list( KV_OPEN ) ) +
ctlpt( E3, 0.012, 0.0, 0.03 ) +
ctlpt( E3, 0.012, 0.0, 0.015 ) +
ctlpt( E3, 0.0001, 0.0, 0.015 );

cndlbase = surfrev( cross * scale( vector( 2, 2, 2 ) ) );
color( cndlbase, white );
attrib( cndlbase, "reflect", "0.2" );
attrib( cndlbase, "transp", "0.95" );
cndlbase1 = cndlbase * trans( vector( 0.2, 0.3, 1.0 ) );
cndlbase2 = cndlbase * trans( vector( -0.2, 0.3, 1.0 ) );

cross = ctlpt( E3, 0.0001, 0.0, 0.015 ) +
cbspline( 3,
list( ctlpt( E3, 0.011, 0.0, 0.015 ),
ctlpt( E3, 0.011, 0.0, 0.2 ),
ctlpt( E3, 0.003, 0.0, 0.3 ) ),
list( KV_OPEN ) );
candle = surfrev( cross * scale( vector( 2, 2, 2 ) ) );
color( candle, red );
candle1 = candle * trans( vector( 0.2, 0.3, 1.0 ) );
candle2 = candle * trans( vector( -0.2, 0.3, 1.0 ) );

candles = list( cndlbase1, cndlbase2, candle1, candle2 );

#
# View it all and dump it.
#

view_mat = view_mat * scale( vector( 0.5, 0.5, 0.5 ) );
dinner = list( floor, table, chairs, alldishes, candles );
interact( dinner, 0 );
save( "dinner", list( view_mat, dinner ) );

exit();


  3 Responses to “Category : OS/2 Files
Archive   : IRIT-OS2.ZIP
Filename : DINNER.IRT

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/