s~odyirg bidd!i liii! and visible suaflee • •

20
* PBOGllftS POR BIDD!I LIII! AND VISIBLE SUaFleE lLGOBIT8!S BOBEIT C. BElCH CO"PUT1!IOR GROOP STAMPORD lCCELEB1TOB CBITER CGTft No. 155 Pebruary 191. * *

Upload: others

Post on 14-Apr-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

• •

• • • • • • *

PBOGllftS POR S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE lLGOBIT8!S

BOBEIT C. BElCH CO"PUT1!IOR GROOP

STAMPORD ~INE1B lCCELEB1TOB CBITER

CGTft No. 155 Pebruary 191.

• • • * • * •

• •

Page 2: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

~ABL! OF CONTENTS

SECTION DESCRIPTION PAGE

1 AM IITBODOCTIOI TO THE PBOGRAftS ••••••••••••••••••••••• 1

2 A DETAItED DESCRIPTIO. OP TIE PBOGBlftS •••••••••••••••• 2 2.1 RCBG! •••• GEOIE'.YC OBJ!C! GZMIRI!OR ••••••••••••••••• 2 2.2 BCBCftB ••• GEOft!TBIC OBJECt CO!8IIBB •••••••••••••••••• , 2.3 RCBHLR ••• HIDD!I LIt! RIIO'.& •••••••••••••••••••••••• 5 2.4 RCBYSP ••• YISI8L! SUIPACE PBOCESSOI •••••••••••••••••• ~ 2.5 RCBBPG ••• BIG PIC!UBI G!I.II!OR •••••••••••••••••••••• 10 2.6 RCBPIC ••• IRTEBICTI'E PICTOI! GIIIIITOB •••••••••••••• 11 2.7 RCBDRV ••• tII! DBlWIIC GIIIIITOH ••••••••••••••••••••• 12

1 PBOGllftftIRG !ll"PLES •••••••••••••••••••••••••••••••••• 14 ].1 LII! DRAWING OF THE PlY! PL1TOIIC SOLIDS •••••••••••• 14 3.2 RALP TOM! or TIO I.~!BI0C~ED TORI ••••••••••••••••••• 16

!he teztual part of this docu.ent vas foraatted usinq the POR"lT ~est Processinq Proqraa. Pi~ure 1 vas drawn on the 10 incb CALCO"P Oro. Plotter and this dravinq vas then photoqraphicall, reduced. Piqure 2 vas .ad. fro. a pho~oqraph of the face of the CRT on the Glr-IDIIOft.

Page 3: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

SECTION 1: AN YITBODUCTION TO THE PPOGRA"S ,

In recent years, .ueb has b@@D written about the production of realist-Ie pictures of 3-dl.ensional ob1ects on a co.puter. So.e of the discqssion has centered OD pro4ucinq line-drawn fiqures (see Fiqare 1) and others have talked about producinQ balf-tone pictures ,se~ Fiqur@ 2). The pur~os~ of the proqrams described in this docu.ent is tvofold:

1. To study the yariou~ published alqoritbms and provide a aeaDS b, which the properties of these alqoritb.s could be co.pared.

2. To study the production of line-drawn and half-tone pictQr~s on the equip.ent ayailable at SLAC.

The s@y@n prooraas which are described in this document can be diyided into three classes:

1. ProQraas RCBGER and BCBCMB arE qeometrie data proqrams. ReBGEN will oenerate descriptions of aeometric ob1ects and RCBC"5 can be used qeoaetric ob1ects toqether ~o for. more ob1ects.

preparation so.e s1aple to cOMbine co.plicated

2. Proarams ReBRtR and RCBVSP viII apply hidden line and visibl~ surface alaorith.s to the qeo.etric data. Thes~ proqrams can qenerate pictures directly on the printer, or they can save the picture for processinq b, a later proqrall.

]. ProCJraas RCRBPG, RCBPIC, and .RCBDRII accept pictures Qenerated by the precedinq proara •• and produce pictures by various .eans. RCSBPG will produce larqe line-drawn or half-tone oictures OD the priDter. RCBPIC displays line­drawn or half-tone pictures on the GIP-YDIIO" display consol~. RCBDRW viII produce line-drawn pictur@s on YarioQs offline devices. Proaraas RCBPIC and RCBDRW use the SLAC Unified Graphics SYstem to qenerate their pictures.

Page 4: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

SECtION i: : A DETAILED D,ESCRIPTION OF 7Hft PPOGW'.;~.$ .. . ~., . 2

The PEi •• r. input to these proqraas consists of card iaages with key cards identified with a './' in coluans 1-2 aDd an identification in C01U.DS 1-'. the re.ainder of a kef card .ay contain any appropriate paraaeters, and certain types of key cards .ay be followed by data cards containinq additional information. Most of the prOQra.s will trar.sfer an, card that it does not recoQnize ,to its output file. In addition, aost of the proqra.s recoGnize a key card identification of •••• as a card which is to haY9 coloaas 5-72 shif~ed into colu.ns 3-70 before it is written into the oatput file. These two properties .ake it possible to execute a nu.her of proqrams on a sinqle co.puter ioh: each proQram's output file becomes the DP.xt pro~ra.'s input file. A kef card is not processed until a ~roqra. reeoqni2es it. If .ore than one proqraa in a co.puter 1cb would recoqnize a key card, it can be passed to the proper proqram usinq the •••• key card option.

