home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
-
-
- QRT Sample Programs
-
-
- Introduction
-
- The following are actual QRT input files. They can be used as a
- guide to suggested QRT indenting style, or as a quick reference
- to QRT commands. The first one uses most of the advanced
- features of QRT, and would be a good example of QRT programming.
-
-
-
-
- File One
-
-
-
- { ******************************************
-
- QRT source for 8 spheres connected by
- reflecting cylenders. The spheres
- form the corners of a cube.
-
- ****************************************** }
-
- FILE_NAME = object.raw
-
-
- { ** Instance definitions for quadratics to save
- typing. These quadratics are the cylenders
- that connect the spheres ** }
-
-
- BEGIN_INSTANCES
-
- QUADRATIC ( loc = (0, 0, 0),
- name = X_AXIS_QUAD
-
- a = 0,
- b = 1,
- c = 1,
- d = 120,
-
- xmin = 0, xmax = 100,
- ymin = -11, ymax = 11,
- zmin = -11, zmax = 11,
-
-
-
-
-
- QRT Ray Tracer Page 1 QRT Sample Programs
-
-
-
-
-
-
-
-
-
-
-
-
- diff = ( 0, 0 , 0),
- mirror = (.9, .9, .9),
- dither = 0
- )
-
- QUADRATIC ( loc = (0, 0, 0),
- name = Y_AXIS_QUAD
-
- a = 1,
- b = 0,
- c = 1,
- d = 120,
-
- xmin = -11, xmax = 11,
- ymin = 0, ymax = 100,
- zmin = -11, zmax = 11,
-
- diff = ( 0, 0 , 0),
- mirror = (.9, .9, .9),
- dither = 0
- )
-
- QUADRATIC ( loc = (0, 0, 0),
- name = Z_AXIS_QUAD
-
- a = 1,
- b = 1,
- c = 0,
- d = 120,
-
- xmin = -11, xmax = 11,
- ymin = -11, ymax = 11,
- zmin = 0, zmax = 100,
-
- diff = ( 0, 0 , 0),
- mirror = (.9, .9, .9),
- dither = 0
- )
-
-
- END_INSTANCES
-
-
- { ** A pattern for the ground ** }
-
- PATTERN ( x_size = 50,
- y_size = 50,
- name = CHECK,
-
-
-
-
-
- QRT Ray Tracer Page 2 QRT Sample Programs
-
-
-
-
-
-
-
-
-
-
-
-
- RECTANGLE (
- start_x = 0,
- start_y = 0,
- end_x = 25,
- end_y = 25,
- diff = (1, .2, .2)
- )
- RECTANGLE (
- start_x = 25,
- start_y = 25,
- end_x = 50,
- end_y = 50,
- diff = (1, .2, .2)
- )
- )
-
-
- { ** The actual world starts here ** }
-
- BEGIN_BBOX
-
- BEGIN_BBOX { ** This is the lower half ** }
-
- BEGIN_BBOX
-
- SPHERE ( loc = (0, 0, 0), { ** back ** }
- radius = 20,
- diff = (1, .1, .1),
- )
-
- SPHERE ( loc = (100, 0, 0),
- radius = 20,
- diff = (1, .1, .1),
- )
-
- INSTANCE_OF ( name = X_AXIS_QUAD,
- loc = (0, 0, 0)
- )
-
- END_BBOX
-
- BEGIN_BBOX { ** front ** }
- SPHERE ( loc = (0, 0, 100),
- radius = 20,
- diff = (1, .1, .1),
- )
-
- SPHERE ( loc = (100, 0, 100),
- radius = 20,
- diff = (1, .1, .1),
- )
-
-
- QRT Ray Tracer Page 3 QRT Sample Programs
-
-
-
-
-
-
-
-
-
-
-
-
-
- INSTANCE_OF ( name = X_AXIS_QUAD,
- loc = (0, 0, 100)
- )
-
- END_BBOX
-
- INSTANCE_OF ( name = Z_AXIS_QUAD,
- loc = (0, 0, 0)
- )
-
- INSTANCE_OF ( name = Z_AXIS_QUAD,
- loc = (100, 0, 0)
- )
-
- END_BBOX
-
- BEGIN_BBOX { ** This is the upper half ** }
-
- BEGIN_BBOX { ** back ** }
-
- SPHERE ( loc = (0, 100, 0),
- radius = 20,
- diff = (1, .1, .1),
- )
-
- SPHERE ( loc = (100, 100, 0),
- radius = 20,
- diff = (1, .1, .1),
- )
-
- INSTANCE_OF ( name = X_AXIS_QUAD,
- loc = (0, 100, 0)
- )
-
- END_BBOX
-
- BEGIN_BBOX { ** front ** }
-
- SPHERE ( loc = (0, 100, 100),
- radius = 20,
- diff = (1, .1, .1),
- )
-
- SPHERE ( loc = (100, 100, 100),
- radius = 20,
- diff = (1, .1, .1),
- )
-
-
-
-
-
- QRT Ray Tracer Page 4 QRT Sample Programs
-
-
-
-
-
-
-
-
-
-
-
-
- INSTANCE_OF ( name = X_AXIS_QUAD,
- loc = (0, 100, 100)
- )
-
- END_BBOX
-
- INSTANCE_OF ( name = Z_AXIS_QUAD,
- loc = (0, 100, 0)
- )
-
- INSTANCE_OF ( name = Z_AXIS_QUAD,
- loc = (100, 100, 0)
- )
-
- END_BBOX
-
- { ** four vertical cylenders ** }
-
- INSTANCE_OF ( name = Y_AXIS_QUAD,
- loc = (0, 0, 0)
- )
-
- INSTANCE_OF ( name = Y_AXIS_QUAD,
- loc = (0, 0, 100)
- )
-
- INSTANCE_OF ( name = Y_AXIS_QUAD,
- loc = (100, 0, 0)
- )
-
- INSTANCE_OF ( name = Y_AXIS_QUAD,
- loc = (100, 0, 100)
- )
-
- END_BBOX
-
- PARALLELOGRAM ( loc = (-10000, -60, -10000),
- v1 = ( 20000, 0, 0),
- v2 = ( 0, 0, 20000),
-
- pattern = check,
- xmult = 2,
- ymult = 2,
- diff = (.1, 1, .1)
- )
-
- OBSERVER ( loc = (-50, 70, 250),
- lookat = (50, 50, 50)
- )
-
-
-
-
- QRT Ray Tracer Page 5 QRT Sample Programs
-
-
-
-
-
-
-
-
-
-
-
-
- LAMP ( loc = (70, 250, 350),
- radius = 5,
- dist = 350
- )
-
- FOC_LENGTH = 70
-
- SKY ( horiz = (0, 0, .55),
- zenith = (0, 0, .25),
- dither = 4
- )
-
-
-
- File Two
-
-
-
- {**********************************
-
- Room - brick walls and a
- mirrored sphere in the middle.
-
- **********************************}
-
-
- FILE_NAME = ROOM.RAW
-
-
- { ********* Some pattern definitions ********** }
-
- PATTERN ( x_size = 16, { ** A checkered pattern ** }
- y_size = 16,
- name = CHECK,
-
- RECTANGLE (
- start_x = 0, start_y = 0,
- end_x = 8, end_y = 8,
-
- diff = (1, .20, .20);
- )
- RECTANGLE (
- start_x = 8, start_y = 8,
- end_x = 16, end_y = 16,
-
- diff = (1.00, .20, .20);
- )
- )
-
-
-
-
-
- QRT Ray Tracer Page 6 QRT Sample Programs
-
-
-
-
-
-
-
-
-
-
-
-
- PATTERN ( x_size = 80, { ** brick pattern ** }
- y_size = 50,
- name = BRICK,
- RECTANGLE (
- start_x = 0, start_y = 2,
- end_x = 18, end_y = 23,
- diff = (1.00, .20, .20);
- )
- RECTANGLE (
- start_x = 62, start_y = 2,
- end_x = 80, end_y = 23,
- diff = (1.00, .20, .20);
- )
- RECTANGLE (
- start_x = 22, start_y = 2,
- end_x = 58, end_y = 23,
- diff = (.80, .20, .20);
- )
- RECTANGLE (
- start_x = 2, start_y = 27,
- end_x = 38, end_y = 48,
- diff = (.85, .35, .10);
- )
- RECTANGLE (
- start_x = 42, start_y = 27,
- end_x = 78, end_y = 48,
- diff = (.70, .25, .20);
- )
- )
-
-
- { ******* Now for the room itself ******** }
-
- { ** four walls ** }
-
- PARALLELOGRAM ( loc = ( 0, 0, -100),
- v1 = (100, 0, 0),
- v2 = ( 0, 50, 0),
- pattern = BRICK,
-
- xmult = .2,
- ymult = .2
- )
-
- PARALLELOGRAM ( loc = ( 0, 0, 100),
- v1 = (100, 0, 0),
- v2 = ( 0, 50, 0),
- pattern = BRICK,
- xmult = .2,
- ymult = .2
- )
-
-
- QRT Ray Tracer Page 7 QRT Sample Programs
-
-
-
-
-
-
-
-
-
-
-
-
-
- PARALLELOGRAM ( loc = (100, 0, -100),
- v1 = ( 0, 0, 200),
- v2 = ( 0, 50, 0),
- pattern = BRICK
- xmult = .2,
- ymult = .2
- )
-
- PARALLELOGRAM ( loc = ( 0, 0, -100),
- v1 = ( 0, 0, 200),
- v2 = ( 0, 50, 0),
- pattern = BRICK,
- xmult = .2,
- ymult = .2,
- )
-
- { ** a floor ** }
-
- PARALLELOGRAM ( loc = ( 0, 0, 100),
- v1 = (100, 0, 0),
- v2 = ( 0, 0, -200),
-
- diff = ( 0, 1, 0),
- pattern = CHECK
- )
-
- { ** several mirrored spheres ** }
-
- BEGIN_BBOX
-
- SPHERE ( loc = (50, 25, -40),
- radius = 15,
-
- diff = (0, 0, 0),
- mirror = (.9, .9, .9),
- dither = 0
- )
- END_BBOX
-
- BEGIN_BBOX
-
- QUADRATIC ( loc = (30, 0, -20),
-
- a = 1,
- b = 0,
- c = 1,
- d = 50,
-
-
-
-
-
- QRT Ray Tracer Page 8 QRT Sample Programs
-
-
-
-
-
-
-
-
-
-
-
-
- xmin = -10,
- xmax = 10,
- ymin = 0,
- ymax = 50,
- zmin = -10,
- zmax = 4,
-
- diff = (.7, 0, 0),
- dither = 4,
- reflect = .4,
- sreflect = 30
- )
-
-
- END_BBOX
-
- { ** An observer ** }
-
- OBSERVER ( loc = (40, 25, 30),
- lookat = (50, 0, -100)
- )
-
- { ** Two lamps ** }
-
- LAMP ( loc = (65, 70, 20),
- radius = 5,
- dist = 45
- )
-
- LAMP ( loc = (30, 55, -10),
- radius = 5,
- dist = 25
- )
-
- SKY ( horiz = (0, 0, .55),
- zenith = (0, 0, .25),
- dither = 4
- )
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- QRT Ray Tracer Page 9 QRT Sample Programs
-
-
-
-
-
-
-