~he for.at of the oeo.etric data required hy the hidden line and .isible surface proqra. is essentially the sa.e. ·Points· are defined b, qiYinQ their X, Y, and Z coordinat.es in space. A "line" is specified by qivinq the indices of its end points, thus a line could he dQfined by statinq that its end pOints ver~ points _ and 7. The order of the end points of a line is not sionificant. 1 "surface" is defined by qivinq the indices of the lines wbich hoond it. A surface must fora a planar polyqoD in space. Parther, for .ost alqorithws. the order of the lines is i.Dortant: they mast be qiven in a counter-clockwise direction as seen fro. the outside of the polyhedron it foras. This orderiDq of the boundry lines results in a plane surf~c~ whose nor.al vector is directe~ outward fro. the Dol'he~ron. A "solid ho~," is defined by qiYiaq the iDdices of the surfaces which fora it. Par soae alqorithas, a solid boa, .a, b4 nothinq aore than a collection of surfaces, tor otbers it .ust form a coaplete polyhedron, for still others the ~olYhedron mu~t be convex. Pinally. so.e alqorith.s require separatinq planes which separate the pol,hedra into different sectors of space.

SECTION 2.1: RC8GlN ••• GEO~ETFIC OBJECT GFNEftATOB

This proqra •• il1 accept specifications of certain qeo.~tric obiects in its input file (SYSII) and will qenerate sets of data cards that ~efine points, lines, surfaces, solid bodies, and

.,....... separatinq planes tor these ob1ects. These dat.a cards are put into the output file (SYSOOT). The recoqnizable key cards and their associated parameters are:

.leR Proara. control. The key card contains the no_bers PH! and opp whose fUDction is as follows:

PRP Print control flaq.

Page 5: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

fr'

o 1

OPF o

Do Dot print the output file. Print the output file.

Output control flaq.

3

00 not generate the output file. This option will supress the creation of the SYSOUT data s~t.

1 Generate the outnut file. The default values of PRY and opr are 0 and 1 respectively •

• /LV Leyel control. The ke, card contains the nu.bar .LV whose function is:

Ntv The no.her of double periods to be put between the './' and the kef card identification on the qenerated cards.

The default value of NLV is zero • • /TB Produce ~ata cards for a reqular tetrahedron. The ke,

card contaiDs the nUMber BAD whose function is as follows:

./CU

./CC

./DC

./IC

• /SD

BAD The radius of the circa.scribed sphere. The tetrahedron is centered at the oriqin. The data produced by this card consists of a sinqle solid body and no seoaratinq plan~s. Produce data cards for a cube. This key card works the sa.e as the ./TR card. Produce data cards for a regular octahedron. This key card works the sa.e as the ./~R card. Produc~ data cards for a reQular dodecahedron. This key card works the sa.~ as the .'fR card. Produce data cards for a regular icosahedron. This key card works the sa.e as the ./TS card. Produce data cards for a reqular stellated dodecahedron • The ke, card contains the nu.bers SPF and BAD whos@ function is as follows:

spp S~paratinq plane flao. o Produce one solid body and no separatinG planes. 1 Produce a fiqure composed of 12 convex hodies

with 12 separatinq planes. RAD Th9 radius of the circu.scribed sphere.

The stellated dodecahedron is centered at the origin • • /TO Produce data cards for a torus. The key card contains

the numbers SPF, NLO, Ntl, RD1, and BD2 whose function is as tollows:

SPF Separatino plane flaq. o Produce one solid hod, and no separatino pl~n~s. 1 Producp. a fiqure composed of NLO convex bodies

with the appropriate nu.her of separatinq planes. The nu.ber of separatinq planes will be NIO if ItO is odd, and NLO/2 if NtO is even.

Ito The number of lonqitude lines on the torus. ItA The nu.her of latitude lines on the torus. RD1 The aean radius of th9 latitude lin~s. RD2 The radius of a longitude line.

The torus is centered at the orioin with its axis of sy •• etrv alonq the z coordinate axis •

• 1.. This card will have colu.ns ~-72 moved into coluaDs 3-70 with columns 71-72 set to blanks. The card is then transferred to the output file.

Page 6: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

4

SEttION 2.2: ~CEC!B ••• GEO"E'RIC OBJECT CORBI.ED

!his proqra. will accept the points, lines, surfaces, solid todies. and separatinq planes for a pair of ob1ects in its input file (SISII). aerqe this data toqeth~r into a sinqle set of data cards. and vrite these data cards into its output file '(SYSOOif). ~be indi.idual ob1ects .a, be sub1ected to a qeneral affine transforaation. The recoqnlzable key cards and their associated paraaeters are:

./CB Proora. control. The key card contains tbe ou.bers PRF and opr whose fuuction is as follows:

PRP Print control flaq. o Do Dot priot the output file. 1 Print the output file.

opr Output control flaq. o Do not qenerate the output fi~e. This optioft

vill supress the creation of the SYSOUT data set.

1 Generate the output file. The default values of PRF and OPF ara 0 and 1 respectively •

• /IV Leyel control. The key card contains the nu.her ILV whose function is:

NLV ~he nu.her of double periods to be put between the '.1' aDd the key card identification on the aenerated cards.

The default value of It' is zero • • /PT Point data. The key card contains the number WPT whose

function is: RPT The nuaber of poiats 00 the followino data cards.

The data cards co.tala the definitions of the points. Each point is defined by its I, I, and Z coordinates •

• /IN tine data. The key card contains the nu.ber NLM whose function is:

11" The Du.ber of lines on the followinq data cards. the data cards contain the definitions of the lines. Each line is defined by a character strinq of one character and the indices ot the end points of the line •

• /50 Surface d~ta. The key card contains the nu.bers ISO and sso whose function is:

ISO The nuabp.r of surfaces on the followinq data cards.

~SU The maxi.o. number of boundary lines that are contained in any of the surfaces.

The data cards contain the definitions of the surfaces. Bach surface is ~efined bv th~ number of boundary lines in the sur.face followed by the indices at tbe bounda,v lines •

• /SB Solid body dats. The key card cont~ins the nu.bers NSB and ~SB wbose function is:

ISB The number of solid bodies on the following data cards.

"S8 The .axi.uI nu.her of surfac~s that are contained in any of the solid bodies.

The data cards contain the dp.finitions of the solid bodies. Each solid body is defined by the nu.ber of boundinq surfaces in the solid bodies followed by the

Page 7: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

inrlices of the boundinq surfaces • • /SP Separatinq plane d~ta. The key card contains the no.her

asp whose function is: asp Th~ Du.her of separatinq ~lanes on the followinq

data cards. The data cards contain tbe defiaitiofts of the separatinq planes. Each separatinq plane is defined b, either (1) a zero followed by its equation or. (2) th~ index of a surface •

• /ft1 The affine transforaation aatrix for the first ob1ect. The follovinq data cards contain the 12 numerical values of the transfor.atioD which are used in the equations:

XI:A( l)*X.A( 2).Y+l( 3)*Z+A( 4) Y':A( S,*X+A( 6).Y+A( 7)*Z+A( 8, ZI=A( 9)*X+I(10)*Y+A(11)*Z+1(12)

Normall, th~ d~ter.inant of the coeficients should b@ positive. A zero deter.ininaDt indicates a degenerate transformation and a neqative deter.lnant reverses the surface nor.al v~ctors and turns solid ob1ects inside­out. The default valu€ is the identity .atrix •

• 1"2 The affine transfor.ation .a~rix for the second ob1ect. The following data cards contain the 12 numerical values. The default value is the identit, .atria •

• /81 This card siqnals the end of the first qeoaetric oh19Ct. After readinq this card, the proqra. will be ready to accept the second ob1ect •

• /E2 This card siqnals the end of the second qeo.etric object. After reading this card, the proqraa viII Qenerate th@ co_bined ob1ect and then becoae ready to accept another firs~ ob1ect. The data for either ob1ect .av b~ vacuous •

• 1.. This cari vill have colu.ns 5-72 moved into coIn.ns 3-10 .ith columns 71-72 set to blanks. The card is then transferred to the oatput file.

SECtION 2.1: RCBHLR ••• HIOOEN LINE RE"OYEB

This proqram vill accent sp~cifications of thr@e di.ensioual ~ol,hedra in its input fil~ (SYSIN) and will apply various hidden line alqorithms to produce a tvo-dimqnsional pictur~ of the pol,hedra. The picture aay be sent to the printer or saved in an out~at filp (SYSOUTl for processinq by a later proqra •• Ex~cutioD times and other statistics will be accu.ulated for critical sections of the alaorithms. The recoqnizable key cards ~nd their associated para.et.ar~ ar~~

./T1 The firs~ line of title for the printed output. The title is in card colu.ns 5-72 •

• /T2 The second line of title for the printed output • • /T] Tbe third line of title for the printed output • • /Tt Int~rnal tolerance cbanqes. ~he key card contains the

numhprs TL1, Tt2, and Tt3 whose function is as follows: TLl A point is assu.p.d to be on a plane if the point

to plane distance is s.aller than TL1. . Tt2 A dot produ~t is assu.ed to be zero if it is

s.aller than Tt2.

-

Page 8: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

6

Ttl A poiDt on a liD~ segaeDt .hose para.etric value is witbin TLl of zero or one is assumed to be coincident with an end point.

The aefaolt walues of Ttl, Tt2. and TLl are 0.002. 0.0002. and 0.002 respectively •

• /SI Internal buffer 8i2e chanqe. The key card contains the Do.bers Bll and BZ2 whose function is as follows:

BZ1 Si2e of a push-down buffer in the line-surface co.parison alqorith.s. If a line is divi4@d into .ore than BZ1 seq.ents. excesslye co.pute t18e .ay result.

DZ2 Si%e of initial line-intersection buffer in the edqe tracinq .odes. If a pro1ected line is intersected by .OE~ than 8Z2 extre.e lines, exc~ssiwe co.pnte tl.e .ay result.

The default values of PZ1 and BZ2 are 10 and 5 respectiYely •

• /PT Point data. The k~y card contains the nu.ber IPT whose function is:

NPT The nu.ber of poiats OD th~ fo11ovinq data cards. The data cards cOD~aiD ~he definitions of the points. Each point is defined b, its I. !. aad Z coordinates •

• /LM Line data. The key card contains the nn.ber NtH whose funct.ion is:

ILl The nu.ber of lines on the followlna data cards. The data cards contain the definitions of the lines. Each line is defined by a character string of one charact@r and the indices of the end points of the line. The character should be an 'N' (for nor.al, or a 'C' (for construction). construction lines are always invisibl~: they are useful when non-convex bodies .ust be ~ivided up into con.ex bodies •

• /50 Surface data. The key card contains the nn.bers NSO aDd "SU whose function is:

ISU The number of surfaces on th~ followinq data cards.

"SU The maxi.u. nu.ber of boundar, lines that are contained in any of the surfaces.

The data cards contain the definitions of the surfaces. Each surface is defined "~V the no.ber of boundary lines in the surface followed by the indices of the boundary lines •

• /S8 Solid body data. The key card contains ~he nn.bers NSB and "SB vhos~ function is:

ISB The nu.ber of solid bodies on the followinq data cards.

~s~ The .axiMu. nUlh~r of surtac@s tbat are GontQi»e~ in any of the solid bodies.

The data cards contain ~he definitions of the solid bodies. Each solid bod, is defined by the nu.ber of boundinq surfaces in tha solid bodies followed by the indices of the houndinq surfaces •

• /SP Separatinq plftne data. The key card contains the nu.ber MSP vhosp. function is:

ISP The nu.ber of separatinq planes on the followinq data cards.

The data cards contain the definitions of the separatinq

Page 9: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

·/80

7

planes. Each separatinq plane is defined by either (1) a zero followed b, its equation or, e2l the index of a surface. Vlev data. The followinq cards contain (1) a proiective reference point, (2) yiew direction. (3) hori%ontal direction of the proiectioD screen (or zeros if a vector parallel to tbe I-I plane is to be supplied" (4) eye offset. (5) screen dleta.ce, and (6) a screen size. This card causes a hidden line alqorith. to be iDvoked. the ke, card contains the no.bers PH'. RLP, aDd opr whose function is:

PRP Print control flaq. o Print titl@s and eIecutlon results only. 1 As above, but also print separation and priority

aatrix (if available). 2 As aboYe, but also print all input data. ] As above, but also pIint the output line

seq.ents. HLP HiddeD line al~orl~h. flag. This itea selects the

alqorith. to be applied. 1 Generate the picture without reaoYina an, bidden

lines. 2 Assu.e that the polvheara consists of convex

bodies which do not hide each other. 1 Co.pare lines with surfacee assu8ing that the

pol,hedra consist of CODveK bodies with se~aratinq plane data.

• Co.pare lines with surfaces assaainq that the polyhedra consist of solid bodies.

5 Co.pare each lioe with each surface. 6 Do edqe tracinq assa •• inq that the polyhedra

cODsist of solid bodies. OPF output control flaq. o Suppress all picture output. 1 Put the picture OD the printer. 2 Write the picture to the output data set. The

cards are punched with up to four line seq_ents per card (./IB carda) with a special terainator card fa ./IB card).

This card causes all points, lines, surfac~s, solid bodies, and se~aratinq planes to be deleted. All internal parameters are re-set to their default values. This card viII have coloaDS 5-72 moved into coloaDS 3-70 with columns 11-12 set to blanks. The card is then transferred to the output file.

A surface is called a "front face" if its noraal vector points toward thp observer, otherwise, it is a "back face". The alQorith. that assn.es that the polyhedra are convex bodies which do not hide each other is trivial: a line is full, visible if it is a boundar, of a froat face, otherwise, it is fully invisible. The alqorithas wbich co.pare lines and surfaces vork at various levels of sophistication. Lines on solid bodies which are co •• on to two back faces are inYisible, the reaainino lines need oDly be co.cared aqainst froot faces. When separatinq planes are used, a furtherr~duction in coaparisons is possible because the separatinq planes allow the proqraa to deci~e that som~ convex

Page 10: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

8

bodies do not hide others. Tbe edqe traCiDQ alqorithm vorks bV defininq "extreae edqes" as those lines CO •• OD to a front face and a back face, and the "ioYisibillt, index" of a point as the nu.ber of front faces hidiD~ the ~oint. Pirst the invisibility index of an, selected point is deter.ined. working in the picture coordinate syste., a line endinq at this point is intersected with all of the extre.e ed~~s because these are the oni. points alonq the line where the invisibility index can chanqe. This qives the invisibilit, index.at all points alonq the line, includiDQ the opposite end point. This edqe tracinq scheae is continued until all lines haye been processed. The picture consists of all line seq.eats with an inyisibility index ot 2ero.

SECTION 2._: RCBV5P ••• 'ISIBLE SORlACE PRCC!SSOB

This proqram will accept specifications of threE dia.nsional polyhedra in its input file fSYSIN) ana vill apply yarious visible surface alqorithms to produce a tvo-di •• nsional picture of th~ ~ol.hedra. The picture may be sent to the priater or say~d in an output data s~t (SYSOOT) for processinq b, a later proqra.. Ezecution timp,s ~nd other statistics viII be acco.ulated for critical sections of the alqorithas. The recoqnizable key cards and their associated paraaeters are:

./T1 The first liD~ of title for the printed output. The title is in card cola.as 5-72 •

• /T2 The second line of title for the printed output • • /13 The third line of title for the pEiDted output • • /Tt Internal tolerance chanqes. ~he key card contains the

number TL1 whose function is as follows: TL1 A point is assu.ed to be on a plan~ if the point

to plane distance is s.aller than TL1. The default yalue of Ttl is 0.002 •

• /PT Point data. The key card contains the nu.ber .PT whose function is:

MPT The nu.ber of points on the followinq data cards. The data cards contain the definitions of the points. Each point is definp.d by its I. Y. and Z coordinates •

• /11 Line data. The key card contains the numb@r NtM whose function is:

It I The nu.ber of lines The ~ata cards contain the Bach line is define~ by ch~ractar and the indie~s of The character is ianored •

on the follovinQ data cards. definitions of the lines. a character strina of one the end poin!s ol tLe l!n~.

• /50 Surface data. The key card contains the nu.bers ISU and "SO wbose function is:

ISU The nu.ber of surfaces on the fcllowina data cards.

~su The maxi.a. numher of boundary lines that ar~ contained in any of the surfaces.

The data cards contain the definitions of the surfaces. Each surface is defined by the Do_ber of boundary lines in the surface followed by the indices of the boundary

Page 11: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

lines • • /S8 solid body data. The key card contains the nuabers NSB

aDd "5B whose function is: ISB The nu.her of solid bodies on the followinq d~ta

. cards. MSB The aaKiau8 nuaher of surfaces that are contained

in any of the solid bodies. The data cards contain the dafinitions of the solid bodies. Each solid bod, is defined by the Duaber of boundinq surf8ces in the solid bodies followed by the indices of the boundinq surfaces •

• /SP separatinq plane dat8. !he key card contains the nuaber ISP whose function is:

ISP The no.ber of separatinq planas on the followinq data cards.

The data cards contain the definitions of the separating planes. Each separatinq plane is defined by either (1) a zero followed by its equation or, (2, the index of a surface •

• /Vi Yiew data. The following cards contain (1) a projective reference point. (2) view direction. (3) horizontal dir~ction of the pro1ection screen (or 2ero~ if a vector parallel t.o the I-I plane is to be supplied), (II) efe offset. (5) screen distance, and (6) a screen size •

• /se Shadinq coefficient chanqe. The ke, card contains the n •• ber SCP whose function is as follows:

seF The qra, level of a surface is proportional to (COS(AIG)) •• SCF Where lNG is the anqle bet.een the surface nor.al and the vievinq direction.

The default Yalue is 2 • • /Pp Punched output paraaeter chanqes. The key card contains

the nu.hers XRL, YBt, and GLV whose function is as follows:

tRL The horizontal ~aster li~its are 0 to XRt. YRL The vertical raster limits are 0 to tRL. GLV The oray levels extend fro. 1 to GLV.

The default values of IRL, 18L, and GLV are 1023, 1023, and 16 respectively. The default (and uDchangeable, values for printed output are 99, 59, and 16 •

• /BO This card causes a visible surface algoritb. to be invoked. The kp.V card contains the numbers PRF, 'SF, aad opp whose function is:

PRF Print control flag. o Print titl~s and execution results only. 1 As above, but also print separation and ~riority

.atri~ (if availabl~). 2 As above, but also print all input data. 1 As above, but also print the output sub-scans.

'SF Visible surface alqorithm flaq. This ite. selects the alqorith. to be applied.

J Ob1@ct ordering assuainq that the polyhedra consist of CODyeX bodies with separa~inq plane data.

II Obiect orderinq assu~inq that the polyhedra consist of solid, convex bodies with separatinq plane data.

opp Output control flaq.

Page 12: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

10

o Suppress all pic~.re ootput. 1 Put the picture on the printer. 2 write the picture to the output data set. The

cards are punched with up to'eiqht sub-scans per card (./YB cards) with a special ter.inator card fa ./YE card) •

• /et This card causes all points, lines. surfaces, solid bodias. and se~aratiDq planes to be deleted. III internal para.eters are re-set to their default .alues •

• 1.. This card viII have colo.ns 5-12 .o.ea into coloans 3-70 with coluans 11-12 set to blanks. The card is then transferred to the output file.

The ob1ect orderinq alQorithas work by first deteraininq an orderinQ of the CODvex bodies, such that aD ob1ect later in the list cannot bide an earlier one. There .ost be enouqb separating planes to accoaplish this ordering. The picture is then qeDErated. one horizontal scan line at a ti.e, by startinq at the fartherest ob1ect. and puttinq its partial pictare into the scan line buffer. As other ob1ects are pat into the scan line buffer, they aa. replace partial pictures already there. The result is a scan line with only visible iteas in the buffer.

S!CTION 2.5: RCBRPG ••• BIG PICTURE GEN!R1TOa

this proqra. will accept data cards in its input file (SYSIN) that haye been produced by tbe hidden line or visible surface proqEaas and vill produce a aosaic picture on tbe printer. Each printer paqe produced by this proqraa is a 10 incb by 10 inch section of the coaposite picture;' they may be cut out aDd aasE.bled into one larae picture. An output file (51500T) .ay be written for passinq infor.ation to a later proqra.. The recoqnizable key cards and their associated para.et.rs ar8:

./IS This card siqnals the start of a picture produced. by the hidden line proqra.. The key card contains the Du.hers ILO, XHI, leT, YLO, THI, and yeT whose function is as follovs:

Ito The X yalue of the left hand side of the picture beinq qenerated.

IH1 The I value of the riqht ban~ side of the picture beinq qenerated.

leT The no.her of 10 inch sections in the X direction of the co.posite picture.

ILO The' yalue of the bottom of the picture. IHI The Y value of the top of the picture. ICY The nu.ber of sections in the Y direction.

Followinq this card should be a group of ./IB cards and a ter.inatinq ./IE card. The picture is qenerated from the information on the ./Ie cards •

• /XB This is a picture data card produced by the hidden liop proqram. Columns 5-6 contain a count of the nu.ber of line seq.ents on the card. columns 8-72 contain the end points of the line seqMents in floatinq point hex for.at. The coordinates assuae a picture with (XLO,YLOl as the

Page 13: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

11

lower left corner and (181.181) as th@ upper riqht corner •

• /I! This a ter.inator card for the ./18 cards • • /ts This card siqnals the start of a picture produced by tbe

.isible surface proqra.. The key card contains the no.bers XLB. ICT. tLI, and yeT whose function is as follows:

ILl The I raster yalue of the left haDd side of the picture beinq qenerated.

ICT The nu.ber of 10 inch sections in the I direction of the co.posite picture. Each 10 inch section contains 100 raster units.

!LK The I raster yalue of the botto. of the picture. JeT The nu.bar of sections in the Y direction. Each

section contains 60 raster units. FollovinQ this card should be a group of ./IB cards and a terminatinq ./YE card. The picture is qenerated fro. information on the ./YB cards •

• /Ie This is a picture data card produced bV the Yisible surface proqram. Colu.os 5-6 contain a count of the number of sob-scans on the card. colu.ns 8-12 contain th~ sub-scans in fixed point hex for.at. A sub-scan is a horizontal line of consistent int~nsit,. It is defined by the X and t coorainate of its left hand end, its horizontal lenath in raster units, and its intensity •

• /Yl This is a terminator cara for the ./fB cards • • /.. This card viII have colu.ns 5-72 moyed into colo.os 3-10

with colu.ns 71-72 set to blanks. The card is then transferred to the outpu~ file.

This proqra. requires a te8Porary file (StSUT1). A tfPical DD card is:

IISYSUTl DD DSM1"E:&&SYSU'1.DISP=(NBI.DELETf), II ONIT=SYSDA,SPACE=(TRK,20), // nCB=(RECP":'B,LBBCL=80.8LKSIZE=7200)

The space parameter must be larae enonqh for the file to hold all of the cards for the larqest picture.

S!C!ICN 2.6: BCBPIC ••• INTEBICTIY! PICTURE GENE5ATO~

!his proqram will accept data cards in i~s input file that have been produced by the hidd~n line or visible surface proqra.s and vill produce th@ pictures on the GIP-IDIIOft display console. These pictur~s aav then be pbotcqraDh~d with the Polaroid camera. The proqram operates in a completely interactive .ode; the console operator may chanqe so.e basic paraaeters, select a line drawn or raster scan test pattern, or select a picture fro. the input file. The recoqnizable key cards and their associated paralleters are:

./IS This card siqnals the start of a pictur4 produced ty the hidden line proaraa. The key card contains the nu.bers· ItO. IH1, YLO. and YHI whose function is as followE:

110 The X value of the left hand side of the picture beinq qenerated.

Page 14: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

12

IHI The X value of the riqht hand side of the picture beinq qenerated.

fLO The Y value of the botto. of the picture. 'HI The I value of the to. of the picture.

Pollowinq this card should be a qroup of ./18 cards and a terainatinq ./IE card. The picture is qenerated fro. tbe infor.ation on the ./XB cards •

• /IB !his is a picture data card produced by the hidden line prOGram. COIU.DS 5-6 contain a count of the nu.ber of line seq.ents on the card. coluans 8-72 contain the end points of the line seq.ents in floatina point .ex for.at. The coordinates assu.e a pict.re with (ItO.YLO) as the lower left corner and (IHI.IBI) as the upper right corner •

• /IE This a terminator card for the ./IB cards • • /TS ~his card siqnals the start of a picture produced by the

wisible surface proqra_. The kef card contains the nu.bers I~t and '~L vhos~ function is as tollows:

IBL Th~ raster unit aultiplier for tbe I direction. IftL The raster unit aultiolier for the I direction.

Pollowinq this card should be a qroup of ./YB cards aDd a terainatinq ./YE card. The picture is qenerat@d fro. information on the ./YB cards •

• /YB This is a picture data card produced by the .isible surface proqra.. Coluans 5-6 contaiu a COUDt of the nUMber of sub-scans on the card. Colusns 8-72 contain the sub-scans in fixed point hex for.at. A sub-scan is a horizontal line of consistent intensity. It is defined by the X and Y coordinate of its left hand end, its hori2ontal lenQth in raster units, and its intensity •

• /YP. This is a terminator card for the ./tB cards.

This proqraa requires a te8Porary file (SYSOT1) and a card to define the display console (GIFtIN!). Typical DD cards are:

IISYSOT1 DD DSNA"E=65SYSOT1.DISP=(N!I,D!LET!), II UWIT=SYSD1,SPAC!=(TRK.20" // DC8:(RECP~=PB.LB!Cl=80,BLKSIZR:7200) IIGIPLIIK DD URIT=GIP

7h~ space paraseter must b~ larqe enouqh for the file to bold all of the cards for the largest picture. Actually the DD na8e for hoth the inout and the utilit, file lIay be entered at the console. This means, tor aKa_ple, that multiple ~icture files say be processed on a sinql~ co.poter run.

SECTION 2.7: RCBDRW ••• LINE DRAWING G!NERATCR

This proqra. viII accept data cards in its input file (SYS!I) that have been produced by the hidden line proqraa and viII produce line drawinqs on varioos graphic devices. Th~ recoqni2able key cards and their associated para.eters are:

./11 Output de.ic~ selection. This card lIust be the first card in the input deck and anI, one such card should be qiYen. The key card contains the Dusber EXT whose function is as follows:

Page 15: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

13

EIT output deYice type. 1 The output is to be sayed in a partitioned data

set in dey ice independent fora. 2 The output is to be generated for the 10 inch

CILCO"P dro. plotter. 1 The output is to be qenerated for the 29 inch

CALCORP dru. plotter. 4 The output is to be qenerated for the

T!ITROIII 4013. A DD card for the output file (SISOO!) must be supplied •

• /IS this card siqnals the start of a picture produced by the hldden line proqraa. The ke, cera contains the Du.bers Ito, lHI, ILO, and YHI whose function is as follo •• :

ILO The I value of the left hand side of the picture beinq qenerated.

IH! The X value of the rlqht hand side of tbe picture beinq (u~n.rated.

ILO The Y value of the bottom of the picture. !HI The Y yalue of the top of the pictur@.

Pollowinq this card should be a group of ./IB cards and a ter.inatinq ./X! card. the picture is qenera~e4 fro. the inforaation on the ./IB cards •

• /Xf This card siqnals the start of tex~ inforaation which is to be added to the picture. The follovinq cards contain (1, the X coordinate of the center of the first character, (2) the Y coordinate of the center of the first character, (3) a character strinq containing the spacinq data, (4) the priaary character strina, aDd (5) the secondary character strinq •

• /IB This is a pictnre data card produced by the hidden line proara.. Coluans 5-6 contain a count of the nu.ber of line seq.ents on the card. Coluaas 8-72 contain the end pOints of the liDe seq.ents in floatinq point hex for.at. The coordinates assu.e a ~icture _ith (ILO,YLO) as the lover left corner and (XHX.YBI) as the u~per riqht corner •

• /IP. This a ter.inator card for the ./IB cards.

~his proqra. requires a DD card for tbe output file (SYSOUT,. Th~ for.at of this OD card depends OD the output de.ice and is described in the docu~entation for the SLAC Unified Graphics Systell.

Page 16: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

SECTION 3: PBOGBAftftIIG EIA"PLfS 14

This section contains so.e esa.ples sbowing how tbese proqraas aav be used. These exa.ples include the co.plete Jet that is required to run the proqra ••

SECTION 3.1: LINE DRAIIIG or THB PlY! PLAtOIIC SOLIDS

~his eKaaple de.onstrates the use of the hldd4D liDe re.over. 1he first step in yokes the data genarator to create data describinq a tetrahedron, cube, octahedron, dodecabedron, aad icosahedron. The next three steps inyote the co.biDer proaraa .bleh .OY8S ADd combines the ob1ects into a sinqle conqlowerata. Then, the hidden line re.over is in.okei. !he input data to the hi~den line reao.er consists of 50 points, qO lines, 50 surfaces, 5 con... bodies and 4 separating olanes. !his data is processed twice: the first tiae the picture Is ~rl~ted and the second tiae it is written to the output file. The final s~ep invokes the lin~ drawinQ proqra. which creates the picta~e on the CILCOft. drua plotter.

IIBCB5PS II*SETUP

JOB

IIJOSLIB no II DD IIGENGO EXEC IISYSPRttlT DD IISfSOOT DD II

• RCB'CG' ,CLASS=B U"IT=TAPE7,YOL2PLO~AP,RING.'L DSN1ME=VYL.CG.RCB.PICSTDY,DISP:(SHR,PASS, DSllftl=WYL.CG.BCB.UGILIB,DISP=(SHR,P1SS, PGft=RCBGE" S!SQUT=A DSI1M!=&&CARDS1,DISP=(NIV,PASS), U'IT=SYSDA,SP1C!=(~RK.50"

II IISIstl .1'11 ./t2

DCB=(8ECP"2PB,LRECL=8Q,BLKSIZE:72001 on •

.I'll

.1 •••••• M1

THE PI'! PLATONIC SOLIDS ~ETRAHEDROR. C~8E, OCTAHEDBOI, DODECAHEDRON, AND ICOSAHEDROI

100 0 0 100 001 0 ./ •••• Pl1

100 0 0 100 001 0 ./ •• ~1

-1 0 0 -4 0 -1 0 0 0 0 1 0 ./!~ 1 .l •• ll .1 •• P12

1 0 0 -2 0 1 0 0 0 0 1 0 ./CU 1 ./ •• P2 .1 •••• !1 .1 •••• "2

1 0/ 0 0 C 1 0 0 0 0 1 0

Page 17: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

1""'. .1 •• "' 1 o 0 0 0

./OC 1

.1 •• !1

.1 •• "2 1 o 0 2 0

./DD 1

.1 •• 22

.1 •••• El

.1 •• •••• E1

.1 •••••• "2 1 0 0 If 0

./LV 2

./Ie 1

.1 •••••• E2

.I •••••••• SP o 1 0 0 -] o 1 0 0 1

.I'Y

1 0 0 0 0 , 0

1 C 0 o 0 1 0

1 0 0 o 0 1 0

4 o 1 0 0 -1 o 100 3

10.5 q.s 4.0 -8.5 -4.5 -3.5 1.0

0.0 0.0 0.0 0.0 13.0

./IX 2

./IS 0.0 1.0 0.0 1.0

./IT 0.1 0.9 'SP1CIIG=0.OS' 'THE 5 PLATO.IC SOLIDS' 'Lt tlLLLLt LLLLL'

./BO

./RU

./Ct

1 ] 1 o ] 2

IICftBG01 EtEC IIS!SPRINT DD IISYSOOT DD II II /IStSIM DO IICftBG02 EIEC IISYSPRIIT DD IISYSOUT DD lIStS II DD IICP!BGOl EXEC /ISYSPRINT DD IISISOOT DD IISYSII DO IIHIRGO EXFC IISISPRIIT DO //S'SOD1 DD IISISTI DD IIDIHiGO EXEC IISYSPRINT DD I/SISODT DD II

PGfI:::BCBCftB SISOO!:l DSNAftE:&&C1JD52,DISP=(NII,PASS). UNIT=SYSD1,SPAC!=(TRK,50), DCB=(RECF"=PB,LIECL:80,BLKSIZE=7200) OSllB!=&&C1IDS1.DISP=(OLD,P1SS) PGft=RCBCflB SYSOD'I=A DSNlftE=&&CABDS1,DISP:::(OLD,PISS) DSIAftE=&&CARDS2,DISP=(OLD,PASSl PG!=RCBCftB SISOUT=1 DSHAftE=&&CABDS2,DISP=(OLD,PASS) DSNlftE=&&CIBDS1,DISP=(OLD,PISS) PGN=8CBHLR,BEGION=115K STSOUT=A DS'A"!=&&CABDS1,DISP~(OLD,EASSJ DSN1~!=&&CABDS2,DISP=(OLD,FASS) PG"=RCBDBW SYSOOT=A DSNA"!=&&PLOT,DISP=(NEI,PASS), 'OLU"E=SE~=PtOTIP,UNIT=TAPl7,LABFL=(l,NL) ,

II IISYSIN 1/

DCB=(RECFM=U,BLKSIZE=lDOO,DEN=O) DO DSNA~l=&&CARDS1,DISP=(OLD.P1SS)

15

Page 18: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

16

The 5 PlatonIC SOlIds

Piaure 1: Pinal output froe ~be Hidden Line ie.oyer.

slettoN 3.2: BlIP ~ONE or TVO IIT!RLOCKIC TORI

This exa.ple de.onstrates the use of the Yisible surface processor. The first step iDvok~8 the data qenerator to create data describinq tvo tori. 7he next t.o staps iDyoke the co.hiner proqraa. The first co.biDer step .oyes and co.bines the tvo tori, the second step adds soae separatinq planes to the conqlomerate. These extra separatinq planes are necessary because the ~enerated separatinq planes are not sufficient to qive a co.plet~ orderinq of the iadiyidusl conyex bodies. The next ste~ invokes the visible surface processor. The input data to the yisible surface processor con8i8ts of 280 points, 560 lines. 336 surfaces, 28 convex bodies, and 21 separatinq planes. ~his data is processed twice: the first ti.e the picture is printed and the second tiae it is qenerated for a 1024 by 1024 raster unit displa, and written to the output file. The final step inyokes ~he interactjYe picture qenerator which allows the console operator to view the pictures on the GIF-IDIIO" display

Page 19: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

console.

IIHee2IT JOB IIJOBLIP. DD II DD IIGENGO Elle IIStSPRItiT DD IIS!SOO! DD II

'RCBICG'.CL1SS-G,PITYa 12,TIBE=60.ET=60 DSN1R!.ltL.CG.RCB.PICS~DI,DISP·(SH.,P1SS)

DSIAft!-VtL.CG.BCB.UGILIB.DISP=fSHR,PISS) PGII-RCBGEI S1500T=1 DSN1ME=S&C1RDS1,DISP2(MBW,P1SS). UNIT=5YSOA,SPIC!:(TRK.50),

II 1151511 ./T' .1'12

DCB=(P.ICPI=PB,LI2CL=80,8LKSIZE=1200) DD •

./Tl

.I •••• !!'

TWO II!'RLOCKID TOBI COMPOSED 0' RINY CONVEI BODI!S

100 0 0 100 0 0 1 0

.1 •• "' 100 0.5 0 1 o 0 0 0 1 0

./!O 1 ,. '0 , 0.25

./ •• El

.1 .... 2 100 -0.5 0 0 1 0 0 -1 0 0

./'10 1 11t 10 1 0.25

.1 •• E2

./ •••• El

.1 •••• "2 1 o 0

./ •••• SP 0 0 0 0 0 1

.1 •••• E2

./'11

0

0 1 0

0 1 o 0 o 0 1 0 1

1 0.25 o 0 0 1 -0.25 0 0.25 o 0 1 0 -0.25 0 1.0 o 1 0 0 0.0 0 1 0 0 -1.0

5.0 3.5 2.1 -4.5 -3.5 -1.8 ".2

0.0 0.0 0.0 0.0

.I'S

./BO

./8U

./CL

1 1 o

9.0 1 q

IIC .. BG01 EXEC IISYSPIINT DD IIS'500T DD II II IISISIN l/c,.SG02 FIEC IISYSPRINT DD /ISYSOUT IIStSIN II'SPGO EXEC IISYSPRI1IT DD IISYSOOT DD /IS'S1lf DO

4 1 2

PGIl=PCBCPJB 5150UT=1 DSIAKE=S&C1RDS2,DISP=(NIW.P1SS), OIIT=5YSDA,SPACE=(TRK,50), DCB=(RECF"=PB,LRECl=80,BLKSIZ!:7200' DD DSN1"!=&&CARDS1,DISP=(OLD,PASS) PGP!=RCBCPlB SISOOT:j DO DSNA"E=&&CARDS1,DISP=(OLD.PASS) DD DSM1"!=&&CARDS2,DISP=(OLD,PASS) PGft=RCBYSP,REGIOlz115K SYSOOT=A DSI1"£=&&C1BDS2,DISP=(OLD,P1SS) DS.1BE=6SCIBOS1,DISP=(OLD,P1SSl PG!I=RCBPIC IIPICGO EI!C

IlsrSPIIIT DD I/SYSUT 1 .DD

SYSOU!=l DSNAftP=£&CARDS1.DISPa(OtD.PASS)

17

I

Page 20: S~ODYIRG BIDD!I LIII! AND VISIBLE SUaFleE • •

.,.

18

IIStSl1 DD DSllIJa'&CAIDS2.DIS,a(01D.P1SS) IIGIP1111 DJ allt-Gt. II

Pl9wr. 2: Pl •• l Oatp.t fro. t •• ,i.fbl. Surface PrOC ••• OE.