NASA-CR-178065

19860013848

RESEARCH TRIANGLE INSTITUTE

NASA Contractor Report 178065

RTI/3052/00-01F

Display System Software For The

Integration Of An ADAGE 3000

Programmable Display Generator

Into The Solid Modeling Package

C. A. D. Software

R. J. Montoya and Harold H. Lane, Jr.

Research Triangle Institute

Research Triangle Park, N. C. 27709

Contract NASl-17S90

March 1986

NI\S/\

L~3RARV COpy

App 1 I_~ 1:18 . f\ tJ I:;) 0"

LI\NGLEY RESEARCH CENTER

LIBRARY, NASA

IiAM2T0t:4~ VIRGINIA

National Aeronautics and

Space Administration

Langley Research Center

Hampton, Virginia 23665

POST OFFICE BOX 12194 RESEARCH TRIANGLE PARK, NORTH CAROLINA 27709
FOREWORD

This report was prepared by the Center for Systems Engineering of

the Electronics and Systems Unit, Research Triangle Institute, Research

Triangle Park, North Carolina, under contract NASI-17890. The work was

administered by the Systems and Analysis Branch (SAB) of the Space

Systems Division of the Langley Research Center of the National

Aeronautics and SpaceAdministration.

A software system that integrates an ADAGE3000 Programmable

Display Generator into a C.A.D. software package known as the Solid

Modeling Program is described. The software system was designed,

implemented, and tested at the Research Triangle Institute and later

installed and demonstrated at the Systems and Analysis Branch's display

system laboratory.

The Solid Modeling Program (SMP) is an interactive program that

provides the capability to model complex solid objects through the

composition of primitive geometric entities. In addition, SMPprovides

extensive facilities for model editing and display. SMPwas developed

at Langley Research Center by Computer Sciences Corporation.

The ADAGE3000 Programmable Display Generator (PDG) is a

sophisticated, color, raster scan, programmable display generator with

local intelligence provided by a 32-bit bit-slice, bipolar

microprocessor (BPS). The modularity of the system architecture and the

width and speed of the system bus allow for additional co-processors in

the system. These co-processors combine to provide efficient operations

on and rendering of graphics entities.
The resultingsoftwaresystemtakesadvantageof the graphics

capabilitiesof the ADAGE3000 PDG in the operationof SMP by

distributingits processingmodulesbetweenthe hostand the PDG.

Initially,the targethostcomputerwas a PRIME850,whichwas later

substitutedwith a VAX-11/785.Two versionsof the softwaresystemwere

developed,a phaseI versionand a phaseII version. In the phaseI

versionthe ADAGE3000is usedas a framebuffer. In the phase II

versionSMP was partitioned,and someof its functionswere implemented

in the ADAGE3000by meansof ADAGE'sSOLID3000softwarepackage.

In the performanceof the tasksdescribedin thisreport,the

ResearchTriangleInstitutehasworkedcloselywith personnelof the

NASALangleyResearchCenter. Ms. DarleneDeRyderand Ms. Cheryl

Allenof SAB haveprovidedvaluabletechnicalguidanceand coordination

throughoutthe project. Mr. KennethH. Jonesand Mr. DonaldP.

Randallof ComputerSciencesCorporationhaveprovidedhelpfulinsight

intoSMP.

Thework describedin this reportwas performedby personnelof the

Controland DisplaySystemsSectionof the ResearchTriangleInstitute.

Personnelthatconductedthe work forthe tasksdescribedin thisreport

were Mr. R. JorgeMontoya,Mr. HaroldH. Lane,Jr., andMr. Timothy

L. Turner. Mr. Montoyaservedas the ProjectLeader,and Dr. James

G. Haidt,Directorof the Centerfor SystemsEngineering,servedas

ProjectManager. Messrs. Montoyaand Laneauthoredthe report.

ii
TABLEOF CONTENTS

PAGE

1.0 INTRODUCTION....................................................1

1.1 ResearchBackground...................................... 1

1.2 ResearchScope and Goals................................. 2

1.3 Organizationof the Report............................... 6

2.0 SYSTEMS AND ANALYSIS BRANCH DISPLAY SYSTEM...................... g

2.1 Hardware Configuration................................... 9

2.1.1 The Host Computer................................. 9

2.1.2 The ProgrammableDisplayGenerator................ 11

2.2 SoftwareConfiguration...................................19

2.2.1 Host-basedSoftware...............................21

2.2.2 PDG-basedSoftware................................25

3.0 SMP/ADAGE3000 PDG INTEGRATION..................................26

3.1 Overview........................... 26

3"I'I VAX/ADAGE3000 Interacti°ns'ii_!!!ii_iiiiiiiiiil 27

3.2 Design ................................. 27

3.3 Implementation......................... 29

3.3.1 Phase I Integration.............. 30

3.3.2 Phase II Integration............. 35

4.0 USER'S GUIDE ..................................................40

4.12 Changes Phase I............................ to SMP Common to Bot! Phase I and Phas? II.:::::: 4240

4.3 Phase II.................................................43

5.0 ADDITIONALTECHNICALISSUES.....................................54

5.1 Local Transformations..... 54

5.2 Model Animation.......:::::::::::::::::::::::::::::::::::56

5.3 TemporaryGeometry Format Files.......................... 59

5.4 Summary..................................................60

6.0 SUMMARY OF ACCOMPLISHMENTS......................................61

7.0 SUMMARY OF CONCLUSIONSAND RECOMMENDATIONS...................... 64

APPENDIXA - PARTIAL STATIC CALLING STRUCTUREFOR SMP/ADAGE3000..... 66

APPENDIX B - LIST OF SMP'S MODIFIEDSUBROUTINES...................... 71

APPENDIX C - LISTINGSOF SOFTWAREMODULES DEVELOPEDFOR

SMP/ADAGE INTEGRATION...................................73

iii
TABLEOF CONTENTS

(Continued)

APPENDIXD - SUBROUTINESLISTEDBY SOURCECODEMODULE................130

APPENDIXE - VAX/VMSCOMPILATIONCOMMANDFILE........................ 138

APPENDIXF - INCLUDEFILES:VMS LOGICALSREQUIREDFORSMP SYSTEM..... 139

APPENDIXG - SMP LINKCOMMANDFILE:OBJECTMODULESAND LIBRARIES..... 140

APPENDIXH - SUBROUTINESTRMDL....................................... 142

APPENDIXI - REFERENCES.............................................. 147

iv
LIST OF ILLUSTRATIONS

FIGURENO. PAGE

1-1 ConceptualBlock Diagramof SAB's Original

Display System..........................................3

1-2 ConceptualBlock Diagram of SAB's Target

Display System..........................................7

2-1 SAB's VAX/11-785Configuration.......................... 10

2-2 SAB's ADAGE RDS-3000 PDG Architecture................... 12

2-3 SAB's ADAGE RDS-3000Display Memory Configuration....... 15

4-1 New User Prompts in MENU Command........................ 45

4-2 New User Prompts in Alpha Editor........................ 47

4-3 New User Prompts in Hidden Surface Display.............. 50
LISTOF TABLES

TABLENO. PAGE

2-1 SAB's ADAGE RDS-3000Configuration...................... 20

vi
LIST OF ABBREVIATIONS,ACRONYMSAND , SYMBOLS

ACD Analysisand ComputationDivision

AGG4 AdvancedGraphicsGenerator

AMD AdvancedMicroDevices

ASCII AmericanStandardCodefor InformationInterchange

BPS BipolarProcessorSet

BYU BrighamYoungUniversity

CAD ComputerAidedDesign

CMP ColorMap

CSE CenterforSystemsEngineering

CIG ComputerImageGeneration

CRT CathodeRayTube

CRS Cursor

CSC ComputerSciencesCorporation

DEC DigitalEquipmentCorporation

DMA DirectMemoryAccess

DR DynamicRAM

EADI ElectronicAttitudeDirectorIndicator

FORTRAN FormulaTranslator

FBC FrameBufferController

FSS FORTRANSupportSubroutines

GIA Gary IntermediateAssembler

HIRES Highresolution

Hz Hertz

IDL IKONASDisplayLanguage

IF Interface

ICROSS IntermetricsCrossAssembler

IKASM IKONASAssembler

vii
LIST OFABBREVIATIONS, ACRONYMSAND, SYMBOLS

(Continued)

ISC (GraphicsDevice)

I/0 Input/Output

KW Kilowords

K Thousand

LaRC LangleyResearchCenter

LUVO LookUp and VideoOutput

LORES Low Resolution

MA1024/D MultiplierAccumulatorwith PerspectiveDivide

Mbits Megabits

MEGA Million

MCM MicrocodeMemory

MPC MultiPeripheralController

NASA NationalAeronauticsand SpaceAdministration

NTSC NationalTelevisionStandardsCommission

OTV OrbitalTransferVehicle

PDG ProgrammableDisplayGenerator

PIXEL PictureElement

PIO ProgrammedInput/Output

RAM RandomAccessMemory

RTI ResearchTriangleInstitute

SAB Systemsand AnalysisBranch

SMP SolidModelingProgram

SR StaticRAM

TCS TerminalControlSystem

TV Television

viii
LISTOF ABBREVIATIONS,ACRONYMS,AND SYMBOLS

(Concluded.)

TM Trademark

VLSI Very LargeScaleIntegration

XBC CrossBarChannel

XBS CrossBar Switch

ix
1.0 INTRODUCTION

The practiceof engineeringhas cometo dependmore andmore on

computeraideddesign(CAD)softwarepackages.Thesepackagesprovide

the designerwith the abilityto synthesizeconceptsefficientlyand,

dependingon the sophisticationof the package,analyzeand viewthe

resultsfairlyquickly.

Perhapsone of the mostCAD-dependentengineeringendeavorsis that

branchof aerospaceengineeringthatdealswiththe designand analysis

of largespacevehiclesand structuressuchas the spacestation. To

addressthe needsof thisapplication,a researchand developmenteffort

was startedin October,1984,to enhanceand improvethe interactive

capabilitiesand responsetimeof an existingCAD program(SMP)usedby

researchersof the Systemsand AnalysisBranchof the NASA/Langley

ResearchCenter.

The purposeof thisreportis to documentthework performedunder

thiscontract.

1.1 ResearchBackground

The Systemsand AnalysisBranchof the NASA/LangleyResearchCenter

supportsIts researchon proposedspacestationconfigurationswith a

varietyof softwaretoolsavailableon a varietyof displaysystems.

One suchtool is providedby the SolidModelingProgram(SMP),a

sophisticatedCAD softwaresystem. SMP is an interactiveprogram

capableof modelingcomplexsolidobjectsthroughthe compositionof
primitivegeometricentities(Ref. I). The outputsof SMP (wire-framed

or shadedsolidmodelstransformedand resolvedforvisibility)are sent

to a displayterminalfor subsequentdisplay. SMP alsoprovides

extensivefacilitiesfor modelediting.

SMP operatesin a varietyof displaysystemsincludingthe one

consistingof a PRIME850 hostcomputerand a varietyof graphicoutput

devicessuchas the Tektronix401X,theAED 512 (or767),and the ISC

8001. In thisgeneralconfiguration,the hostcomputerprovidesthe

interactiveand operationalenvironmentforSMP, and the graphics

displaydevicesserveas displaybuffersand interfacesto the display

medium(CRT). A conceptualblockdiagramof thisdisplaysystemis

illustratedin Figure1-1.

Abouttwo yearsago,SAB purchasedan ADAGE3000rasterscan

programmabledisplaygeneratorto enhancethegraphicsgenerating

capabilitiesof the branch. The ADAGE3000PDG,with its local

intelligenceand architecturalcapacityformodularexpansionincluding

specialpurposeco-processors,hasthe capabilityof performingsomeof

the graphicsfunctionsthenbeingperformedby SMP in the hostcomputer.

This capabilityformedthe genesisforthe researchand development

effortdescribedin this report.

1.2 ResearchScope And Goals

The overall objectiveof the work describedin this report has been

to exploit the graphics capabilitiesof the ADAGE 3000 PDG in the

operationof SMP by distributingSMP's processingmodules between the

host computerand the PDG. The goal was the developmentof a graphics

softwaresystem which would allow the use of SMP in an optimally

partitioneddisplay system. The resultinggraphics system software

-2-
User Interface/

GraphicsOutput Devices

PRIME 850 I Tektronix401X MINICOMPUTER

I

, AED 512 or 767

SMP

I ISC 8001

Figure I-I. ConceptualBlock Diagram of SAB's OriginalDisplay System.
would provide a capabilityfor rapidly creatingsolid 3-D models of

proposed space station configurationsand studyingthe effect of space

station's orientationand orbit positionon its intendedoperations.

The scopeof work in thiscontractincludedthe following:

1) Provideconsultationas neededto LaRCpersonnelin the

areaof PRIME850/ADAGE3000 interfacedevelopment.

2) IntegrateADAGE 3000 PDG into existingLaRC solid

modeling software.

3) RestructureLaRC solid modeling softwareto exploit the

power of the ADAGE 3000 PDG to generate high-speed

renderingsof complex,3-D models and to manipulate

these models.

4) Assist in the implementationof the softwaremodifications

on the NASA/LaRCPRIME 850 minicomputer.

5) Document the softwaremodifications.

The specifictasksto be performedunderthiscontractincludedthe

following:

1) Initialintegrationof ADAGE3000 PDG intoLaRCSolid

ModelingSoftwareSystemto include:

a) Assistanceto LaRC personnelin the development

of the host (PRIME)/PDGinterface.

b) Integrationof the ADAGE 3000 PDG capabilities

into the existingsoftwaresystem such that the

PDG is capable of displayingimages generatedby

the host. This task includedthe porting of SMP

-4-
to RTI'sVAX-11/750,the writingof FORTRAN

subroutinesto send imagesto the ADAGE3000 PDG,

and the installationof the resultingsoftware

systemin the NASAPRIME850.

2) Restructureof LaRCSolidModelingSoftwareto use

featuresof theADAGE3000PDG to include:

a) Incorporationof the high-speedgraphicsfeatures

of the ADAGE3000 PDG includingdistributed

processingbetweenthe PRIME850 hostand the

ADAGE3000 PDG.Thistask includedthe evaluation

of alternatepartitioningschemesfor host-PDG

interaction,evaluationsof availablelanguages

for the PDG,designof the PDG softwarearchitecture

and host-PDGinterface,and specificationof PDG

routinesrequiredforthistask.The PDG routines

shallincludethe followingfeatures:coordinate

transformations,high-speedvectorand character

generation,high-speedgreyscale/colorfill,

and highspeedwindow/zoom.

b) Implementationof the PDG-basedrenderingsoftware.

3) Documentthe implementationand useof the PDG-rendering

softwareincluding:

a) Discussionof the partitioningschemes and PDG languages

consideredand evaluated.

b) Descriptionof the data flow between SMP and the ADAGE

3000 PDG.

c) Overall logic flow of the resultinggraphics software

system.

d) Detailedinstructionson program usage and operation.

e) Listingsof source code.

-5-
As can be seen in the tasksabove,originally,the displaysystem

was specifiedas thatconsistingof a PRIME850 hostcomputerand the

ADAGE3000PDG. Lateron, the hostchangedto a DEC VAX-11/785

computer. The workdescribedin this reportwas developedfor the

VAX-ADAGEdisplaysystem. A conceptualblockdiagramof the target

displaysystemis illustratedin Figure1-2. Thegraphicssoftware

systemwas developedat RTI'sDigitalGraphicsLaboratoryand later

installedin SAB'sdisplaysystem.

1.3OrganizationOf The Report

The organizationof this report is as follows. The hardwareand

software componentsof the targetdisplay system are describedin

Section 2.0. Next, Section 3.0 describesthe design and implementation

of the SMP/ADAGE3000 integration. Section 4.0 presents a users' guide

to interactionswith the integratedSMP/ADAGE3000 software system.

Section 5.0 presents a discussionof technicalissues which need to be

addressedprior to the implementationof further enhancementsto the

SMP/ADAGE PDG graphics softwaresystem. Section 6.0 presentsa summary

of accomplishments,and Section 7.0 presents a summary of conclusions

and recommendations. The report concludeswith nine appendices.

Appendix A includesthe staticcalling structurefor the SMP/ADAGE

softwaresystem. Appendix B providesa list of the RTI-modifiedSMP

subroutines. AppendixC includeslistingsof the softwaremodules

developedfor the integrationof SMP with the ADAGE 3000. Appendix D

includesa list of source code modules with the subroutinescontainedin

each. Appendix E presentsa VAX/VMS compilationcommand file indicating

the compiler options requiredby each module. Appendix F presents a

list of include files and VMS logicalsymbols requiredduring the

compilation,linking,and executionprocesses. AppendixG includes

-6-
User InterfaceJ .ost r POG

I

i _AD ADAGE I

CO.PUTERI VAX7_5 I 3OOO

TERMINAL _ _ D ___ COLOR

j . _ MONITOR

SMPI I SMP2*

I

I

DEV I

SMPI + SMP2 >SMP, where SMPI contains user interactions and modeling software, and SMP2 contains modeling

or display software. The implication is that the performance of the partitioned SMPsystem (i.e., SMP and

SMP2) will be better than the orginal SMP. I

Figure I-2. Conceptual Block Diagram of SAB's Target Display System,
the SMP link filewhichshowswhichobjectmodulesand librariesshould

be linkedto createthe executablefilefor SMP. AppendixH describes

subroutineSTRMDL. AppendixI includesreferences.

-8-
2.0 SYSTEMSANDANALYSISBRANCHDISPLAYSYSTEM

The display system at SAB consistsof a DEC VAX-11/785,an ADAGE

3000 PDG, SMP, and the softwaresystem developedby RTI. This section

presentsa detaileddescriptionof this display system with particular

emphasison the configurationand operationof the ADAGE 3000 PDG.

2.1 HardwareConfiguration

The hardwarecomplementof SAB'sdisplaysystemconsistsof a DEC

VAX-11/785hostcomputerand an ADAGERDS-3000color,rasterscan

programmabledisplaygenerator.The functionof the hostcomputeris to

providethe operationaland interactivenvironmentfor SMP. The

functionof the PDG is to providethe efficientrenderingof the objects

definedthroughSMP in the host.

2.1.1 The Host Computer.-The VAX-11/785consistsof an 11/785 CPU,

a floatingpoint accelerator(FP785),and 6 megabytesof ECC MOS memory.

The Unibus adapter supportstwo RA-81 456-megabytedisks, a 9-track 1600

BPI tape drive, 8 terminals,a line printer, and a DECNET interfaceto

other DEC computers. The parallel DMA interfaceto the ADAGE 3000 PDG

resides in the Unibus adapter. The configurationof the VAX-11/785is

illustratedin Figure2-1.

-9-
FP785 11/785 6 MEG SBI DW780 UNIBUS BAIIK

ECCMOS _ ADAPTER _ I/0

MEMORY BUS _ BOX

RA81 RA81 TU80 8 IK 11/B

456 MEG 456 MEG TAPE LINE TERMINAL DEC ADAGE

DISK DISK DRIVE PRINTER LINES NET DMA

Figure 2-I. SAB's VAX-II/785 Configuration.
2.1.2 The Proqrammable Display Generator.- The ADAGE3000 is a high

performance, modular, raster scan, color display generator with a 32-bit

bipolar microprocessor built around AMD's 2903 bit slice microprocessor

and the AMDAM2911microprocessor sequencer (Refs. 2 and 3).

Individual modules plug into a 32-bit wide data bus having a I00 nsec.

cycle time. The PDGhas a large address space supported by a 24-bit

address bus also having a lO0-nsec cycle time. This bus-oriented

architecture and large address space allow the installation and control

of additional processing and storage modules, such as image memory to

support increased pixel depth (more colors) at a given resolution within

the limitations of the system.

Figure2-2 illustratesa PDG architecturewhichis representative

of the SAB'sADAGE3000PDG. The figureshowsthe co-processingmodules

(BPS,MA1024,andAGG4)and theirassociatedmemories(microcodeMCM4

and data (SR8))in its lowerportion. The figurealso showsthe digital

videostream(FBC,XBS,and LUVO's)in itsupperportion. The display

or imagememoriesshownin the middleportionof the figureprovidethe

interfacebetweenthe processingmodulesand the videostream. Each

processingmodule,includingthe hostcomputer,can writeto the image

memorieswithoutinterventionof the localprocessor.Interactions

betweenthe hostcomputerand the PDGoccurthroughthe interface(IF)

modulewhichsharesa boardwiththe framebuffercontroller.

Also shown in the lower portion of the figure is the

multiperipheralcontroller (MPC). This Motorola 68000-basedmodule

supportsa variety of interactivegraphicsdevices (joystick,push

buttons,mouse, etc.). This module, with an appropriatememory

complementand software,also provides the potentialfor an onboard host

in the ADAGE 3000 PDG, i.e., a potentialfor using the ADAGE 3000 PDG as

a workstation.

- 11 -
UVO

_ CROSSBAR SWITCH

L_--_"--"--L_J _ FRAME BUFFER

_ CONTROLLER

. __Green _ MIEM_oGERI ES

R_d j

I f v_oEoeus

MULTIPLIER WITH _ _'I _'_

PERSPECTIVE LP _ ,

STATIC R.OJ4___ "

STATIC RAM L.P _ _

MICROCODE MEMORY _"

MICROCODE MEMORY___

BIPOLAR PROCESSOR SET_

HOST & OTHER

PERIPHERALS

Figure 2-2. SAB's ADAGERDS-3000 PDGArchitecture.

- 12 -
2.1.2.1The interfacemodule:The interfacemodule(IF)is a two

cardset (oneIK11Bin the hostand one FBC/IFin the PDG)thatprovides

the coordinationecessaryfor fast,efficientparallelDMA or PIO data

communications.This is a two way linkthatallowsthe hostto transfer

instructionsand datato the PDGas wellas to readback statusand data

fromthe PDG.

2.1.2.2The PDG processor:The ADAGE3000mainprocessor,the BPS,

is implementedusingAMD'sAM2903bipolar,bit sliceprocessorand the

AM2911bit slicemicroprogramsequencer.The processoroperateson

32-bitwordsand is controlledby a microprogramconsistingof a

sequenceof 64-bitwide microcodewords. The BPS operatesin

conjunctionwith at least4K of microcodememory(MCM4)intowhichthe

microcodeis downloadedfromthe hostand withat least8K of staticRAM

(SR8)memoryintowhichgraphicsapplicationprogramsand data are

downloadedby the host. Boththe MCM4and the SR8 are dualported. The

processorcommunicateswith the MCM4throughdedicateddataand address

busses. Eachmicroinstructionexecutesin 200 nsec. The combinationof

thewide horizontalmicrocodeword (64bits)usedby the processorand

the paralleldatapath implementationallowthe executionof fairly

complexinstructionsin onemicrocodecycle.

2.1.2.3 The multiplier/accumulator:The multiplier/accumulatorwith

perspectivedivide option, the MA1024/D,is a microprogrammablehardware

multiplier and accumulatemodule based on a TRW VLSI chip. The MA1024/D

has an on board 1024x16 memory for storage of coefficientswhich allows

for the efficientcalculationof isometricsand perspective,3D, point

transformations. The multiplieris ported to both the ADAGE bus and to

at least one static RAM memory. The operationof the module is

controlledby its own microprogram. Typical operationmultipliesan

array of coefficientstaken from the coefficientmemory with another

array obtained from the working (SR8)memory. Results or accumulation

of results can be read through the ADAGE bus or placed in the SR8. The

- 13 -
perspectiveoptionprovidesfor the computationof "W" and its

reciprocal,allowingperspectivedivisionto be performed. Three

dimensionalpointtransformationswithand withoutperspectiveare

performedin lessthan4 and 6 microseconds,respectively.Evenfaster

transformationratescan be achievedwithadditionalmultipliermodules.

2.1.2.4The advancedgraphicsgenerator:The advancedgraphics

generator, the AGG4,is a 16-bitprocessorfor theADAGE3000

implementedusingthe AMD AM2901bit sliceprocessorand the AM2910

microprogramsequencer.The AGG4 canprocessandwritea stringof 32

pixels(inhigh resolutionmode)and a stringof 16 pixels(inlow

resolutionmode)in one bus cycle. Themain use of thismoduleis for

fastrenderingof flatshadedpolygons.Anotherimportantuse of this

moduleis for the fastgenerationof characterstrings.

2.1.2.5 The frame buffer: The frame buffer or display image memory,

the GM256, is a dual-ported,200 nsec cycle time dynamic RAM into which

the images are usually written on a pixel by pixel basis. One port of

the memory communicateswith the ADAGE data bus and the other with the

digital video stream. However,addressingtakes place in both instances

through the ADAGE bus. The storagecapacity for each GM256 is 8 Mbits

(four512x512 8-bit imagesor four 1024x10242-bit images). The

viewable capacityof each GM256 is 2 Mbits (one512x512 8-bit image or

one 1024x10242-bit image). Frame buffer memoriesare grouped to

provide the pixel depth needed in the particularapplication. Color

variabilityin the image is a functionof the pixel depth as well as the

contents of the color lookuptable (LUVO). The LUVO is discussed in

more detail in a later section. The configurationof the display memory

in SAB's PDG is illustratedin Figure2-3. The figure shows that each

GM256 provides essentiallyfour quadrantsfor selectivestorage of image

data and one quadrant for selectiveviewing. This expandedstorage

capacity (over the GM-64 memories)allows image buffering in depth or z,

in x, and in y. The choiceof bufferingschemedepends on how many bits

- 14 -
8

WRITE / B-Lu€ j VIEW

• .. IGrEen !

Four _ _ _ i _ One Quadrant

Quadrants 0 2

512

(4) 512x512x8 I _512x512x8

I

.1 3

I

512

I

512 512

(A) Medium Resolution:512x512xN,N = I--_-24

WRITE VIEW

Four _ R_dl / One Quadrant

Quadrants 0 2

1024

(4) 1024x1024x6 _ 1024x1024x6

/

1 3

1024

/

1024 1024

(B) High Resolution:1024x1024xM,M = 1--_-6

Figure 2-3. SAB's ADAGERDS-3000 Display Memory Configuration.

-15-
per pixel (howmany colors)are neededfor eachapplicationprogram.

Thememorycan be organizedin bit planesand can be configuredin a

varietyof formats. Whichbitplanesget writtenintoduringa write

cycleis controlledby writemask registerswhosevaluescan be changed

dynamicallyunderprogramcontrol.Whichbit planescontributeto an

imageduringthe imagerefreshcycleis a functionof the dynamic

settingsof the crossbarswitch(XBS). In addition,the GM256memory

has a shaderegisterwhichallowsthe AGG4or the BPS to perform

efficientmaskmode writes.

An imagein the PDGconsistsof a setof threeimageboards(red,

green,and blue)withan optional(alpha)boardwhichcan be used for

overlaysand otherfunctions.The red,green,and bluecomponentsof

eachimageare at the samex andy addressesbut differin z (bit

depth). The writemask registeris usedto writeto the z location(by

depth)of eachboard. In low resolutionmode (512x512)eachboard

contributeseightbitsin z whereasin highresolutionmode (1024x1024)

eachboardcontributestwo bitsin z. Sincethe PDG is expandable,a

systemcan havemany imagememories. Eachimagehas a distinctaddress

with the firstset of fourcards (includingan alphacard)corresponding

to imageO, the nextset to 1, and so on. The ADAGE3000'ssystem

capacityis foursetsof fourfullcolor,512x512resolutionimages.

The samecardscan alsobe addressedas one fullcolor (plusalpha),

1024x1024resolutionimage.

2.1.2.6The digitalvideostream:The digitalvideostreamconsists

of the framebuffercontroller(FBC),the crossbarswitch(XBS),and the

lookuptableand videooutputmodule(LUVO).

The FBC is a programmablemodule that controlsthe reading of image

data from the frame buffer memoriesand the sendingof this data to the

LUVO either directlyor through the XBS. The FBC also generatesall

- 16 -
videosystemtiming. The FBC containseight32-bitwide registerswhich

can be writtenintoeitherby the user'sprogramin the PDG or by the

host computer.Theseregisterscontrolthe scanstandardat whichthe

PDGoperates,the x/y windowand viewport,cursorposition,and image

erasure. The FBCaccessesall cardsof an imagesimultaneouslythrough

theirvideooutputportsand outputsthe resultingserialvideostream

to the crossbarswitchon a pixelby pixelbasis.

The crossbar switch (XBS/F)is a programmablemodule which allows

the arbitrarymapping of image memory bits to color map input bits. The

mapping is controlledby registerswhich can be set dynamicallyby the

applicationprogram. The registersettingsallow connectingan output

bit to any one of the input bits. There are thirty-fiveinput bits and

thirty-twooutput bits. On the input side, the extra three bits

correspondto paging and cursor on/off bits added to the video stream by

the frame buffer controller. These bits are control bits for the LUVO.

The other thirty-twobits correspondto pixel depth information

includingthe eight bits of the overlay channel. The XBS is used for

multiple bufferingof displaysand for routing pixels of individual

displays to each of several possible LUVO's in the system.

An additionalfeatureof the XBS is the hardwarefilloption. This

is a specialdigitalcircuitin the XBS whichlatcheson when a single

pixelin a specificbit planeis detectedand remainson untilanother

singlepixelin the samebit planeis detected.Thus,thisfeature

allowsthe flatshadingof largeareasof the screenat videoratesat

the costof writingonlya fewpixels,i.e.,the writingof the boundary

of the areato be shaded.

The implementationof this option is as follows. The first eight

input bits (bits 0-7) of the XBS are also connectedto the last eight

input bits (bits 24-31) of the XBS. When a user wishes to apply

- 17 -
hardwarefillto an objectin the display,he/shemust do two things:

draw the boundaryof the objectintoone or moreof the firsteightbits

of the displaymemory(REDcard)and connecttheparticularoutputbit

of the XBS to whichthatbit is goingto contributeto the corresponding

inputbit (24-31)of the XBS in whichthe outlineof the objectwas

drawn. Thusfor example,if one wishesto fillthe runwayof an EADI

display,one can drawthe outlineof the runwayontobit plane1 of the

imagememoryand programthe XBS to connectitsoutputbit five

(arbitraryfor thisexamplebut colormap dependentin a given

application)to its inputbit twenty-four.The resultis thatwhenthe

leftedgeof the runwayis encounteredthe hardwarefillturnsitselfon

and remainson untilthe rightedgeof the runwaypassesthroughthe

circuit. Appropriateloadingof the colorlookuptableis necessaryto

insurethatwhen the particularbit is on, the desiredcoloris

obtained. Thisoptionis usedfor largearea fillat videorates. (It

shouldbe notedthat systemswiththisoptiondo not havea pixelpath

betweenthe alphacard in the imagememoryand the correspondinginput

bits intothe XBS).

The color lookup table and video output module (LUVO/24)is a

combinationmemory and digita!-to-analogconversionmodule. The lookup

table portion of the module is a high -speed 24-bit memory with 1024

locationsin which a pallete of colors is stored. The memory is dual

ported with one port connectedto the video bus and the other to the

system bus. The colors are defined by the user as combinationsof red,

green, and blue values. Each componentcan be defined to an 8-bit

resolution. The colors can be downloadedfrom the host and placed at a

specific address in the color map. The value of each pixel is used to

index into the lookup table. The particularvalues of red, green, and

blue stored at this locationare then used as the inputsof the

correspondingD/A converters. The lookuptable can be operated in two

modes, full color and pseudo color. In full color mode, the value of

the pixel arrivingfrom the red, green, and blue cards are treated as

three independentaddressesinto the red, green, and blue color maps.

- 18 -
In pseudocolormode,the valueof the specifiedpseudocolorchannel

pixelis replicatedto the inputsof the othertwo non-specified

channels. Thereforein pseudocolor,all threecolorlocationsare at

the sameaddresswhereasin fullcolormode,all threecolorlocations

can be at differentaddresses.

The videooutputmoduleis a three-channeldigitalto analog

converterwhichreceivesred,green,andbluedata fromthe lookuptable

and convertsthemto RS-170or RS-343Aanalogvideosignals. The

eight-bitDAC'scan operateat 40 MHZ to supportthe requiredpixeldata

rateof 1024x1024displays.

The elementsof the SAB'sADAGE3000PDG are su_arized in Table

2-1.

2.2 SoftwareConfiguration

The softwareenvironmentof SAB'sdisplaysystemis distributed

betweenthe hostand the PDG. Hostbasedsoftwaresubsystemsinclude

SMP,SOLID3000,the FORTRAN-basedinterfaceroutinesdevelopedby RTI,

and the FORTRANruntimeenvironmentprovidedby the VMS operating

system. PDG-basedsoftwaresubsystemsare the SOLID-3000supporting

microcodeand the graphicsdisplaylistsdevelopedby RTI. The

VAX-11/785operatesunderthe VMS Version4.2 operatingsystem. The

ADAGE3000PDG operatesunderSOLID3000/16MVersion1.0. Also

availablein SAB'sdisplaysystemis an IDL2compilerfor the ADAGE.

However,IDL2is not used in thisapplication.

- 19-
Table2-1. SAB'sADAGE3000Configuration

MODULE QTY DESCRIPTION

CB-24 1 Twenty-fourslot card cage with

power supply

IF/FBC 1 DMA interfaceand Frame Buffer

Controller

BPS-256 1 Bipolarmicroprocessorand

sequencer

MCM4 2 MicrocodeMemory

(4 KW, 64 bits per word)

MA1024/D 1 Multiplier/Accumulatorwith

Perspectivedivide option

SR8 2 Static Ram memory

(8 KW, 32 bits per word)

GM256 3 Graphic Memories

(512x512x8or 1024x1024x2each)

XBS-34/F 1 Cross-BarSwitch with Hardware

Fill Option

LUVO-24/HS 1 Look-up Table and Video Ouput

module

MPC/32 1 MultifunctionPeripheral

Controller

JS3 1 Joystick

- 20 -
2.2.1Host-basedSoftware.-The functionof the host-basedsoftware

is to enablethe userto buildnewmodelsand assemblies,support

editingof existingmodelsand assemblies,and supportinteractionswith

the PDG. The softwaresuitein the hostconsistsof SMP,SOLID3000,

the RTI-developedinterfacesbetweenSMP and the PDG software,and the

FORTRANruntimesystem.

2.2.1.1SolidModelingProgram:The SolidModelingProgram

developedby ComputerSciencesCorporationfor NASA'sSystemsand

AnalysisBranchis a comprehensivesoftwaresystemthat allowsa userto

createand modifycomplexthree-dimensionalmodelsbuiltup from

three-dimensional"primitive"parts. SMP has both keyboard-basedand

graphic-basedmodeleditorsas wellas a varietyof renderingmethodsto

allowusersto observethe resultsof theirmodeling. The completed

modelcan be storedin severalformats,of whichmost are compatible

withothergraphics-relatedsoftware.

A solidmodelgeneratedby SMP (Ref. 1) is the resultof an

aggregateof geometricmodelingprimitivesavailableto the user. These

modelingprimitivesfallintofivecategories:basic,swept,Boolean,

external,and assemblies.For a descriptionof eachcategoryseepages

6 through34 of reference1. The basicmodelingprimitivescurrently

availablein SMP are: "boxes,""cones,""spheres,""paraboloids,"

"tori,"and "trusses."Eachof theseare completelydefinedthrough

dimensionand constructionparameters.The usercan generateadditional

shapesby varyingthe constructionattributesof certainof the

primitives.

Accordingto referenceI, "the SMP softwareis structuredas a

hierarchywith each level being associatedwith a set of program

commands. The system is menu and command driven with online help

facilityavailableat each level."The highest level of user interaction

- 21 -
is the commandlevelwhichallowsthe userto inputan existingmodel

(READ),outputa solidmodel (WRITE),modifythe solidmodelby

performingbasiceditingoperationon itsprimitives(EDIT),displaythe

solidmodel (DISPLAY),and performlimitedmasspropertyanalysisand

dimensioningon the solidmodel (MISCELLANEOUS).A commandlevelmay

containone or morecommandsublevels.A descriptionof the available

sublevelsand theirrelationshipsis presentedin Table4 of the cited

reference.

In additionto the geometry editoravailableas a command level,

SMP providesthe user with a graphics editor as a sublevelof the

DISPLAY command which "allowsmanipulationof the model parts through

direct interactionbetween the two dimensional(2-D) projectionof the

model on the screen and a graphics input device." (Ref. 1).

2.2.1.2SOLID3000:SOLID3000 (Ref. 4) is a packageof

FORTRAN-callablemicrocoderoutinesdevelopedby ADAGE,Inc. for the

ADAGE3000 PDG. Themicrocoderoutinesgeneratelineand shaded(flat

and smooth)surfacedisplayof polygonaland mesh-structuredsolid

modelingdata. The packagealsoprovidesFORTRANand microcoderoutines

to supportcommunicationsbetweenthe hostand the ADAGE3000PDG.

SOLID3000microcoderoutinesare generatedby the ICROSSmicrocode

compiler.

The SOLID 3000 systemdepends heavilyon FORTRAN applications

programs to set display attributes (suchas color, light, and viewport),

and to send model data (suchas a mesh of x, y, and z coordinatesor a

stringof text) to the SOLID 3000 microcodethrough the FORTRAN

interfaceroutines. Accordingto reference4 since "SOLID 3000 performs

z-buffereddisplay processing,data and attributescan be sent from the

host in any order and imagescan be created with any amount or mixture

of data, number of viewports,light sources,etc."

- 22 -
Thereare two versionsof SOLID3000,SOLID16MAND SOLID64K which

supportfulland falsecolorimages,respectively.SOLID16M requires

24 bitsof imagememory(red,green,and blueboards)whichprovideover

16 millioncolorswhereasSOLID64K requires16 bitsof imagememory(9

bitsof hue and 7 bitsof intensity)whichprovideover 64 K colors. A

16-bitz-bufferis usedby bothconfigurations.In addition,SOLID16M

has an 8-bitcoveragebufferfor imageenhancementsuchas

anti-aliasing,translucency,and texturemapping.

SOLID16M supportswireframeas wellas flatand smooth(Gouraud

and Phong)shadedimagerenderingwith/withoutanti-aliasingas well as

with otherimageenhancingfeaturessuchas realistictranslucencyand

texturemapping. In addition,the latestversionof SOLID3000can

supporttransformations,picking,instancing,cutting,and animation

playback.

SOLID3000usesa lefthandedcoordinatesystem(+xto the right,

+y up, and +z intothe screen)with theoriginat the centerof the

screen. SOLID16M supportsfullcolorandpseudocolordisplay

capabilities.Another,veryuseful,featureof SOLID3000 is its use of

differentBPS senderID'sfor imagewritesand z-bufferwrites. This

allowsthe applicationprogrammerto protectselectedbit planesin the

image.

A detailed descriptionof these featuresas well as the FORTRAN

interfaceroutinesavailablein SOLID is found in reference4.

- 23 -
2.2.1.3RTI Interfaceroutines:BecauseSMP was developedto

operatein a displaysystemthatcontaineda varietyof graphics

renderingdevices(displayterminals),itsdesignemphasizedthe useof

deviceindependentroutinesfor the functionsof SMP and a standard

interfaceto the displayterminals.Thisallowedalmostall the code in

SMP to use an identicalsubroutineinterfaceto the graphicsrendering

device(terminals),no matterwhichdevicewas selectedby the user. In

someinstances,this standardinterfaceusedthe TerminalControlSystem

(TCS)subsetof the TektronixPLOTIOsoftwarepackage.

As will be seen in the next section,RTI integratedSMP with the

ADAGE 3000 in two phases. In the Phase I version (the ADAGE used as a

frame buffer) RTI made use of this device independentscheme,

essentiallyadding another device to the SMP softwaresystem. However,

a PlotlO-likeset of subroutineswas not availablefor the RDS-3000.

Therefore,to implementthe interfaceto the device independent

functions (such as erase, draw line, draw cursor, etc.), RTI wrote a set

of FORTRAN subroutineswhich implementedthe ADAGE interfaceroutines

needed by SMP. These subroutinesare: ADDRWS, ADLINE, ADMOVA, ADMOVS,

ADVUPR, ADWIND, CLIP2D, ENDPT_CODE,and LOGIC_INTERSECT.

In the PhaseII version(theADAGEusedas a PDG)RTI interfaced

SMP to the SOLID-3000subroutinepackagein the hostcomputer. The

SOLIDsubroutinesthencommunicatewiththe ADAGEPDG. The

RTI-developedinterfaceroutinesare: GET_SLDCOLR,SLDSMOOTH,SODRWA,

SODRWS,SOMOVA,SOMOVS,SEND_2_SOLID,andSLDZWIND.

In addition,certaingeneralpurposeinterfacesubroutineswere

neededto controlthe framebuffercontroller,loadthe cursor

registers,and loadthe colormap. Thesesubroutinesare: FBC,CURSLD,

and CMAPLD.

- 24 -
Listingsof the RTl-developedsubroutinesare includedin Appendix

C.

2.2.2PDG-basedSoftware.-The two itemsthat togetherconstitute

the softwarein the ADAGERDS-3000PDG are the ADAGE-suppliedmicrocode

and the instructionswhichthe applicationprogram(SMP/SOLIDsystem)

sendsto the ADAGE.

2.2.2.1ADAGE-suppliedmicrocode:The ADAGE-suppliedmicrocode

supportroutinesresidein two MCM4microcodememorymoduleswhich

togetherhavea capacityof 8KW of 64-bithorizontalmicrocodewords.

Theseroutinesare invokedwhen instructionsand data,sentby the

host-residentportionof SMP,callfor a particulartypeof renderingto

be done. Controlis thenpassedto themicrocoderoutineand theobject

is renderedintothe imagememory. Themicrocodeused in the ADAGEis

unmodified.

2.2.2.2 Instructionsand data sent to the ADAGE at runtime:These

instructionsand data are created by applicationsprogram calls to the

SOLID 3000 FORTRAN library at runtime. When the call occurs during the

running of the applicationsprogram a display list is created,

initialized,built_ and sent to the ADAGE SR8 memory module. These

instructionsand data then cause the image to be rendered in the manner

describedin the precedingsection.

- 25 -
3.0 SMP/ADAGE3000 PDGINTEGRATION

As stated in the introduction, the overall objective of the work

described in this report has been to incorporate the sophisticated

graphics generation capabilities of the ADAGE3000 PDGinto the

operation of SMP. To accomplish this objective it was recognized early

in the design process that the functional modules of SMPwould have to

be distributed between the host computer and the ADAGEPDG. The

resulting graphics software system would make full use of the resources

of the host and the PDGto improve user/SMP interactions in the model

rendering area. This would provide the capability for rapidly creating

solid 3-D models and viewing them in different orientations. This would

also allow the users to evaluate more options in the configuration of a

model. Thus, for example, the software system could be used to evaluate

proposed space station configurations and studying the effect of space

station's orientation and orbit position on its intended operations.

3.1 Overview

This section provides a general description of the SMP/ADAGE3000

PDGintegration. The method of integration evolved from issues relating

to how the host and the PDGcan interact as well as from the

comprehensiveness of the software interfaces required to implement the

access of the ADAGE3000 rendering functions by the SMPmodules.

- 26 -
3.1.1VAX/ADAGE3000Interactions.- Froma hardwarestandpoint,

interactionsbetweenthe hostcomputerand the PDG occurthrougha

two-cardset,one locatedin the hostand the otherin the PDG. In the

hostsideof the interface,themoduleis an IK11/BADAGEinterfacecard

whichis locatedin the VAX-11/785Unibus(TM).In the PDG sideof the

interface,the moduleis an IF interfacecardwhichsharesthe same

boardwiththe framebuffercontroller(FBC)moduleand whichis located

in the ADAGEsystembus. The IK11/Band the IF performthe necessary

hardwareprotocolto supportDMA readsandwritesfromand to theADAGE

3000. The IK11/Bcan selectany addresswithinthe ADAGEaddressspace.

Readand writerequestsare arbitratedby the mainADAGEbus arbitration

logicon a manufacturer-setprioritybasis. Thistechniqueavoidsbus

contentionproblemsduringhost/PDGinteractions.

3.2 Design

The basicdesigngoalwas to make the renderingcapabilitiesof the

ADAGEPDG fullyavailableto SMPwhilemaintaining,to the largest

possibleextent,SMP'sbasicsoftwarearchitectureand user interface.

Therefore,designissuesrevolvedprimarilyaroundwhat languageand

what levelof softwareinterfaceto use to implementthe SMP/ADAGEPDG

communicationsand interactions.

SMP is a comprehensiveand sophisticatedsoftwaresystem structured

hierarchicallywith many levelsof commands,menus, and submenus (Ref.

1 and AppendixA). On the other hand, because the ADAGE 3000 PDG is a

very powerfuland flexiblegraphics system,applicationprograms

developedfor its use tend to be complex (Refs. 4 and 5). Because of

these considerations,the integrationof SMP with the ADAGE PDG was done

in two phases. In phase I, the ADAGE 3000 would be used solely as a

frame buffer. In phase II0 the ADAGE 3000 would be used as a graphics

computer. This approachwould allow RTI to acquire extensive

- 27 -
operationalexperiencewith SMP (duringphase I) and to use this

experienceas well as its experiencewith the ADAGE graphics languages

to keep the complexityof the implementationof the interfacein phase

II to a minimum.

The phase I configurationwould only use the frame buffer and video

stream portion of the ADAGE 3000 PDG, without using the local processing

capabilitiesof the PDG. In this configuration,SMP would perform its

traditionalrole of supportingthe definitionand display of models. In

particular,the display functionwould be done by SMP's graphics

renderingalgorithmsin the same way as they are done for the other

graphicsdevices that SMP supports. In order to display the

SMP-generatedimages, this approachwould require that only the lowest

level routines in SMP's device independentcode (primarilythose in

source file DIDDGS.FOR)be modifiedto includepixel writes to the ADAGE

frame buffer. This configurationalso would requirethat SMP configure

the elements of the ADAGE 3000 PDG's digital video stream, i.e., the

frame buffer controller,the cross bar switch,channel cross bar, and

the color look up tables. Additionalsubroutineswould be needed to

accomplishthese controllingfunctions.

The phase II configurationwould use the full capabilitiesof the

ADAGE 3000 PDG. In this configuration,SMP would also perform its

traditionalrole with respect to model generationbut its display

functionswould be distributedbetween itselfand the PDG. User

interactionswould be preservedin SMP and any additionalinteraction

resultingfrom the distributeddisplay functionswould also be

maintainedwithin SMP. Softwareinterfaceswould be needed to match the

data and command conventionsin SMP with those in the application

programswritten in the PDG graphicslanguageto render the images

defined through SMP. Examplesof data that would be passed between SMP

and the PDG applicationprograms running in the BPS high-speedprocessor

are endpointsand shadesof lines and vertices,shades and normals of

- 28 -
polygons,hiddensurfaceremovalcoveragedata,transformation

coefficients,etc. It shouldbe notedthatthisconfigurationwould

also requirethe implementationof subroutinesto controlthe

configurationof the PDG'svideostreammodules.

3.3 Implementation

The originalversionof SMP used in SAB'sdisplaysystem(PRIME850

interconnectedto a varietyof displaydevices)was writtenin ANSII-77

FORTRANwith PRIMEextensionsto FORTRANand PRIMOSoperatingsystem

calls. RTImodifiedthisversionof SMP and installedit in its display

system(VAX-11/750operatingunderthe VMS operatingsystemand

interconnectedwithan ADAGE3000PDG). SincetheoriginalSAB's

ADAGE-basedtargetdisplaysystemwas to be hostedin the PRIME,the

projectplan initiallycalledfor thedevelopmentwork to be done in

RTI'sdisplaysystemand forportingthe resultingdisplaysystem

softwareto SAB'sPRIME/ADAGEdisplaysystem. ThisplanwouldallowRTI

to developthe softwaresystemwhileSAB personnel,with some

consultationwith RTI,developedthe PRIME/ADAGEinterfacemicrocode.

In the Springof 1985it was learnedthatSAB'sVAX-11/785wouldbe

availableearlierthanexpected.Consequently,the targetdisplay

systembecamea VAX/ADAGEone. Thisdevelopmentmade the initial

adaptationof SMP to RTI'sVAX a verysignificantendeavorand alsomade

the portingof the resultingsoftwaresystemto SAB a more

straightforwardprocess. The concernsshiftedfromdealingwith

significantdifferencesbetweenoperatingsystems(VMSversusPRIMOS)to

dealingwith differencesbetweendifferentversionsof the same

operatingsystem(VMSVers. 3.4 at RTI versusVMS Vers. 4.2 at SAB).

It shouldbe notedthat,in parallelwiththe RTI effort,SAB modified

and enhancedthe originalversionof SMP to operatein the VAX

environment.However,sincethisversiondid not becomeavailableto

RTI untillateintothe contract,it was decidedto proceedwiththe

versionof SMP originallyadaptedto the VAX by RTI.

- 29 -
3.3.1PhaseI Integration.- PhaseI integrationconsistedof

implementinga "Tektronix'sPlotlO-like"interfaceto the ADAGE. This

neededto be done sinceADAGEdoes notprovidean interfaceof this

naturefor its RDS 3000. Initially,thisappearedto be a

straightforwardtask. However,thisinvolvedimplementingmany

non-trivialfunctionssuchas two dimensionalobjectclipping,

windowing,viewporting,etc. Theseare featuressupportedby all of the

displaydeviceswithwhichSMP interacts.The phaseI implementation

doesnot supportthe drawingof texton the graphicsscreen(incontrast

to otherSMP/displaydeviceimplementations).Thisfeaturewas not

implementedbecausedrawingcharacterson on a pixelby pixelbasisfrom

the host intotheADAGE'sframebufferwouldbe an extremelytime

consumingoperation.Textpromptsandmenusappearon the user's

computerterminal.

To implementthe PhaseI configurationseveralof SMP's "device

independent"supportroutinesweremodified.Theseinclude: GDINIT,

CMPRES,DDVTOS,DICOLR,DICTAB,DICURS,DIDRWS,DIDRWW,DIDSHS,DIDSHW,

DIDUMP,DIERAS,DIMOVS,DIMOVW,DIPAUS,DISCTE,DIVUPR,DIWIND,LOGO,

TITLE,andWPXLA.

When the ADAGEframebufferis selectedas the displaydevice,the

phaseI softwareis invokedas follows:

1) GDINIT initializesthe VAX/ADAGEcommunicationschannel,the

frame buffer controllerto 512 X 512 60 Hz repeat field, the

crossbar switchto straightthrough with overlay defeat, the

channel crossbar switchto pseudocoloroff the red memory

card, the write and erase masks to select all image bits, the

color map to the standardSMP color map, the cursor register

to display a trackingcross (when enabled),and erases the

- 30 -
screen.

2) CMPRES sets the computationresolutionfor the ADAGE to 512 X

512.

3) DDVTOSconvertsvirtualcoordinates[0, 1] intoADAGEscreen

coordinates.

4) DICOLRsetsthe currentforegroundcolor.

5) DICTABsendsthe selectedcolortableto the ADAGEcolormap.

6) DICURS prompts for and obtains an X, Y specificationfrom the

user. See section4.1 for a more completedescriptionof the

user interfaceto the cursor routine.

In the subroutineswhichimplementlinedrawing,modificationstook

placeto the followingroutines:

7) DIDRWSdrawsintothe ADAGEframebuffermemoryusingthe

virtualcoordinatesystem[0,1].

8) DIDRWW draws into the ADAGE frame buffer memory using world

(model)coordinates.

9) DIDSHSdrawsdashedlinesintotheADAGEframebuffermemory

usingthe virtualcoordinatesystem[0,1].

10) DIDSHWdrawsdashedlinesintothe ADAGEframebuffermemory

usingworld (model)coordinates.

- 31 -
II) DIMOVSperformsa moveby settingthe "currentlocation"using

the virtualcoordinatesystem[0o1].

12) DIMOVperformsa moveby settingthe "currentlocation"using

world (model)coordinates.

13) DIDUMPsendsthe contentsof the displaycommandbufferto the

ADAGEdisplay.

14) DIERASclearsthe ADAGEmemory. It is usedto erasewhatever

displayhas beenpreviouslywrittenintomemory.

15) DIPAUSpromptsthe userfor a <CR> in orderto be ableto

continueprogramexecution.

16) DISCTEsetsthe valueof the "currentcolor"and also sends

thisvalueto the specifiedADAGEcolormap location.

17) DIVUPRdefinesa rectangularscreen-coordinateviewportfrom

user-specifiedvirtualcoordinates[0,1].

18) DIWIND defines a rectangularwindow in the world (model)

coordinatesystem.

19) LOGOwritesthe logo"SMP/LARC"in the lowerrightcornerof

the framebuffer.

20) TITLEwritesa titlepagewhenSMP is initiallyrun containing

"SMP"in largecharactersand creditsfor softwareauthorship.

21) WPXLA is a utility routlne for writlng a rectangulararray of

pixels to the display.

- 32 -
In addition,the phaseI configurationrequiredthe implementation

of the followinggroupof FORTRAN-based,ADAGEsupportroutines:

ADDRWA,ADDRWS,ADLINE,ADMOVA,ADMOVS,ADVUPR,ADWIND,CLIP2D,

ENDPT_CODE,LOGIC_INTERSECT,CMPALD,CURSLD,FBC and XBS.

Briefdescriptionsof theseroutinesfollow:

1) ADDRWAdrawssolidor dashedlinesin floatingpointworld

coordinates.Windowing,viewportingand clippingare

performed.

2) ADDRWSdrawssolidor dashedlinesin integerscreen

coordinates.Clippingis performed.

3) ADLINEperformslinedrawingby writingpixelsto the ADAGE

framebufferusinga Bresenham-likealgorithm.

4) ADMOVA performs a logical "move"in floatingpoint world

coordinates. Windowingand viewportingare performed.

5) ADMOVSperformsa logical"move"in integerscreen

coordinates.

6) ADVUPR defines a rectangularscreen-coordinateviewport from

user-specifiedscreen coordinates.

7) ADWIND defines a rectangularwindow in world coordinates.

8) CLIP2DperformstheSutherland-Cohen2D lineclipping

algorithm.

- 33 -
9) ENDPT_CODEassignsclippingcodesto end points. It is used

by the Sutherland-Cohen2D lineclippingalgorithm.

10) LOGIC_INTERSECTlogicallyintersectsthe clippingcodesof two

points. It is usedby the Sutherland-Cohen2D lineclipping

algorithm.

11) CMPALDloadsa colormap obtainedfroma disk file intothe

ADAGEcolorlookup table.

12) CURSLDloadsa cursordefinition(a trackingcross)froma

disk fileintotheADAGEcursorregisters.

13) FBC loadsuser-specifieddataintothe ADAGEframebuffer

controllerregisters.

14) XBS loadsuser-specifieddata intothe ADAGEcrossbarswitch

registers.

The phase I implementationof the SMP/ADAGEintegrationkeptthe

changesto the code in a fewtightly-controlledroutines.Therefore,

the impacton the user'sinteractionswithSMP is minimalas will be

seen in the USER'SGUIDEsectionof this report. The chiefdifference

to the useris thatthe textof the menusappearson the terminalthat

the useris loggedonto,whilethe graphicsappearon the ADAGEmonitor.

Implementationof the phaseI configurationof the SMP/ADAGE

integrationservedits intendedpurposewell. It providedenhanced

rastergraphicsdisplaycapabilitiesto SMP and improveddisplay

generationspeed. It alsoservedto familiarizeRTIwith the general

internalstructureof SMP.

- 34 -
3.3.2PhaseII Integration.- The phaseII integrationplacesthe

renderingof text,lines,flat-shadedsurfaces,and smooth-shaded

surfacesin theADAGE. The high-speed32-bitmicroprogrammedBPS-32

processor'stightly-coupledrelationshipto the ADAGE'Simagememory

allowsit to renderimagesat a muchgreaterspeedthan host-drawn

pixels. This speedupis the orderof 10 to 100timesthe ratethatthe

VAX 11/785can drawthe pixelsoverthe DMA interface.The speedup

factoris a functionof whatparticularobjectsare beingviewed,what

viewof the objectsis beingrendered,whetherthe viewedobjectsare

requestedto be renderedas lines,flat-shadedsurfaces,or

smooth-shadedsurfaces,and whetheranti-aliasinghasbeen requested.

This speedupin renderingtime shouldgreatlyenhancethe user-SMP

interactionrate.

In orderfor theADAGEPDG to performthe functionsidentified

aboveat a significantspeedup,it must be programmedveryefficiently

usingone of thegraphicslanguageavailablefor the PDG. In addition

to the programmingtaskitself,thisapproachrequiresa matchingof the

the data structuresdescribingthe modelin SMP withthoseassumedby

the graphicslanguagein the PDG. Therefore,it is also requiredto

locatethe datastructureswhichare accessedby SMP and properlyformat

them for SOLID3000 so thatthe modeldescriptioncan be sentto the

ADAGEfor rendering.Consequently,the implementationof the phaseII

configurationwas significantlymorecomplexthan thatof the phaseI

configuration.In phaseI the interfaceto SMP was clearlydefinedin

isolatedsectionsof code. On the otherhand,in phaseII the interface

to SMP requireddetailedknowledgeof the internaldata structuresof

SMP so thatthe properinformationcouldbe located,formattedand sent

to the ADAGEfor rendering.

Several candidategraphics languagesare availablefor the task of

renderingobjects in the ADAGE PDG. These includedthe IkonasDisplay

Language (IDL),GIA, ICROSS, FSS, and SOLID 3000. Each of these
languagesand theirassociatedrequirementsfor interfacingthe ADAGE

with SMP has its advantagesanddisadvantages.

IDL is an assembler-likelanguagewhichproducesopcodesand data

whichareinterpretedby a microcodeddispatcherrunningin the ADAGE

PDG. Whilethis systemcan drawlinesand polygonsat a high rateof

speed,it leavesthe formatting,sending,hand-shakingand timingof the

SMP/ADAGEinteractionentirelyto the applicationsprogrammer.

Furthermore,the languageitselfis not veryflexible,requiringthe

userto resortto writingawkwardcodeto accomplishmany simpletasks.

Also, IDLdoes not haveintrinsicallybuiltin supportfor such

necessarygraphicstasksas clippingor smoothshadingpolygons.

GIA and ICROSSare similarC-likelanguageswhichgenerate

microcodefor the ADAGEBPS-32processorusingcrosscompilersrunning

in the hostcomputer.Whiletheselanguagescan generateimagesat

acceptablerateson the ADAGE,theyboth lacka libraryof basic

functionsto performbasicgraphicsfunctions.Basically,usersare

givenaccessto the entireADAGE3000 PDG internaladdress,register,

and data spaceand fromthereon theyare on theirown. Formattingand

managingdata in the hostare also leftup to the useras in the caseof

IDL. It shouldbe notedthat RTI has recentlycompletedthe development

of a comprehensivelibraryof ICROSS/GIA-basedgraphicsroutines. This

package,calledRAP,for Real-timeAnimationPackage,providesthe user

with a high levelinterfaceto the renderingfunctionsof the ADAGE3000

PDG. Unfortunately,RAPwas not availablein timefor thisproject.

FSS and SOLID 3000 are both FORTRAN-basedlibrariesof graphhlcs

routinescallable by the user's applicationprogram. FSS uses IDL-like

code and microcodein the ADAGE PDG_ SOLID 3000 uses only microcodein

the ADAGE PDG. This microcodewas written specificallyfor rendering

high quality images in the ADAGE.

- 36 -
AlthoughFSScan performanti-aliasing,monitorgammacorrection,

and z-bufferwire frame,flatand smoothshadedimages,it has some

drawbackswhichpreventedits selectionas thegraphicslanguagefor

this application.A majordrawbackof FSSwith respectto this

applicationis that its smoothshadingmethodassumesthatthe ADAGEPDG

videostreamis configuredin pseudocolormode. Thismeansthatonly

512 differentdistinctcolorscanbe usedin smoothshadingall of the

objectsappearingon the screenat any one time. Anotherdrawbackof

FSS is thatthe FORTRANlibraryinterfaceis quiteintricate.Thismay

in turnreducethe hostprocessingspeedbecauseof the largenumberof

subroutineand functioncallsneededto specifywhat dataand opcodes

shouldbe sentto theADAGE. Also,with sucha detailedinterfacethe

potentialexistsfor errorsto remainhiddenin thedevelopedcode.

SOLID3000 is an ADAGEsupportedgraphicsrenderingpackage

intendedto providehighqualityimagerendering.The packageis

designedto be calledby an applicationprogramusinga FORTRANlibrary

callinterface.The packagesupportsfullcolor(16millionshades)

linedrawing,flatshadingof polygons,and smoothshading(Gouraudand

Phong)of polygonswith useraccessto the lightingmodelparameters.

Additionalfeaturesof the packageincludeanti-aliasing,displayingof

PDG-residentdisplaylists,z-bufferedrendering,and monitorgamma

correction.A potentiallyimportantfeatureof SOLID3000 is its

abilityto overlapthe PDG'srenderingprocessingwith the host's

processing.Thiscouldbe used in the futureto furtherenhancethe

speedof the SMP/ADAGEsoftwaresystem.

SOLID 3000 offers an additionalimportantfeature for this

application. The user's applicationinterfaceto SOLID 3000 is less

complex than to FSS. Two or three functioncalls can render a

complicatedobject after a similarnumber of initializationcalls.

- 37 -
Based on the review of the graphics languagesidentifiedabove and

the requirementsof the application,RTI recommendedSOLID 3000 as the

languageof choice for the integrationof the ADAGE PDG rendering

capabilitiesinto SMP. Without question,SOLID 3000 providesthe best

collectionof featuresrequiredto render images in the ADAGE. The

results obtained in both image quality and speed of renderingthese

images substantiatesthe choice of SOLID 3000 as the method to use for

this application. Side by side speed comparisonsof renderingthe same

parts using both the ADAGE/SOLID3000 and an AED display terminal showed

a clear speed advantageusing the ADAGE.

Thus,in the PhaseII versionof SMP (theADAGEusedas a PDG)RTI

interfacedSMP to the SOLID-3000subroutinepackagein the host

computer. The SOLIDsubroutinesthenprovidethe communicationwith the

ADAGEPDG. The RTI-developedinterfaceroutinesare: GET_SLD_COLR,

SLDSMOOTH,SODRWA,SODRWS,SOMOVA,SOMOVS,SEND_2_SOLID,and SLDZWIND.

Briefdescriptionsof theseroutinesfollow:

1) GET_SLD_COLRconvertsSMP colornumbers0-7 intothe

equivalentcolorsin the SOLID3000 fullcolorrepresentation.

2) SLDSMOOTHsmoothshadesone part. Thisis done by calculating

normalsat all verticesin thepart and thensendingthe

vertices'coordinatesand normalsto theADAGEalongwith a

requestto performsmoothshadingof the part.

3) SODRWAdrawssolidlinesin floatingpointworldcoordinates.

Windowing,viewportingand clippingare performed.

- 38 -
4) SODRWSdrawssolidlinesin integerscreencoordinates.

Clippingis performed.

5) SOMOVAperformsa logical"move"in floatingpointworld

coordinates.Windowingand viewportingare performed.

6) SOMOVSperformsa logical"move"in integerscreen

coordinates.

7) SEND_2_SOLIDsendsone faceof a polygonto the ADAGE3000.

The normalto thisface is calculatedand also sentto the

ADAGE. Windowingand viewportingare performed.

8) SLDZWINDstoresZ-windowspecificationsin a FORTRANCOMMON

area in worldcoordinates.

The RTI-modifiedSMP subroutinesare identifiedin AppendixB.

With the exceptionof subroutineSTRMDL,the modificationsto these

routinesare relativelyminorand essentiallyconsistof callsto SOLID

3000subroutines.The meaningand useof the SOLID3000routinesare

documentedin the SOLID3000Referencemanual(Ref. 4). The

RTI-modifiedand RTI-addedcode hasbeencarefullydocumentedin SMP's

FORTRANsourcewithbracketedcomments,"CSLD:"and "CSLDEND"for SMP

PhaseII; "CADG:"and "CADGEND"forSMP PhaseI code changes.

Modificationsto subroutineSTRMDLare describedin AppendixH.

- 39 -
4 USER'S GUIDE

This chapterdescribesthe differencesin the user'sinteractions

with SMP betweenthe originalversionof SMP and the two versionswhich

rendermodelson the ADAGE3000. The differencesare minimalin scope.

Therefore,an experienceduserof SMP shouldhaveno difficultyin

learningto use the new featuresin the new versions.The changesthat

affectthe usermost are the promptsand responsesin the areaof

renderingflatand smoothshadedobjectsin the phaseII (ADAGE/SOLID)

versionof SMP.

4.1 ChangesTo SMP CommonTo Both PhaseI And PhaseII

This section details changes that affect the user's interactions

with SMP and which are common to both Phase I (ADAGE3000 PDG used as a

frame buffer) and Phase II (ADAGE3000 PDG used as a graphicscomputer).

A key differencebetween the original version of SMP and both ADAGE

versionsof SMP is that when a characterstring is to be "printed"on

the display it appearson the user's terminalinstead. This was done

because implementingthe drawing of characterson the graphics display

pixel by pixel could slow user interactionrates with SMP to an

unacceptablerate.

- 40 -
Anotherdifferenceis foundin the graphicseditor,in that,for

the zoom function,andmass propertyroutines,the usermust specify

locationson the screen. The methodof specificationis dependentupon

the particulargraphicsdisplayused,althoughsometypeof usercontrol

of a cursoris the mostoftenusedmethod. The ADAGE/SMPcursor

locationfunctionassumesno particularuserinteractiondevice.

However,the user interactionfunctionhasbeen simulatedusingthe

terminalkeyboard.The useris promptedfor an X, Y pairof screen

coordinatesand the cursoris thenmovedto thatlocationon the screen.

The usercan continueto specifyX, Y pairsuntilthe cursoris located

in the desiredlocation.The userthenindicatesthatthis is the

locationto be acceptedby SMPby typingthe charactercntl-Z. This

actioncausesSMP to savethe lastX, Y pair as the selectedscreen

locationand also to exitthe loopwhichpromptsthe user for furtherX,

Y pairs.

Thismethodof screenlocationspecificationis to be replacedwith

a more naturalmethodof userinteraction,suchas a datatablet,a

joystick,or a mouse,when it is procured,installed,and interfacedby

SAB personnel.The purposeof includingthe presentmethodof

interactionusingthe keyboardwas to be ableto exerciseSMP'sgraphics

editor,zoom,and masspropertycode. An exampleof thismethodof

screenlocationspecificationfollows:

ENTERCURSORX, Y LOCATION(^ZTO CONFIRM):

SCREENIS 0-511IN X AND Y. Y IS UPRIGHT

100,200 <---[user'sresponse]

[thecursorIs movedto (100,200)on the graphicsdisplay]

ENTERCURSORX, Y LOCATION(^ZTO CONFIRM):

SCREENIS 0-511IN X AND Y. Y IS UPRIGHT

150,200 <---[user'sresponse]

- 41 -
[thecursoris movedto (150,200)on the graphicsdisplay]

ENTERCURSORX, Y LOCATION(^ZTO CONFIRM):

SCREENIS 0-511IN X AND Y. Y IS UPRIGHT

cntl-Z <---[user'sresponse]

The location(150,200) is then storedas the user'slocation

specification.

4.2 PhaseI

The differencesin userinteractionbetweenthe originalSMP and

the PhaseI versionof SMP areminimal. Thisis due to the factthat

the PhaseI versionof SMP performsall of the calculationsfor

renderingand shadingfor rasterdevicesin the hostcomputeras it did

in the originalversion. The interfacebetweenthe ADAGEand SMP is

restrictedto beingin the so-called"deviceindependent"routines.

Theseroutinesare organizedin sucha way as to make clearwhat code

neededto be modifiedto supporta particulardisplayconstruct,suchas

erase,draw line,etc. Afterthesebasicconstructshad beenprovided,

the ADAGEthenpresentedthe samestandardizedinterfaceto SMP.

The followingsectionsdealwith the exactdifferencesthatusers

willsee when usingthe new versionsof SMP.

If in responseto the prompt:

ENTER DEVICE CODE

1 = TEKTRONIX401X

2 = AED 512

- 42 -
3 = AED 767

4 = ISC8001R

5 = ADAGE3000

6 = ADAGE3000/SOLID

the user selects

s

5 - ADAGE 3000

a newmessageappearsstating:

ADAGERDS-3000FRAMEBUFFERINTERFACE

DEVELOPEDBY

RESEARCHTRIANGLEINSTITUTE

RESEARCHTRIANGLEPARK,NC

4.3 PhaseII

The PhaseII versionof SMP/ADAGEhasmorechangesthanthe PhaseI

version. Theyare concentratedmainlyin the area relatingto flatand

smoothshadingof models.

If in responseto the prompt:

ENTER DEVICE CODE

1 = TEKTRONIX401X

2 = AED 512

3 = AED 767

- 43 -
4 = ISC 8001R

5 = ADAGE 3000

6 = ADAGE 3000/SOLID

the user respondswith:

6 - ADAGE 3000/SOLID

device6 is selectedand a new message(emphasizingthatthe ADAGEis a

ProgrammableDisplayGenerator)appearsstating:

ADAGERDS-3000PDG INTERFACE

DEVELOPEDBY

RESEARCHTRIANGLE INSTITUTE

RESEARCHTRIANGLEPARK, NC

Two new promptsare issuedin boththe displaycommand's"menu"

commandand in the alphaeditor's"printpartdefinitionand display

part"command. The detailednew userinteractionsare shownin Figures

4-1 and 4-2.

The prompts to the user in regard to a display monitor'sgamma in

Figures 4-1 and 4-2 representa new capability. A display monitor's

gamma is a specificationof the relationshipbetween the brightnessof

an area on the screen and the voltage needed at the input of the monitor

to obtain that brightness. The monitor'sgamma is used in calculating

the brightnessof the pixels used to draw an anti-aliasedline and thus

affects the appearanceof anti-aliasedlines and edges of polygons in

the image on the display monitor. Typically,high resolution,RGB color

monitors have a gamma near 1.8. To obtain the correct gamma value for a

particularmonitor, the user should try differentvalues near 1.8 while

- 44 -
$ R SMP

ENTERDEVICE CODE

1 = TEKTRONIX401X

2 = AED 512

3 = AED 767

4 : ISC 8001R

5 = ADAGE3000

6 = ADAGE3000/SOLID

6

• < A part is either read or created here

ENTERCOMMAND

R - READA PARTSORGEOMETRYFILE

E - EDIT A PARTSFILE

D - DISPLAYA GEOMETRYFILE

P - EVALUATEMASSPROPERTIES

W - WRITEA PARTSORGEOMETRYFILE

H - HELP (DOCUMENTATION)

Q - QUIT

X - EXIT

D

ENTERDISPLAY COMMAND>

R - RESETVIEWINGOPTIONS

M - VIEWINGOPTIONMENU

D - DRAWMODEL

T - DISPLAY FOURVIEWSOF MODEL

Z - ZOOM

S - HIDDENSURFACE

G - GRAPHICSEDITOR

H - HELP (DOCUMENTATION)

Q - EXIT DISPLAY

X - EXIT PROGRAM

M

Figure 4-1. New User Prompts in MENUCommand

-_45 -
DESIGNATETHE "PARTS" TO DISPLAY

"*" INDICATESALL PARTS

"," IS DELIMITER BETWEENPARTS

"-" INDICATESA RANGEOF PARTS

ENTER"Y" TO CHANGETHE

VIEWINGTRANSFORMATION

N

ENTER"Y" TO CHANGETHE

VIEWINGOPTIONS

Y

ENTERBACKFACECULL OPTION

-I - NOCULL

0 - HIDE BACKFACES

I - DASHBACKFACES

0

ENTER"Y" FORPARTLABELS

OR "N" FORNO PARTLABELS

Y

ENTER"Y" FORELEMENTSHRINKING

OR "N" FORNO ELEMENTSHRINKING

N

ENTER"Y" FORANTI-ALIASING

Y New prompts in

ENTERMONITORGAMMA(1.8 TYPICAL): SMPPhase II

2.0

Figure 4-1. Concluded.

- 46 -
$ R SMP

ENTERDEVICECODE

i = TEKTRONIX401X

2 = AED512

3 = AED767

4 = ISC 8001R

5 = ADAGE3000

6 : ADAGE3000/SOLID

6

ENTERCOMMAND

R - READA PARTSORGEOMETRYFILE

E - EDIT A PARTSFILE

D - DISPLAYA GEOMETRYFILE

P - EVALUATEMASSPROPERTIES

W - WRITEA PARTSORGEOMETRYFILE

H - HELP (DOCUMENTATION)

Q - QUIT

X - EXIT

E

ENTEREDITORCOMMAND>

A - ADD PART

M - MODIFYPART

D - DELETEPART

P - PRINT PARTS

C - COPYAN EXISTING PART

R - RESTOREA DELETEDPART

H - HELP (DOCUMENTATION)

Q - EXIT EDITOR

X - EXIT PROGRAM

A

ENTERPARTNAME- BOX(B), SPHERE(S), CONE(C),

PARABOLOID(P),TORUS(T), TRANSLATIONAL-SWEEP(N),

ROTATIONAL-SWEEP(R),ASSEMBLY(A)

BOOLEAN(E),HELP(H), ORQUIT(Q)

B

ENTERPARTDESCRIPTION- 80 CHARACTERSMAXIMUM

B

ENTERLENGTH(XAXIS), HEIGHT(YAXIS),AND WIDTH(ZAXIS)(ALL > O)

III

ENTERINTEGERCOLORCODE(I..7)

i

Figure 4-2. New User Prompts in Alpha Editor

- 47 -
ENTER: 1 PRINT PARTDEFINITION

2 PRINT PARTDEFINITION ANDDISPLAY PART

3 CHANGEPARTDESCRIPTION

4 CHANGEPARTSPECIFICATION

5 CHANGEPARTTRANSFORMATION

6 DETERMINEORDERINDEPENDENTROTATIONANGLES

7 CHANGEPARTCOLOR

8 TO RETURNTO EDITOR(PART OK)

2

DESIGNATETHE "PARTS" TO DISPLAY

"*" INDICATESALL PARTS

II ,l

, IS DELIMITER BETWEENPARTS

"-" INDICATESA RANGEOF PARTS

,

ENTER"Y" TO CHANGETHE

VIEWINGTRANSFORMATION

N

ENTER"Y" TO CHANGETHE

VIEWINGOPTIONS

Y

ENTERBACKFACECULL OPTION

-I - NO CULL

0 - HIDE BACKFACES

I - DASHBACKFACES

0

ENTER"Y" FORPARTLABELS

OR "N" FORNOPARTLABELS

Y

ENTER"Y" FORELEMENTSHRINKING

OR "N" FORNOELEMENTSHRINKING

N

ENTER"Y" FORANTI-ALIASlNG

Y New prompts in

ENTERMONITORGAMMA(1.8 TYPICAL): SMPPhase II

2.0

Figure 4-2. Concluded.

- 48 -
observingnearlyhorizontalor verticallines. When theselineslose

their "rope-like,""knotted"appearance,the gammavalueis correctly

set.

In the areaof hiddensurfacedisplay,the new userpromptsand

appropriateformof responsesis givenin Figure4-3. Notethatwhen

eitherthe HIDDENLINEor BOTHoptionis selecteda newmessageappears

statingthathiddensurfaceremovalwillbe performedinstead. This is

becauseADAGE'sSOLID3000packagedoes not supporthiddenline removal,

a displaytechniquewhichwas oftentheonly typeof displaythatcould

showdepthinformationon vectoror storage-tubedisplays. Raster

displayscan effectivelydisplayhiddensurfacesso the hiddenline

removalfunctionis not as importantfor thesedisplays.

Alsonote that,as in the originalSMP,thereare two SHADING

OPTIONS,flat and smooth(Gouraud)shading. However,withinthe smooth

option,thereare new promptsasociatedwith the lightingmodel,

antialiasing,andmonitorgammacorrection.The lightingmodelusedby

the SOLID3000systemconsistsof a fixedlightsourcewhose

characteristicsare definedby the sum of ambient(AMB),diffused(DIF),

and reflected(REF)components.Eachof thesecomponentscan be

specifiedin the rangefromzero (0)to 32767whichcorrespondsin the

lightingmodelto a fractionalvaluebetweenzero (0)and one (1). The

zerovaluerepresentsblackwhereasone representsthe fullintensityof

eachpart'scolor. In additionto brightness,the reflectedcomponent

of the lighthas an exponentspecificationwhichdeterminesthe visual

characteristics(appearance)of highlightson the parts. Althoughthere

is no rangespecifiedfor thisparameter,it is observedthatsmall

values(<5)produceimageswith large,diffusedhighllghtswhereaslarge

values(>15)produceimageswithsmall,concentratedhighlights.While

thisdescriptionprovidesa basicunderstandingof the lightingmodel

- 49 -
$ R SMP

ENTERDEVICECODE

I = TEKTRONIX401X

2 = AED 512

3 = AED 767

4 = ISC 8001R

5 = ADAGE3000

6 = ADAGE3000/SOLID

6

• < A part is either read or created here

ENTERCOMMAND

R - READA PARTSORGEOMETRYFILE

E - EDIT A PARTSFILE

D - DISPLAYA GEOMETRYFILE

P - EVALUATEMASSPROPERTIES

W - WRITEA PARTSORGEOMETRYFILE

H - HELP (DOCUMENTATION)

Q - QUIT

X - EXIT

D

ENTERDISPLAY COMMAND>

R - RESETVIEWINGOPTIONS

M - VIEWINGOPTIONMENU

D - DRAWMODEL

T - DISPLAY FOURVIEWSOF MODEL

Z - ZOOM

S - HIDDENSURFACE

G - GRAPHICSEDITOR

H - HELP (DOCUMENTATION)

Q - EXIT DISPLAY

X - EXIT PROGRAM

S

ENTER S - ELIMINATE HIDDENSURFACE

L - ELIMINATE HIDDENLINES

B - BOTH(SEPARATEVIEWS)

R - RETURN

L < [S or B give the same series of prompts]

Figure 4-3. New User Prompts in Hidden Surface Display

- 50 -
DEVICE6: S - ELIMINATE HIDDENSURFACEUSED<-- [This message is

ENTER"Y" TO OVERRIDEDEFAULT given when L or

IMAGEDISPLAY OPTIONS B is answered]

N

ENTERSHADINGOPTION

0 - FLAT ELEMENTSHADING

I - SMOOTHELEMENTSHADING

I

ENTERY TO CHANGESHADINGPARAMETERS

y

ENTERAMBIENT, DIFFUSE, REFLECTEDVALUESOF LIGHT:

(THE SUMOF AMBIENT, DIFFUSE, & REFLECTEDSHOULDBE < 32767)

(AMB:6000, DIF=22000, & REF=4000 IS GOOD)

6000,22000,4000

ENTEREXPONENTFORREFLECTEDLIGHT (20 IS GOOD):

2O

ANTI-ALIASlNG? (DEFAULT-NONE)(YORN): New prompts in

y SMPPhase II

ENTERMONITORGAMMA(1.8 IS TYPICAL):

2.0

PHONGSHADING?(DEFAULT-GOURAUD)(YORN):

Y

ENTERBACKFACECULL OPTION

N - NO BACKFACECULL

Y -PERFORM BACKFACECULL

R - RETURN

Y

ENTER"Y" FORANTI-ALIASING

Y New prompts in

ENTERMONITORGAMMA(1.8 TYPICAL): SMPPhase II

2.0

Figure 4-3. Concluded.

- 51 -
usedby SOLID3000,it is notedthatperceptionof the effectof a

lightingmodelis verysubjective.Thus,to obtainthe desiredeffect,

the usermightneedto iterateon the lightingmodelparameters.The

SOLID3000referencemanual(Ref. 4) providesadditionalinformation

aboutthe lightingmodel.

In addition,underphaseII,the smoothshadingoptionsupports

Phongshadingas wellas the originalGouraudshading. Theseshading

methodsbasicallydifferin that in Gouraudshadingthe intensitiesare

linearlyinterpolatedbetweenvaluesat the edgesof the polygonsbeing

renderedwhereasin Phongshadingthe surfacenormalsare interpolated

acrossthe visiblespanof the polygonbeingrendered(Ref. 6). As a

result,Phongshadingproducesmore realisticimagesthanGouraud

shadingbecausehighlightsof the objectsare more faithfully

reproduced.However,the renderingtime is longerfor Phongshading

than forGouraudshadingin thisapplication.

Anotherareawherea changeis seenby the usercan occurin the

areawherethe user is giventhe optionto storean imageon disk. A

responseof "1"answeredto the prompt:

ENTER DISPLAY/DISKIMAGE OPTION

gives the message:

DEVICE6: IMAGENOT IN STORABLEFORMAT

The SMP Manual states that storing the image in file SMGG.IMG "...is

most applicableto generatinga shaded image for post processingwhile

working from a non-rasterdisplay device."The ADAGE RDS 3000 is a

raster device so this option is not as importantas it is to a

non-rasterdisplay.

- 52 -
Anotherminordifferencebetweenthe originalversionof SMP and

the PhaseII ADAGEversionis as follows.

If in responsetothe prompt:

ENTERBACK FACECULLOPTION

the userselects

DASH BACK FACES

the backfaceswillbe drawnas solidlinessinceADAGE'srendering

packagecurrentlydoes not directlysupportdashedlines. The dashed

linefeaturecouldbe simulatedbutwith an overheadthatcould

substantiallyslowthe drawtimeof modelsusingthisfeature.

It shouldbe notedthatthereare two featureson the PRIME/PRIMOS

versionof SMP whichare not implementedin the versionsof SMP which

RTI portedto the VAX/VMSenvironmentat SAB. Theseare the interrupt

capabilityand the HELPfacility.However,the lackof thesefeatures

doesnot affectthe abilityto renderimagesin eitherof the two

versionsof SMP developedby RTI.

- 53 -
5.0 ADDITIONALTECHNICALISSUES

This chapteraddressesadditionaltechnicalissueswhichhavethe

potentialfor furtherimprovingthe performanceof the SMP/ADAGEPDG

displaysoftwaresystemin specificareas. Theseincludeperforming

localtransformationsin the PDG,addingthe capabilityformodel

animation,and improvingthe accesstimeto readthe temporarygeometry

filesduringimagegeneration.

5.1 Local Transformations

In a typicalapplication,an SMP userdevelopsa model,rendersit

in wireframeform,and transformsit severaltimesuntilhe/sheis

satisfiedwiththe result. It is only thenthatthemodel is shaded

usingone of the availableshadingschemesin SMP. The processof

renderinga transformed,wireframemodelconsistsof retrievingthe

modeldefinitionfromdiskwhereit existsin a geometryfile formatand

performingtransformationson thedata twice,oncefor settingclipping

box boundariesand scalingandonce formodelviewing. The firstset of

transformationsdeterminesthegreatestextentof the transformedmodel

in X, Y, and Z for settingclippingbox boundariesand scaling

parameters.The secondset of transformationsactuallytransformthe

model'spointsfor scalingand viewing. Thesetransformationscannot

takeplacesimultaneously- theymustbe done in sequencein orderto

havethe clippingand scalinginformationavailableduringthe second

set of transformations.

- 54 -
In the softwaresystemdevelopedby RTI,transformationsare

performedby SMP in FORTRANin the VAX-11/785.It has been suggested

thatperformingtransformationsin theADAGEPDGwouldprovide

additionalgainsin imagerenderingspeedoverwhat has alreadybeen

achieved.

There are two Jays in which transformationscan be achieved in the

PDG: splittingthe two sets of transformationsbetween the host and the

PDG and performingboth sets of transformationsin the ADAGE PDG. The

former can be done using existingfacilitiesin SOLID 3000 and no

additionalhardware. The latter requiresmodificationsto the SOLID

3000 microcodesystem residing in the ADAGE's MCM4 memories and

additionalspace in MCM4 memory to store the user written microcode

routines. (If this is a problem,additionalMCM4 memories can be

purchased). In addition,this method would require enough storage space

in the PDG to accomodatethe entire model. This storage space can be

provided by an SP-256 memory. The control and configurationof the

SP-256 and the model size that it can accomodateare discussedin the

next section.

Althoughboth approachescan be implementedwith varyingdegreesof

technicaleffort,RTI feelsthatotherassociatedareasneed to be

addressedpriorto the implementationof localtransformationsin the

PDG. This is due to the factthatthe portionof the renderingtime

associatedwith disk I/O is the dominantfactorof the renderingtime.

In fact,the potentialspeedimprovementattainablewith local

transformationscouldbe insignificantcomparedto the timespentdoing

I/O to retrievepartsin geometryfileformat. Forexample,it has been

observedduringthe developmenteffortthatthe time spentdoingdisk

accessesslowsthe renderingof "wireframe"linedrawings. This is in

contrastto the renderingof shadedimagesin whichthe timespent

renderingis usuallylongerthanthe time spentin readingthe model

fromthe disk.

- 55 -
Becauseperforming local transformations in the PDGshows uncertain

gains and the need for additional hardware and microcode development,

RTI recommendsthat this area is not addressed until the disk I/0 area

is dealt with.

5.2 Model Animation

Model animation in real time would provide the SMPuser with a new

capability to facilitate his/her ability to analyze the three

dimensional nature of the resulting models. The resources required to

perform model animation include additional hardware in the PDGand in

the host computer, additional software in the host, and an expanded user

interface in SMP.

Model animationwould involveputting an entire model into the

ADAGE, leaving it there and repeatedlysending transformation

informationto the ADAGE. This means that the model would not have to

be read from its direct access disk file, or sent to the ADAGE each time

a differentview of the model was drawn. In fact, a continuoussmooth

rotationof relativelycomplex models shouldbe attainableusing the

techniquesof double buffering,mask mode erasingof image memory, and

drawing of aliased wire-frameimage. An additionalissue here is

choosinghow the user would specify the model's rotation. This could

make use of a joystick, "toothpick"-stylejoystick,data tablet, or

other "valuator"interactiondevice.

In order to store an entire model's data in the ADAGE additional

memory would be required. It is in this area that ADAGE's SP-256 memory

could be useful. The intendeduse of the SP-256 memory board is to

allow users the ability to store large display lists in the ADAGE 3000

display system. An SP-256 is essentiallya DR-256 image memory board

- 56 -
whichis accessedin wordmode ratherthanpixelmode. One SP-256

memorycan holdapproximately16,000wire framepolygonsor 11,000flat

or smoothshadedpolygons. For comparisonpurposes,it is notedthat

the spacestation,shuttle,OTV,and solarenginedataprovidedto RTI

by SAB,whichcontains6400polygons,can be accomodatedeasilyby one

SP-256,leavingspacefor 4600additionalpolygons. Largermodelscan

be accomodatedwith additionalSP-256's.

The SOLID3000renderingpackagecan makeuse of the SP-256to

storelargedisplaylists. However,thereare certainrestrictionsin

its usebecauseof the way the SOLID3000'sinternalstackpointeris

implemented.The stackpointeris a 24-bitaddress,but the high8 bits

remainunchangedduringthe executionof the program. Thus,the low

order16 bitscan onlyaddressa 64K portionof the 256K. Also, it is

desirableto implementSOLID'sstackat the highestaddressin memory

and build "downward"as valuesare pushedontothe stack,whiledisplay

listsstartat a low memoryaddressand build"upward"so that themost

efficientuse of the memorycan be made.

However,the standarddistributionof SOLID3000 has its stack

pointerpointedat the highestaddressin the SR-8memory(whichis a

requiredcomponentof a systemwhichis to runSOLID3000). Thus,when

an SP-256is used in placeof the SR-8memory,(bysettingits address

to be the sameas an SR-8)onlyone quarterof thememory(64K)can

normallybe used. This situationcanbe remediedby compilingthe

startinglocationof the stackas beingthe highestaddressof the

SP-256and lettingdisplaylistsbuildupwardfromthe lowestaddressin

the SP-256. Usingthisrecompilationwouldallowaccessto the entire

SP-256memoryaddressspace.

- 57 -
Usingan SP-256in themannerjust describedhas a drawback;the

SP-256has a memorycycletimeof 200 nsecwhichis half the speedof

the SR-8memory. So boththe stackand displaylistswouldbe in this

slowermemory. Whilethismay be acceptable,a partialsolutionto this

problemwouldbe to use bothan SP-256and an SR-8 in the systemat the

sametime. The stackcouldbe implementedin the SR-8,and the display

listswoulduse the SP-256. The stackwouldthenmake use of thehigher

speedmemory. The SP-256wouldneedto have its locationin address

spacechangedso that it did not overlapthe SR-8'saddressspacein

thisconfiguration.Displaylistswouldnot be sentto the lowest

addressin SR-8memory(whichis the defaultsoftwareconfiguration)but

specificallysentto the lowestaddressin the SP-256usingthe SOLID

3000 functionDSLOADinsteadof the functionDSSENDwhichis the usual

methodusedto senddisplayliststo the ADAGE. Also,a DSTARTis

requiredto be usedafterDSLOADingthe displaylistto the ADAGE3000.

Additionalsoftwaredevelopmentin the hostwouldbe requiredto

implementmodelanimationin realtime. Thissoftwarewouldhaveto

supportrequestsby the userto performmodelanimation,specifications

as to how the modelis to be animated,requeststo terminatethe

animation,and requeststo re-scalethe modelbasedon the lastviewing

transformationusedduringmodelanimation.

This last capabilityis needed to insure that the model is scaled

correctlyto completelyfill the screen. Duringmodel animation,

corners of the model may occassionallybe clipped at the edges of the

display. This could result because,in contrastto single image

rendering,the model would not be rescaledeach time it is transformed

and rendered.

- 58 -
Thereis a possibilityto eliminatethe needfor the lasttwo

requirementsidentifiedaboveby implementingsupportfor interactive

zooming. Thisapproachwouldrequirean additionalcontrolin the

interactivedevice,prescalingthemodeldatastoredin the ADAGEto

allowbothexpansionand shrinkingof the image,and alteringthe

scalingfactorsof the transformations.

5.3 TemporaryGeometryFormat Files

Improvingthe timerequiredto readtemporarygeometryformatfiles

fromdisk has beenidentifiedas a precursorto the implementationof

localtransformationsin the ADAGEPDG. This is a functionwhichusesa

relativelylargeamountof timewhiledoingimagerendering.Whenevera

userdefinesa part in the SMP editoror readsan existingpartsfile,

SMP writesto diska temporary,geometry-formatfilecorrespondingto

the parts. Thisfile is readfromdiskwheneverthe userdisplaysa

modelor a part. Notethatbecauseof the way modelanimationis

proposed,disk readtimewouldnot be a factorin the modelanimation

updaterate.

There are several approachesthat can be investigatedto improve

the performanceof interactingwith the geometrydata file. One

approach is to create large arrays internalto the SMP program and

storing in them the data normallystored in disk in the temporary

geometryfile. Since these arrayswould make SMP larger than the

physical memory in the VAX, the virtualmemory feature of the operating

system would be used to read the geometry file informationinto physical

memory as it is needed.

- 59 -
Anotherapproachis to usedata structuresfor the geometryfile

whichare differentfromthe one currentlyused,e.g.,hashedstorage.

Yet anotherpossibilityis the placingof thegeometryfiledata in

an ADAGESP-256memory. Thiswouldrequirethe implementationof

specializeddata structures.

5.4 Summary

In summary,the varioustechnicalissuesdealtwith in this section

are attainablewith variousdegreesof technicaleffortand hardware

investment.

Modelanimationdependsprimarilyon havingenoughmemoryto hold

the entiremodelin the ADAGEdisplaylistmemoryarea. The

advisabilityof usinglocaltransformationsin the ADAGEPDG dependson

the relativemeritsof splittingthe locationof the existingSMP

transformationscomparedto the gainsthatmightbe obtainedin

renderingspeed. The variousmethodsof speedingup the extensivedisk

I/O for temporarygeometryfilesdependon the availabilityof enough

physicalmemoryin the VAX-11/785.Thus,the capabilitiesof SMP can be

expandedto providenew featuresand evenfasterrenderingspeeds.

- 60 -
6.0 SUMMARY.OFACCOMPLISHMENTS

The ResearchTriangleInstitute,workingcloselywith SAB

personnel,haveaccomplishedthe followingwork:

1) Convertedthe PRIME/PRIMOSversionof SMP to a VAX/VMS

Version.

2) Validatedthe convertedVAX/VMSversionof SMP usingassembly

filesfurnishedby SAB.

Duringthe enhancementof the VAX/VMSversionof SMP to supportthe

ADAGERDS-3000displaythe followingworkwas performed:

3) Addedcodeto SMP to loadtheADAGEcolorlook-uptable.

4) Added code to SMP to initializethe ADAGE frame buffer

controllerto 512 X 512 60 Hz, noninterlaced.

5) Addedcodeto SMP to initializetheADAGEcrossbarswitchto

straightthroughconfiguration.

6) Addedcodeto SMP to initializetheADAGEcrossbarswitchto

defeatoverlayoption.

- 61 -
7) Addedcodeto SMP to initializetheADAGEchannelcrossbar

switchto fullcolor.

8) Addedcodeto SMP to initializethe ADAGEcursorregisters

with a defaultcursor,a trackingcross.

9) ModifiedRTI'scopyof MOVIEBYU to accomodatethe sizeof the

partscreatedby the assemblyfilefurnishedby SAB in order

to testSMP'sMOVIE-formatwritecapability.

10) Addedcode to SMP to initializetheADAGEimagememoryread

and writemasks.

11) Added code to SMP to perform windowingand viewporting.

12) Addedcode to SMP to performclippingto the screenviewing

region.

13) Added code to SMP to perform drawing of dashed lines (with the

ADAGE used as a frame buffer)

14) Modifiedcodein SMP to removethe drawingof boxesaroundthe

4 viewsdisplay(aswell as in otherformatsof displays).

15) Installedthe PhaseI versionof SMP/ADAGE3000 PDG in SAB's

VAX11/785.

16) Addedcodeto SMP to loadthe colormap in the ADAGEwith the

valuesrequiredby the SOLID3000system.

17) Added code to SMP to perform SOLID 3000 line drawing.

18) Addedcodeto SMP to performSOLID3000flatshading.

- 62 -
19) Designedand implementeda lineartimealgorithmto create

normalsat eachcornerof eachpolygonas requiredby SOLID

3000for smoothshading.

20) Addedcodeto SMP to performSOLID3000Gouraudsmooth

shading.

21) Addedcodeto SMP to performSOLID3000 Phongsmoothshading.

22) Addedcodeto SMP to performSOLID3000hiddensurfaceremoval

usingthe ADAGEinternalZ-buffering.

23) Providedassistanceto SAB personnelin theirworkof hosting

theADAGE3000 in the VAX-11/785.

24) Added code to SMP to perform anti-aliasing.

25) Added code to SMP to performmonitor gamma correction.

26) Installedthe PhaseII versionof SMP/ADAGE3000 PDG (SOLID

3000)in SAB'sVAX11/785.

27) Documentedthe above work.

- 63 -
7.0 SUMMARYOF CONCLUSIONSAND RECOMMENDATIONS

The researchconductedunderthisprojecthas led to the following

conclusions:

1) ADAGE'sSOLID3000renderingpackagewas determinedto be the

besttool to interfaceSAB'sSMP programto itsADAGERDS-3000

display.

2) SOLID 3000's functionSPOLY was determinedto be the method of

choice to enter SMP's data structuresinto SOLID 3000.

3) The ADAGERDS 3000is viablegraphicdisplayto use to support

enhancedspeedof renderingby the solidmodelingprogramSMP.

Reasonableimprovementsin renderingspeedwere obtainedwith

the phaseI configurationand verysignificantimprovementsin

renderingspeedwereobtainedwiththe phaseII configuration

of the displaysystemsoftware.

4) SMP is a more valuable researchtool to thepersonnel of SAB

now that the ADAGE RDS 3000 can be used as a display.

5) SMP/SOLID3000 can provide enhancedtypes of renderingsuch as

anti-aliasing,monitor gamma correction,and higher quality

smooth shading of both the Gouraud and Phong type.

- 64 -
The followingrecommendationsemergefromthework performedunder

this contract:

6) Exploitthe capabilitiesprovidedby havinga largemodel's

displayliststoredin the ADAGEin an SP-256memorycard.

This couldprovideanimationof the models.

7) Investigatethe possiblespeedgainwhichmightbe obtainedby

storingthe datanormallystoredin the temporarygeometry

disk filein largearraysinternalto the SMP program. The

operatingsystem'soptimizeddiskpagingI/Owouldthenbe

usedto readthe geometryfile informationintomemoryas it

is neededusingthe pagefaultingmechanism.

8) Explorethe possibilityof usingotherdata structures(e.g.

hashedstorage,etc.)for storingthe geometryfiledata.

9) Explorethe possibilityof holdingall geometryfiledata in

theADAGESP-256. Specializedatastructureswouldbe

necessaryto do this.

10) Acquirean interactivedevicecapableof specifyingX and Y

(andpossiblyZ) informationfor interactionwithSMP.

- 65 -
APPENDIXA

PARTIALSTATIC CALLINGSTRUCTUREFORSMP/ADAGE3000

FORMAT: I I ...Routine-Name(Filename)

The numberof "I " patternsindicatesthe depth

of the callingstructure.

SMP (SMPMISC)

SINITT (SMPMISC)

I - - - GDINIT (DIDDGS)

TITLE (DIDDGS)

- - - GINITT (SMPMISC)

- - - OPENGEO(PRIMTV)

- - - DISCTE (DIDDGS)

- - - DIERAS (DIDDGS)

- - - SMPDOC (SMPMISC)

- - - DIERAS (DIDDGS)

- - - SMPDOC (SMPMISC)

- - - DISPLAY (DISPLAY)

SAVOPT (DISPLAY)

DIERAS (DIDDGS)

DISCTE (DIDDGS)

RSTOPT (DISPLAY)

RSETTV (DISPLAY)

SAVOPT (DISPLAY)

DMENU (DISPLAY)

DIDUMP (DIDDGS).

SPP (DISPLAY)

RST (PRIMTV)

DIDUMP (DIDDGS).

SETRNG (DISPLAY)

- - - WINDOW (DISPLAY)

- - - SAVOPT (DISPLAY).

DIERAS (DIDDGS).

DRAW (DISPLAY)

I DICOLR (DIDDGS)

- 66 -
- - - DIMOVW (DIDDGS)

- - - DIDRWW (DIDDGS)

DIDRWW (DIDDGS)

DIDRWW (DIDDGS)

DIDRWW (DIDDGS)

DIDUMP (DIDDGS)

- - - STRCOLR(DISPLAY)

DICOLR (DIDDGS)

LLNXT (PFZGF)

- - - GEOFIL (PRIMTV)

DICOLR (DIDDGS)

UAPPLY (U)

HIDDEN (DISPLAY)

- - - SHRINK (DISPLAY)

DFACE (DISPLAY)

- - - GET SLD COLR (SLDSUBS)

SPO[Y -(SOLID)

DIMOVW (DIDDGS)

DIDRWW (DIDDGS)

DIDSHW (DIDDGS)

DFACE (DISPLAY)

GET SLD COLR (SLDSUBS)

SPO[Y -(SOLID)

DIMOVW (DIDDGS)

DIDRWW (DIDDGS)

DIDSHW (DIDDGS)

UAPPLY (U)

UAPPLY (U)

UAPPLY (U)

DIMOVW (DIDDGS)

DIDUMP (DIDDGS)

DITEXT (DIDDGS)

AXIS (DISPLAY)

DIHOME (DIDDGS)

DIDUMP (DIDDGS)

DISCTE (DIDDGS)

LOGO (DIDDGS)

DISCTE (DIDDGS)

WPXLA (DIDDGS)

I DDVTOS (DIDDGS)

DIDUMP (DIDDGS)

DIOVRR (DIDDGS)

DIHOME (DIDDGS)

VIEW4 (DISPLAY)

DIERAS (DIDDGS)

SETRNG (DISPLAY)

.... DIVUPR (DIDDGS)

DDVTOS (DIDDGS)

DDVTOS (DIDDGS)

TWINDO-TEK

RESCAL

ALOG

FLOAT

PSCAL

- 67 -
URSCAL

- - - AMAXl

AMIN1

WINCOT

WINCOT

FLOAT

WINCOT

SIGN

FWINDO-TEK

ISCTWIN

UCOPY (U)

UIDENT (U)

WINDOW (DISPLAY)

DRAW (DISPLAY)

BOXNODE(LINKDUMMY)

DIVUPR (DIDDGS)

UIDENT (U)

UPRMC (U)

- - - WINDOW (DISPLAY)

DRAW (DISPLAY)

BOXNODE(LINKDUMMY)

DIVUPR (DIDDGS)

UIDENT (U)

UPRMC (U)

- - - WINDOW (DISPLAY)

DRAW (DISPLAY)

BOXNODE(LINKDUMMY)

DIVUPR (DIDDGS)

UIDENT (U)

RST (PRIMTM)

UCOPY (U)

- - - WINDOW (DISPLAY)

DRAW (DISPLAY)

BOXNODE(LINKDUMMY)

DIVUPR (DIDDGS)

DIWIND (DIDDGS)

UCOPY (U)

LOGO (DIDDGS)

DIPAUS (DIDDGS)

ZOOM (DISPLAY)

SAVOPT (DISPLAY)

HSDRVR (DISPLAY)

CMPRES (DIDDGS)

INITPRI (PRIORTY)

STRCOLR(DISPLAY)

LLNXT (PF2GF)

GEOFIL (PRIMTV)

STRMDL (PRIORTY)

UAPPLY(U)

GETSLD COLR(SLDSUBS)

SCOL-OR_SOLID)

PLANEQ(PRIORTY)

SPOLY (SOLID)

PLANEQ(PRIORTY)

- 68 -
- - - HIDSURF(PRIORTY)

PRIORTY(PRIORTY)

SPECIAL(PRIORTY)

)RAWHS (SCANLINE)

...... DDSTOV (DIDDGS)

DDSTOV (DIDDGS)

DIVUPR (DIDDGS)

- - - DIWIND (DIDDGS)

- - - DICTAB (DIDDGS)

DICTAB (DIDDGS)

SHADER (SCANLINE)

I CENTER PLANEQ(SCANLINE) (PRIORTY)

- - - INTENS (SCANLINE)

CHKNOD(SCANLINE)

NORAV (SCANLINE)

NORAV (SCANLINE)

| PLANEQ(PRIORTY)

OPEN ('SMGG.IMG')

VTOS (SCANLINE)

INITAET(SCANLINE)

INITSET(SCANLINE)

SCNFIL (SCANLINE)

SCNINT (SCANLINE)

I EMAXY (SCANLINE)

SETSET (SCANLINE)

SMOOTH (SCANLINE)

DSPLASL(SCANLINE)

DIDUMP (DIDDGS)

SL2D (SCANLINE)

DDSTOV (DIDDGS)

WPXLA (DIDDGS)

WPXLA (DIDDGS)

- - - SETAET (SCANLINE)

- - - DSPLASL(SCANLINE)

- - - DIDUMP (DIDDGS)

- - - SL2D (SCANLINE)

DDSTOV (DIDDGS)

- - - WPXLA (DIDDGS)

- - - WPXLA (DIDDGS)

LOGO (DIDDGS)

DIPAUSE(DIDDGS)

RSTOPT (DISPLAY)

DIOVRR (DIDDGS)

DICTAB (DIDDGS)

DICOLR (DIDDGS)

DIHOME IDIDDGS)

DIDUMP DIDDGS)

GRAPHIC(GRAPHICS)

SMPDOC (SMPMISC)

DIERAS (DIDDGS)

SMPDOC (SMPMISC)

OPENGEO(PRIMTV)

- 69 -
I EXIT (FORTRANEXIT)

AEDIT (ALPHA)

- - - DISCTE (DIDDGS)

- - - DIERAS(DIDDGS)

EDADD (ALPHA)

EDCHNG (ALPHA)

I EDDRAW (ALPHA)

EDDEL (ALPHA)

- - - DIERAS (DIDDGS)

EDPRNT (ALPHA)

- - - DIPAUS (DIDDGS)

- - - SMPDOC (SMPMISC)

- - - DIERAS (DIDDGS)

- - - SMPDOC (SMPMISC)

- - - SMPDOC (SMPMISC)

- - - SMPDOC (SMPMISC)

SMPDOC (SMPMISC)

SMPDOC (SMPMISC)

SMPDOC (SMPMISC)

SMPDOC (SMPMISC)

SMPDOC (SMPMISC)

EDCOPY (ALPHA)

OPENGEO(PRIMTV)

EXIT (FORTRANEXIT)

EDREST (ALPHA)

READGM (SMPMISC)

MASPROP(MASPROP)

OPENGEO(PRIMTV)

EXIT (FORTRANEXIT)

SAVEGM (SMPMISC)

OPENGEO(PRIMTV)

EXIT (FORTRANEXIT)

- 70 -
APPENDIXB

LISTOF SMP'SMODIFIEDSUBROUTINES

SUBROUTINEAEDIT

SUBROUTINEANGCALC(A,B,C,ISTAT)

SUBROUTINEAXIS

SUBROUTINEBREAKIT(IPNTR)

SUBROUTINECHNGALL(ID,IOPER,NCOMPNU,PCOMPNU)

SUBROUTINECLEANN

SUBROUTINECMPRES(IDISK,ICHANG,IMIN,IMAX)

SUBROUTINECOLMOV(IASSEM1)

SUBROUTINEDDVTOS(XV,YV,IXS,IYS)

SUBROUTINEDDWTOS(XW,YW,IXS,IYS)

SUBROUTINEDEGREES(X,Y,XC,YC,THETA)

SUBROUTINEDFACE(N,X,IDASH)

SUBROUTINEDICHRSZ(NUM)

SUBROUTINEDICOLR(NUM)

SUBROUTINEDICTAB(IOPT)

SUBROUTINEDICURS(ICH,XW°YW)

SUBROUTINEDIDRWS(XV,YV)

SUBROUTINEDIDRWW(XW,YW)

SUBROUTINEDIDSHS(XV,YV,IDASH)

SUBROUTINEDIDSHW(XW,YW,IDASH)

SUBROUTINEDIDUMP

SUBROUTINEDIERAS

SUBROUTINEDIMOVS(XV,YV)

SUBROUTINEDIMOVW(XW,YW)

SUBROUTINEDIPAUS

SUBROUTINEDISCTE(NCTE,IR,IG,IB)

SUBROUTINEDISPLAY

SUBROUTINEDISTCK(XPT,YPT,XNEW,YNEW, IVINRNG)

SUBROUTINEDITEXT(LENS,CHARS)

SUBROUTINE DIVUPR (XMINV,XMAXV,YMINV,YMAXV)

SUBROUTINEDIWIND(XMINW,XMAXW,YMINW,YMAXW)

SUBROUTINEDMENU

SUBROUTINEDRAW

SUBROUTINEDRAWHS

SUBROUTINEEDADD

SUBROUTINEEDCHNG(ID,IOPT)

- 71 -
SUBROUTINEEDCOPY(ID,IOPT)

SUBROUTINEEDDEL(ID,IOPT)

SUBROUTINEEDDRAW(IPART)

SUBROUTINEEDPRNT(FIRST,LAST)

SUBROUTINEEDREST(ID,IOPT)

SUBROUTINEEXTRN (NPART,TP,INR)

SUBROUTINEGDINIT(IGD,IBAUD)

SUBROUTINEGEOFIL(OPTION,NPART)

SUBROUTINEGRAPHIC

SUBROUTINEHEADR(NAME,NUMHD,STATHD,TRANSHD)

SUBROUTINEHSDRVR

SUBROUTINELOGO

SUBROUTINEMASPROP

SUBROUTINEOPENGEO(IOPT)

SUBROUTINEOPENW(DESC,ICODE)

SUBROUTINEPCFFIO(IVW,ILINES)

SUBROUTINEPRINIT(IIBAUD)

SUBROUTINERDGEO(IREAD)

SUBROUTINERDMOV (IREAD)

SUBROUTINERDRNEW(IREAD)

SUBROUTINEREADER(IREAD)

SUBROUTINERSETTV

SUBROUTINERST(VECTOR,ARRAY,NPART)

SUBROUTINESAVGEO

SUBROUTINESAVMODL

SUBROUTINESINITT

SUBROUTINESMPDOC(INDEX,ICODE)

SUBROUTINESTRMDL(NMAX,NN,X,N,IF,T,IPC,INERR)

SUBROUTINETITLE

SUBROUTINEUSETAU(NAME,VAL)

SUBROUTINEVIEW4(IFLAG)

SUBROUTINEWINDOW

SUBROUTINEWPXLA (XV,YV,MAXR,NR,NC,IPIXEL)

SUBROUTINEZOOM

- 72 -
APPENDIXC

LISTINGSOF SOFTWAREMODULESDEVELOPEDFOR SMP/ADAGEINTEGRATION

C FILENAME: ADSUBS.FOR

C

************************************************************************

SUBROUTINEADDRWA(XW,YW, IDASH )

C

C DRAWA LINEUSINGFLOATINGWORLDCOORDS. THE OTHERPOINTTO

C DRAW FROMIS (XCUR,YCUR)IN COMMON/ADAGE/.

C

IMPLICITNONE

C

COMMON/ADVUPR/IXMINS,IXMAXS,IYMINS, IYMAXS,

• IXVSIZ,IYVSIZ,IXVCNTR,IYVCNTR

INTEGER IXMINS,IXMAXS,IYMINS, IYMAXS,

• IXVSIZ,IYVSIZ,IXVCNTR,IYVCNTR

COMMON/ADWIND/XMINW, XMAXW, YMINW, YMAXW,

• XWSIZE,YWSIZE,XWCNTR, YWCNTR

REAL XMINW, XMAXW, YMINW, YMAXW,

• XWSIZE,YWSIZE,XWCNTR, YWCNTR

C

INTEGER*2IX, IY

INTEGER*4IDASH

REAL XW, YW

C

C PERFORMWINDOWING& VIEWPORTING:

IX = (((XW-XWCNTR)/ XWSIZE)+ 0.5 ) * IXVSIZ+ IXMINS

IY = (((YW-YWCNTR)/ YWSIZE)+ 0.5 ) * IYVSIZ+ IYMINS

C

CALL CLIP2D(IX,IY,O, 511,O, 511, IDASH )

RETURN

END

- 73 -
SUBROUTINEADDRWS(IXS,IYS,IDASH )

C

C DRAWA LINEUSINGINTEGERSEREENCOORDS. THE OTHERPOINTTO

C DRAW FROMIS (XCUR,YCUR)IN COMMON/ADAGE/.

C

IMPLICITNONE

C

COMMON/ADVUPR/IXMINS,IXMAXS,IYMINS, IYMAXS,

• IXVSIZ,IYVSIZ,IXVCNTR,IYVCNTR

INTEGER IXMINS,IXMAXS,IYMINS, IYMAXS,

. IXVSIZ,IYVSIZ,IXVCNTR,IYVCNTR

C

INTEGER*2IXS,IYS,IX, IY

INTEGER*4IDASH

C

C PERFORMWINDOWING& VIEWPORTING:

C IX = (IXS* IXVSIZ/ 512.0)+ IXVCNTR

C IY = (IYS* IYVSIZ/ 512.0)+ IYVCNTR

C

CALLCLIP2D(IXS,IYS,O, 511,O, 511, IDASH )

RETURN

END

- 74 -
SUBROUTINEADLINE(Xl,YI, IDASH )

C

C ROUTINETO DRAWA LINEON THE ADAGE3000IN SCREENCOORDINATES

C THIS ROUTINEUSESSINGLEPIXELWRITES& A BRESSENHAM-LIKEALGORITHM

C

IMPLICITNONE

C

COMMON/ADAGE/CURCOLR,ICURX,ICURY

INTEGER*4 CURCOLR

INTEGER*2 ICURX,ICURY

C

INTEGER*2Xl, Y1

INTEGER*2DELX,DELY,XCHNG,YCHNG,I,XA,YA,XB,YB,ISTOP

REAL*4REM,SLOPE

C

C IDASH= 0 --->DO NOT DRAWDASHEDLINES

C 1 --->DRAWDASHEDLINES(4 PIX ON; 4 OFF)

INTEGER*4IDASH

C

INTEGER*2IABS,TEST,MOD

LOGICAL*4DRAW

REAL FLOAT

C

DRAW= .TRUE.

XA=ICURX

YA=ICURY

XB=X1

YB=Y1

C

DELX= XB - XA

DELY= YB - YA

REM = 0.5

C

XCHNG= 1

IF (DELX.LT.O) XCHNG= -I

YCHNG= 1

IF (DELY.LT.O) YCHNG= -I

C

IF (IABS(DELX).GT.IABS(DELY)) THEN

IF (DELX.EQ.O) THEN

SLOPE= 100000.0

ELSE

SLOPE= (FLOAT(IABS(DELY))) / (FLOAT(IABS(DELX)))

END IF

ISTOP= IABS(DELX)

C

C IF DASHED LINE SET WHETHER TO DRAW LINE OR BLANK:

IF (IDASH.EQ.I) THEN

TEST= MOD(XA,8)

IF (TEST.GE.0 .AND. TEST .LE.3) THEN

DRAW= .TRUE.

ELSE

DRAW= .FALSE.

- 75 -
END IF

END IF

IF(DRAW) CALL IKPWR(O,XA, 511-YA,I, CURCOLR)

C

DO 20 I = 1, ISTOP

REM = REM + SLOPE

IF (REM.GE.1.0)THEN

YA = YA + YCHNG

REM = REM- 1.0

ENDIF

XA = XA + XCHNG

C

C IF DASHEDLINESETWHETHERTO DRAWLINEOR BLANK:

IF (IDASH.EQ.1) THEN

TEST= MOD(XA,8)

IF (TEST.GE.0 .AND. TEST .LE.3) THEN

DRAW= .TRUE.

ELSE

DRAW = .FALSE.

END IF

END IF

IF (DRAW) CALL IKPWR(O,XA, 511-YA,1, CURCOLR)

20 CONTINUE

ELSE

IF (DELY.EQ.O) THEN

SLOPE= 100000.0

ELSE

SLOPE= (FLOAT(IABS(DELX))) / (FLOAT(IABS(DELY)))

END IF

ISTOP= IABS(DELY)

C

C IF DASHEDLINESET WHETHERTO DRAW LINEOF BLANK:

IF (IDASH.EQ.1) THEN

TEST= MOD(YA,8)

IF (TEST.GE.0 .AND. TEST .LE.3) THEN

DRAW = .TRUE.

ELSE

DRAW = .FALSE.

END IF

END IF

IF (DRAW) CALL IKPWR(O,XA, 511-YA°I° CURCOLR)

C

DO 50 I = 1, ISTOP

REM = REM+ SLOPE

IF (REM.GT.1.0)THEN

XA = XA + XCHNG

REM = REM - 1.0

ENDIF

YA = YA + YCHNG

C

C IF DASHEDLINESET WHETHERTO DRAW LINEOF BLANK:

IF (IDASH.EQ.I) THEN

TEST= MOD(YA,8)

IF (TEST.GE.0 .AND. TEST .LE.3) THEN

- 76 -
DRAW= .TRUE.

ELSE

DRAW= .FALSE.

END IF

END IF

IF (DRAW) CALL IKPWR(O,XA, 511-YA,I, CURCOLR)

50 CONTINUE

ENDIF

C

C SET DRAWTO POINTAS THE CURRENTPOINT:

ICURX= Xl

ICURY= Y1

RETURN

END

- 77 -
SUBROUTINEADMOVA(XW,YW )

C

C MOVEUSING FLOATINGWORLDCOORDS.

C

IMPLICIT NONE

C

COMMON/ADAGE/ CURCOLR,ICURX, ICURY

INTEGER*4 CURCOLR

INTEGER*2 ICURX, ICURY

C

COMMON/ADVUPR/ IXMINS, IXMAXS, IYMINS, IYMAXS,

• IXVSIZ, IYVSlZ, IXVCNTR, IYVCNTR

INTEGER IXMINS, IXMAXS, IYMINS, IYMAXS,

• IXVSlZ, IYVSIZ, IXVCNTR° IYVCNTR

COMMON/ADWIND/ XMINW, XMAXW, YMINW, YMAXW,

• XWSIZE, YWSlZE, XWCNTR, YWCNTR

REAL XMINW, XMAXW, YMINW, YMAXW,

• XWSlZE, YWSIZE, XWCNTR, YWCNTR

C

INTEGER*2 IX, IY

REAL XW, YW

C

C PERFORMWINDOWING& VlEWPORTING:

IX : (((XW-XWCNTR)/ XWSIZE)+ 0.5 ) * IXVSIZ + IXMINS

IY : (((YW-YWCNTR)/ YWSlZE) + 0.5 ) * IYVSIZ + IYMINS

C

C SET THE PASSEDIN POINTAS THE CURRENTPOINT:

ICURX: IX

ICURY= IY

RETURN

END

- 78 - •
SUBROUTINEADMOVS(IXS,IYS )

C

C MOVE USINGINTEGERSEREENCOORDS.

C

IMPLICITNONE

C

COMMON/ADAGE/CURCOLR,ICURX,ICURY

INTEGER*4 CURCOLR

INTEGER*2 ICURX,ICURY

C

COMMON/ADVUPR/IXMINS,IXMAXS,IYMINS, IYMAXS,

. IXVSIZ,IYVSIZ,IXVCNTR,IYVCNTR

INTEGER IXMINS,IXMAXS,IYMINS, IYMAXS,

• IXVSIZ,IYVSIZ,IXVCNTR,IYVCNTR

C

INTEGER*2IXS, IYS,IX, IY

C

C PERFORMWINDOWING& VIEWPORTING:

C IX = (IXS* IXVSIZ/ 512.0)+ IXVCNTR

C IY = (IYS* IYVSIZ/ 512.0)+ IYVCNTR

C

ICURX= IXS

ICURY= IYS

RETURN

END

- 79 -
SUBROUTINEADVUPR(IXMIN, IXMAX, IYMIN, IYMAX )

C

C SAVEVIEWPORTSPECSIN COMMONIN SCREENCOORDINATES:

C

C

IMPLICIT NONE

C

COMMON/ADVUPR/ IXMINS, IXMAXS, IYMINS, IYMAXS,

• IXVSIZ, IYVSIZ, IXVCNTR, IYVCNTR

INTEGER IXMINS, IXMAXS, IYMINS, IYMAXS,

• IXVSlZ, IYVSlZ, IXVCNTR, IYVCNTR

C

INTEGER IXMIN, IXMAX, IYMIN, IYMAX

C

IXMINS = IXMIN

IXMAXS= IXMAX

IYMINS : IYMIN

IYMAXS: IYMAX

IXVSlZ = IXMAX- IXMIN

IYVSlZ : IYMAX- IYMIN

IXVCNTR: (IXMAX + IXMIN) / 2

IYVCNTR: (IYMAX + IYMIN) / 2

RETURN

END

- 80.-
SUBROUTINEADWIND(XMIN,XMAX,YMIN,YMAX )

C

C SAVEWINDOWSPECSIN COMMONIN WORLDCOORDINATES:

C

COMMON/ADWIND/XMINW, XMAXW, YMINW, YMAXW°

. XWSIZE,YWSIZE,XWCNTR, YWCNTR

REAL XMINW, XMAXW, YMINW, YMAXW,

• XWSIZE,YWSIZE,XWCNTR, YWCNTR

C

REAL XMIN,XMAX,YMIN,YMAX

C

XMINW= XMIN

XMAXW= XMAX

YMINW= YMIN

YMAXW= YMAX

XWSIZE= XMAXW- XMINW

YWSIZE= YMAXW- YMINW

XWCNTR= (XMINW+ XMAXW)/ 2.0

YWCNTR= (YMINW+ YMAXW)/ 2.0

RETURN

END

- 81 -
SUBROUTINECLIP2D(P2X, P2Y, XMIN, XMAX,YMiN, YMAX, IDASH )

C

C SUTHERLAND-COHEN2D LINE CLIPPER (AFTERROGERS1985)

C

IMPLICIT NONE

C

COMMON/ADAGE/ CURCOLRICURX, , ICURY

INTEGER*4 CURCOLR

INTEGER*2 ICURX, ICURY

C

COMMON/CLIP ALIGN/ CLIPPING BOX(4)

INTEGER*2CLIPPINGm BOX

C

INTEGER*4

• IDASH ! DASHEDLINE FLAG (I=DASHED, O:SOLID)

C

INTEGER*2

• DELTA_X, ! P2X - PIX

• DELTA_Y, ! P2Y - PIY

• I, ! DOLOOPINDEX I-4

• INTERSECT,! RESULTOF ANDINGP1 & P2 CLIP CODES

• INTERSECTX, X-VALUEOF INTERSECTIONWITH BOTORTOPCLIPPING BOX

• INTERSECTY, Y-VALUEOF INTERSECTIONWITH L ORR CLIPPING BOX

• NO /0/, LINE NOTVISIBLE

• PICODES(4), PI'S CLIPPING CODES

• P2CODES(4), P2'S CLIPPING CODES

• PIX, X & Y COORDINATESOF BEGINNINGOF LINE

• PIY,

• P2X, X & Y COORDINATESOF ENDOF LINE

• P2Y,

• PARTIAL /-I/, PARTIALLYVISIBLE LINE

• SUMI, . SUMOF PI'S CLIP CODES

. SUM2, . SUMOF P2'S CLIP CODES

• TEMP, . ALLOWSSWAPPINGOF CLIPPING CODES

• TEMPX, . ALLOWSSWAPPINGOF PI & P2

• TEMPY, . ALLOWSSWAPPINGOF PI & P2

• VISIBLE, LINE VlSlBILITY (YES, NO, OR, PARTIAL)

• XMIN, LEFT EDGEOF CLIPPINGWINDOW

• XMAX, . RIGHT EDGEOF CLIPPINGWINDOW

• YMIN, . BOTTOMEDGEOF CLIPPINGWINDOW

• YMAX, . TOP EDGEOF CLIPPINGWINDOW

• YES /I/ LINE COMPLETELYVISIBLE

C

LOGICAL*4

• HORIZONTAL, ! •TRUE• IF HORIZONTALLINE

• VERTICAL ! •TRUE• IF VERTICALLINE

C

REAL*4

• SLOPE ! DELTAX / DELTAY

C

- 82 -
C

C INIT:

C

C GET P1 FROMCOMMON/ADAGE/

PIX : ICURX

PlY = ICURY

C

C DETECTVERTICALLINECASE:

VERTICAL= .FALSE.

DELTAX = P2X - PIX

IF (DELTA_X.EQ.O) THEN

VERTICAL= .TRUE.

ELSE

SLOPE= (PZY- PIY)/ FLOAT(DELTA_X)

END IF

C

C DETECTHORIZONTALLINECASE:

HORIZONTAL= .FALSE.

DELTAY = P2Y - PlY

IF (DELTA_Y.EQ.O) HORIZONTAL= .TRUE.

C

C LOADARRAYWITH CLIPPINGWIMDOWSPECIFICATIONS:

CLIPPINGBOX(I)= XMIN

CLIPPING-BOX(2)= XMAX

CLIPPING-BOX(3)= YMIN

CLIPPING_BOX(4)= YMAX

- 83 -
C

c

c MAIN:

C

C FOR EACHCLIPBOX EDGE,CALCINTERSECTIONSWITH LINE:

CALL ENDPTCODE(PlX,PlY,CLIPPING_BOX,PICODES,SUM1 )

CALLENDPT_CODE(PZX,PZY,CLIPPING_BOX,PZCODES,SUM2 )

C

C DO WHILEONE OR MORELINEENDPOINTSOUTSIDEWINDOW:

DO WHILE (SUM1.NE.0 .OR. SUM2 .NE.O)

C

C TRIVIALLYREJECTLINESWITHBOTH POINTSON

C THE SAMESIDEOF A CLIPPINGBOX SIDE:

CALL LOGICINTERSECT(PICODES,P2CODES, INTERSECT)

IF (INTERSECT.NE.O) RETURN

C

C INSUREP1 IS OUTSIDETHE CLIPPINGBOX:

IF (SUMI.EQ.O) THEN

C

C SWAP END POINTS& CLIPCODES:

TEMPX= PIX

TEMPY= PlY

PIX = PZX

PlY = P2Y

P2X = TEMPX

PZY = TEMPY

C

DO 33 I = 1, 4

TEMP= PICODES(1)

PICODES(I)= PZCODES(I)

PZCODES(1)= TEMP

33 CONTINUE

END IF

C .-

C TEST P1 AGAINSTTHE 4 CLIPPINGBOX EDGES:

IF (PlCODES(1).NE.0 .AND..NOT.VERTICAL)THEN

C

C P1 TO LEFTOF WINDOW& LINENOT VERTICAL

PlY = SLOPE* (CLIPPING_BOX(I)- PIX)+ PlY

PIX = CLIPPINGBOX(l)

ELSE IF (PICODES(2).NE.0 .AND..NOT.VERTICAL)THEN

C

C PI TO RIGHTOF WINDOW& LINENOT VERTICAL

PIY = SLOPE* (CLIPPING_BOX(2)- PIX)+ PIY

PIX = CLIPPINGBOX(Z)

ELSEIF(PICODES(3)-.NE. 0AND..NOT.HORIZONTAL)THEN

C

C PI BELOWWINDOW& LINENOT HORIZONTAL

IF (VERTICAL)THEN

PIY = CLIPPINGBOX(3)

ELSE

PIX = (I/SLOPE)*(CLIPPING_BOX(3)-PIY)+PIX

PlY = CLIPPINGBOX(3)

- 84 -
ENDIF

ELSEIF(PICODES(4) .HE. 0 .AND. .NOT. HORIZONTAL)THEN

C

C PI ABOVEWINDOW& LINE NOT HORIZONTAL

IF (VERTICAL) THEN

PIY : CLIPPING_BOX(4) ELSE

PIX = (I/SLOPE)*(CLIPPING_BOX(4)-PIY)+PIX

PIY : CLIPPING_BOX(4)

ENDIF

ENDIF

CALL ENDPTCODE(PIX, PIY, CLIPPING_BOX,PICODES,SUMI )

CALL ENDPT_-CODE(P2X, P2Y, CLIPPING_BOX,P2CODES,SUM2)

ENDDO

C

C DRAWLINE•

CALL ADMOVS(PIX,PIY )

CALL ADLINE(P2X, P2Y, IDASH )

RETURN

END

- 85 -
SUBROUTINEENDPT_CODE(PX,PY, CLIPPING_BOX, PCODES,SUM)

C

C ASSIGNSEND POINTCODESFORA SINGLEPOINT:

C

IMPLICITNONE

C

INTEGER*2

• CLIPPING_BOX(4),! LEFT,RIGHT,BOTTOM& TOP OF CLIPPINGWINDOW

• I, ! DO LOOP INDEX1-4

• PCODES(4), ! 1-4ARE LEFT,RIGHT,BOTTOM& TOP ENDPOINT

• ! CLIPCODES(0 OR I):

• ! PCODES(1)= I IF POINTIS LEFTOF WINDOW

• ! " (2)= 1 IF POINTIS RIGHTOF WINDOW

• ! " (3)= 1 IF POINTIS BELOWWINDOW

• ! " (4)= I IF POINTIS ABOVEWINDOW

• { PCODES(N)= O OTHERWISE

. PX, ! X COMPONENTOF POINTP

• PY, ! Y COMPONENTOF POINTP

• SUM ! SUM OF CLIPPINGCODES

C

C____________

C

C MAIN:

C

C CALCULATETHE FOURENDPOINTCODESFORTHE POINTP:

IF (PX .LT.CLIPPING_BOX(I)) THEN

PCODES(1)= I

ELSE

PCODES(1)= 0

END IF

C

IF (PX .GT.CLIPPING_BOX(2)) THEN

PCODES(2)= I

ELSE

•" PCODES(2)= 0

END IF

C

IF (PY .LT.CLIPPING_BOX(3)) THEN

PCODES(3)= I

ELSE

PCODES(3)= O

END IF

C

IF (PY .GT.CLIPPINGBOX(4)) THEN

PCODES(4)= 1

ELSE

PCODES(4)= 0

END IF

C

C FORMSUM OF CODES:

SUM = 0

DO 100 I = 1, 4

100 SUM = SUM + PCODES(I)

RETURN

- 86 -
END

- 87 -
SUBROUTINELOGIC_INTERSECT(PICODES, P2CODES, INTERSECT)

C

C LOGICALLYANDS THE CLIPPINGCODESOF P1 & P2

C

IMPLICITNONE

C

INTEGER*2

• I, ! DO LOOP INDEX1-4

• INTERSECT, ! SUM OF BITSFOR LOGICALINTERSECTION

• ! O=NOCOMMONAREAS

• ! O#BOTHENDSOF LINE IN THE

• ! SAMEAREA

• PICODES(4), ! PI'SEND POINTCODES

• P2CODES(4) ! P2'SEND POINTCODES

C

C____________

C

c MAIN:

C

INTERSECT= 0

DO 100 I = 1, 4

I00 INTERSECT= INTERSECT+ (PICODES(1)+ P2CODES(I)) / 2

RETURN

END

- 88 -
C FILENAME: [CSE.TLT.SMP]CMAPLD.FOR

C PROGRAMMER: HAROLDLANE,JR.; STEVEHUFFMAN

C

C VERSION: 1.1 REMOVEDPROMPTFORFILENAME.ALWAYS

C LOADSSMP.CMP.

C

C EXTERNALCALLS(FILENAME):

C IKBWR(DMAXXX),IKBWT(DMAXXX),JOIN32(ALUXXX)

C

C FUNCTION: LOADSIKONASCOLORMAP FROMDISKFILE.

C THE COLORMAP DATAIS PRECEDEDBY A RECORDCONTAINING

C THE NUMMBEROF COLORSTO BE LOADED.

C THE FORMATOF THE FILEIS 3110FOR BLUE,GREEN,& RED.

C IN THATORDER.

C

C___________

SUBROUTINECMAPLD

C___________

c

C

COMMON/SYSIO/ TTYIN,TTYOUT,HELPIN,PIXFIL

INTEGER*2 TTYIN,TTYOUT,HELPIN,PIXFIL

C

INTEGERIMAP ( 3 ), STRTAD

C LUVO(4)

INTEGER* 4 CLRMAP( 1024), CMPADR

BYTE FNAME( 40 ), DFLTFN(20 )

DATA FNAME( 40 ) / 0 /

C DATA LUVO/ O, 4096,8192,12288/

DATADFLTFN/'S' 'M° 'P' '$' 'S' 'C' 'R'

• _A' 'T' 'C' 'H' '.'

• 'S' 'M' 'P' ' ' 'C' 'M' 'P' O/

C

- 89 -
C MAIN PROG:

C___________

c

C_

TTYOUT= 1

C PROMPTFORAND READFILENAMEOF COLORMAP TO LOAD:

C100 WRITE ( TTYOUT,105)

C105 FORMAT('ENTERCOLORMAP FILENAME:',/

C * ' (RETURNFOR DEFAULT:GREY.CMP)')

C READ(TTYIN,IOOO,END=g999,ERR=IOO)NAMLEN,(FNAME(1),I=1,NAMLEN)

CIO00FORMAT( Q, 40AI )

C FNAME(NAMLEN+ 1) = 0

NAMLEN= 0

C

C****** DEFAULTCOLORMAP:

IF (.NOT.(NAMLEN.EQ.0)) GO TO 1080

DO 1050I=1,19

FNAME(1)= DFLTFN(1)

1050 CONTINUE

NAMLEN= 19

1080 CONTINUE

FNAME(NAMLEN+ 1) = 0

C

C_

C WRITE (TTYOUT,* ) 'ENTERLUVONUMBER(0-3):'

C READ (TTYIN,1100) NLUVO

C

C******OPEN,READ,& LOADCOLORMAP FILE:

OPEN ( UNIT=PIXFIL,NAME=FNAME,TYPE='OLD',IOSTAT=IOST,

$ FORM= 'FORMATTED',READONLY,ERR=30000)

C

C READSTARTINGLOCATIONWITHINCOLORMAP:

READ(PIXFIL25)STRTAD ,

25 FORMAT(IIO)

C

C READ BLUE,GREEN,RED COLORDEFNSUNTILEOF:

I = 1

2000 CONTINUE

READ (PIXFIL,1100,END=20000) ( IMAP ( J ), J = I, 3 )

II00 FORMAT( 3110)

CLRMAP( I ) = 0

C

C MERGER, G, B VALUESTO REQDIKONASFORMAT:

DO 20002 J = I, 3

CLRMAP(I)= ISHFT(CLRMAP(1),8)+IMAP(J)

CLRMAP(I)=ISHFT(CLRMAP(1),2)

20002 CONTINUE

I = I + 1

GO TO 2000

20000 CONTINUE

CLOSE ( UNIT = PIXFIL)

N = I - 1

C

- gO -
CALLJOIN32( CMPAOR,131,STRTAD)

C CALLJOIN32( CMPADR,131,LUVO(NLUVO+ 1) )

CALL IKBWR( 16, CMPADR,N, CLRMAP)

CALL IKBWT

RETURN

C

C FILEOPEN FAILURE:

30000 CONTINUE

WRITE(TTYOUT,*)'(CMAPLD)UNABLETO OPENREQUESTEDFILE.',

* ' FORTRANI/O STATUS= ', IOST

RETURN

C

C END OF FILEON FILENAMEREAD; RETURN:

9999 CONTINUE

RETURN

END

- 91 -
C FILENAME: [SMP]CURSLD.FOR

C PROGRAMMER:HAROLDLANE, JR.

C

C EXTERNALCALLS (FILENAME):

C IKBWT(DMAXXX),IKBWR(DMAXXX),JOIN32(ALUXXX)

C

C FUNCTION: THIS ROUTINEREADSAN ASCII FORMATTEDFILE OF A

C CURSORDEFINITION OF 32 COLS& 32 ROWS& LOADS

C IT INTO THE CURSORDEFINITION REGITERS.THE

C ROUTINEINTERPRETSASTERISKS*S AS BINARYONES

C ANDANYOTHERCHARACTERAS BINARYZEROS. THE

C ROUTINEPROVIDESTHE BIT MANIPULATION,PACKING,

C ADDRESSING,& WRITINGTO AN RDS-3000 FRAME

C BUFFERCONTROLLER#0 TO EFFECTA LOADINGOF A

C PREDEFINEDCURSOR.

C

C___________

SUBROUTINECURSLD

C___________

C

C

COMMON/SYSlO/ TTYIN, TTYOUT,HELPIN, PIXFIL

INTEGER*2 TTYIN, TTYOUT,HELPIN, PIXFIL

C

BYTE FNAME( 40 ), DFLTFN( 26 )

BYTECRSCHR(32,32), CRSBIT(32,32)

INTEGER*2ROW,COL, WDMODE,CURSOR(2,256), CURS(256)

INTEGER*2CRSADR(2)

DATA DFLTFN/'S' 'M' 'P' '$' 'S' 'C' 'R'

* 'A' 'T' 'C' 'H' '" 'T' 'R' 'A' 'C' 'K'

, , , , ", , , , , ,

* 'C' 'R' '0' 'S' ' ' 'C' 'R' 'S' O/ , , , , ", , , ,

C

- 92 -
C. MAIN PROG:

C___________

C

C

C WORDWRITEBUS FUNCTIONCODE:

WDMODE: 0

C

C CURSORADDRESSIN FRAMEBUFFERCONTROLLER:

CALL JOIN32(CRSADR, 192, 256)

C

C_

C PROMPTFORANDREADFILE NAMEOF CURSORDEFNTO LOAD:

C55CC WRITE ( TTYOUT,60)

C60CC FORMAT(' ENTERCURSORFILE NAME:' /

CCCCC* ' (RETURNFORDEFAULT:RTI.CRS)' )

CCCCC READ(TTYIN,IOOO,END:9999,ERR=55)NAMLEN,(FNAME(1),I=I,NAMLEN)

ClO00 FORMAT( Q, 40Al )

CCCCC FNAME(NAMLEN+ I) = 0

C

C****** DEFAULTCURSOR:

CCCCC IF (.NOT.(NAMLEN.EQ. 0)) GOTO 1080

DO 1050 I:1,25

FNAME(1)= DFLTFN(1)

1050 CONTINUE

NAMLEN = 25

C1080C CONTINUE

FNAME( NAMLEN + 1) = 0

C

C_

C

C****** OPEN, READ, & LOAD CURSOR FILE:

OPEN( UNIT=19,NAME=FNAME,TYPE='OLD',IOSTAT=IOST,

$ FORM = 'FORMATTED',ERR=2000,READONLY )

DO 100 COL = 1, 32

READ(I9, 105) (CRSCHR(COL,ROW), ROW:I, 32)

105 FORMAT(32(32AI))

I00 CONTINUE

CLOSE(UNIT=I9)

D TYPE*, '(CURSLD) ASCII CURSORFILE READIN.'

C

C CONVERTCHARACTERSTO I ORO:

DO200 COL= I, 32

DO 150 ROW: I, 32

CRSBIT(COL,ROW) : 0

IF(CRSCHR(COL,ROW).EQ.'*')CRSBIT(COL,ROW)=I

150 CONTINUE

200 CONTINUE

C

C PACK THE 32 X 32 BITS 4 PER NIBBLE IN 256 WORDS AS

C REQUIRED BY THE HARDWARE. N. B. THE BITS HAVE TO

C BE PACKED IN 'BACKWARDS':

N = 1

DO 300 COL = 1, 32

- 93 -
DO 250 ROW = 1, 29, 4

CURS(N)=8* CRSBIT(COL,ROW+3) +

• 4 * CRSBIT(COL,ROW+2) +

• 2 * CRSBIT(COL,ROW+l) +

• 1 * CRSBIT(COL,ROW )

CALL JOIN32(CURSOR(1,N),O, CURS(N) )

N=N+I

250 CONTINUE

300 CONTINUE

C

C SEND CURSOR TO IKONAS:

D WRITE(I,305)WDMODE, CRSADR, (CURSOR(I,I),I=1,256)

D305 FORMAT(' (CURSLD)CURSOR WDMODE, CRSADR, DATA:',

D * / I6, 2014 // 32(1X, 803 /) / )

CALL IKBWR(WDMODE,CRSADR, 256, CURSOR)

CALL IKBWT

RETURN

C

C FILE OPEN FAILURE:

2000 CONTINUE

TYPE * '(CURSLD)UNABLE TO OPEN REQUESTEDFILE.'

• ' FORTRAN I/O STATUS = 'w IOST

RETURN

C

C EOF ON READ TO TERMINAL:

9999 CONTINUE

RETURN

END

- 94 -
c FILENAME: [CSE.HHL.NTEC]FBC.FOR

C PROGRAMMER: HAROLDLANE,JR.

C VERSION: 1.0

C

C EXTERNALCALLS (FILENAME):

C IKADDR,IKBWR(DMAXXX),JOIN32(ALUXXX),IKBWT(DMAXXX)

C

C FUNCTION: FBC IS A GENERALPURPOSEROUTINETO MANAGE

C THE FRAMEBUFFERCONTROLLER.IT ALLOWSONE TO SET

C THE FBC TO CERTAINDEFAULTCONDITIONS.IT ALLOWS

C INDIVIDUALFIELDSIN THE REGISTERSTO BE SET TO

C NEW VALUESWITHOUTDISTURBINGVALUESOF OTHER

C FIELDSIN THE SAMEREGISTER.ONE CAN ALSO READ

C BACKTHE VALUEOF INDIVIDUALFIELDSIN REGISTERS.

C THISROUTINEIS DERIVEDFROMA FRAMEBUFFER

C WRITEROUTINEDEVELOPEDBY HENRYRICHOF IKONAS.

C THISVERSIONIS SUBSTANTIALLYMODIFIEDIN THAT IT HAS NO

C I/O TO THE TERMINAL,THAT IT IS A SUBROUTINE(NOT

C A MAIN PROGRAM),AND THAT IT CAN HAVEFIELDSFROM

C REGISTERSREADBACKFROM IT.ERRORCHECKINGHAS

C BEEN IMPROVEDAND THE TYPEOF THE PARTICULAR

C ERRORIS PASSEDBACKTO THE CALLINGROUTINE.

C

C___________

SUBROUTINEFBC(IMODE,IFBNO,IWRITE,IINVBL,JINVAL,IERR)

C___________

C

C FBC CALLINGPARAMETERUSAGE:

C

C IMODE: O: SET A FIELDIN A REG

C 1: SET FBCTO 512 X 512 30 HZ

C 2: SET FBCTO 512 X 512 60 HZ

C 3: SET FBCTO 1024X 102430 HZ

C 4: FAKEREADINGBACKA FIELDVALUEFROMFBC

C IFBNO: O: FBC#0

C 1: FBC #1 (SUPPORTFORMULTIPLEFBC'S)

C IWRITE:O: INHIBITWRITINGREGISTERVALUESTO DISPLAY

C 1: WRITEREGISTERVALUESTO DISPLAY

C IINVBL: # OF LOGICALVARIABLE(FIELD)TO BE SET (1-23)

C JINVAL: VALUETO SET LOGICALVARIABLETO; OR VALUE

C RETURNEDWHEN IN READBACKMODE(IMODE=4)

C IERR: O: NO ERROR

C 1: BAD IFBNO(0-1ALLOWED)

C 2: BAD IMODE# (0-4ALLOWED)

C 3: BAD IWRITE# (0-1ALLOWED)

C 4: VALUETO SET REGTO OUT OF RANGE

C 5: ATTEMPTTO READAN UNINITIALIZEDVARIABLE

C 6: ATTEMPTTO SENDAN UNINITIALIZEDVARIABLE

C

C USAGEOF ARRAYS:

C IVALUE- THE LOGICALSETTINGSFORTHE FBHC

C IREGS- THE PHYSICALFBHCREGISTERS,WHICHCONSISTOF

C LOGICALVARIABLESOR-EDTOGETHER

- 95 -
C IMAX- THE MAX.VALUEFORA VARIABLE

C IMIN- THE MIN.VALUEFORA VARIABLE

C IVBL- FOR EACHLOGICALVARIABLE,THE NUMBEROF THE

C PHYSICALVARIABLEIN WHICHIT IS TO BE PUT

C ISHIFT- FOR EACHLOGICALVARIABLE,THE SHIFTFACTORBY

C WHICHIT IS TO BE MULTIPLIEDBEFOREBEINGPUT INTO ITS

C PHYSICALVARIABLE

C IDEFAL- DEFAULTSETTINGFOR LOGICALVARIABLES,DEPENDINGON

C USER'SCONFIGURATION

C

C IREG32- 32-BITFBHCREGISTERS

C

C MEANINGSOF LOGICALVARIABLES(REGISTERFIELDS):

C 1,2 X-, Y- VIEWPORTS,RESPECTIVELY

C 3,4 X-, Y- SIZES,RESP

C 5,6 X-, Y- WINDOWS,RESP

C 7,8 X-, Y- ZOOMS,RESP

C 9 HORIZONTALTIME

C 10 # OF LINES/FRAME

C 11 CURSORON

C 12 1024MODE

C 13 AUTOCLEAR

C 14 EXTERNALSYNC

C 15 COLORMAP PAGE

C 16 RS-343

C 17 REPEATFIELD

C 18 PIXELCLOCK

C 19,20 X-, Y- CURSORLOCATIONS,RESP

C 21 EXTERNALPIXELCLOCK

C 22 PRG SYN

C 23 DRV BPCK

C

- 96 -
C TYPEDECLARATIONS& INITIALIZATIONS:

C___________

c

C UNITS.COMMON

COMMON/UNITS/IOUT,IN,IU,IUEX

C

INTEGER*4IREG32(8),IKADDR,IKCURA

DIMENSIONIVALUE(Z3,2),IDEFAL(Z3,3),IREGS(16),IMAX(23),IMIN(23)

DIMENSIONIVBL(23),ISCALE(23)

INTEGER*2UNINIT

C

C # OF LOGICAL& PHYSICALVARIABLES:

DATANVALUE/23/,NREGS/16/

C

C INITIALIZATIONFOR FBCDEFAULTSETTINGS& MIN,MAX, & SHIFTS:

DATA IDEFAL/O,32,511,511,4095,4067,0,O,300,560,O,O,O,O,O,O,O,45,

* 0,32,0,0,1,

* 0,72,511,1023,0,4061,0,0,144,1167,0,0,0,0,0,1,1,19,0,32,0,0,1,

* 0,64,1023,1023,0,4033,0,0,144,1166,0,1,0,0,0,1,0,20,0,64,0,0,1/

DATA IMAX/1023,1023,1023,1023,4095,4095,255,255,

* 4095,4095,1,1,1,1,3,1,1,63,1023,1023,1,1,1/

DATAIMIN/O,O,O,O,O,O,O,O,IO0,1,0,O,O,O,O,O,O,O,O,O,O,O,O/

DATA IVBL/1,2,3,4,5,6,7,8,9,10,11,11,11,11,11,11,11,

* 12,13,14,12,12,12/

DATA ISCALE/1,1,1,1,1,1,1,1,1,1,4,8,32,64,128,512,1024,

* 1,1,1,64,128,256/

DATA IVALUE/46*-1/

DATA IFBALO/O/

C

- 97 -
C MAIN PROG:

C___________

c

c SAVE RUN RESETSTATUSOF PROCESSOR& FORCEDMA AUTO-INCREMENT:

C CALL IKBGEI(ICWT)

C ICWT=IOR(IAND(ICWT,1536),320)

C CALL IKBSEI(ICWT)

C

C SET DEFAULTRETURNCODE:

, IERR= 0

IINVAL= JINVAL

D WRITE(IOUT,20) IMODE,IFBNO,IWRITE,IINVBL,JINVAL

D20 FORMAT('(FBC)IMODE,IFBNO,IWRITE,IINVBL,JINVAL:'/ 515)

C

C CHECKTO MAKESURETHEREIS A VALIDFRAMEBUFFERNUMBER:

IF(.NOT.(IFBNO.LT.0 .OR.IFBNO.GT.1))GOT040

IERR= 1

RETURN

40 CONTINUE

C

C CHECKFORVALIDMODE #:

IF (.NOT.(IMODE.LT.0 .OR.IMODE.GT.4))GOTO50

IERR= 2

RETURN

50 CONTINUE

C

C CHECKFORVALIDIWRITEVALUE:

IF (.NOT.(IWRITE.LT.0 .OR.IWRITE.GT.I))GO TO 55

IERR= 3

RETURN

55 CONTINUE

C

C SET IFBCNOFORARRAYUSE,ALSOSET FBCHI ADDR

IFBAHI=192+IFBNO*8

IFBCNO=IFBNO+I

CALLJOIN32(IKADDR,IFBAHI,IFBALO)

C

C SEE IF A FIELDIN A REGISTERIS BEINGSET:

IF (.NOT.(IMODE.EQ.0)) GO TO 60

C

C CHECKFOR VALIDVBL #

IF (.NOT.(IINVBL.GT.NVALUE.OR.IINVBL.LT.1))GOTO54

IERR= 3

RETURN

54 CONTINUE

C

C VBL # IS VALID. BUT IS THE VALUE?

IF (.NOT.(IINVAL .LT. IMIN(IINVBL) .OR.

* IINVAL .GT. IMAX(IINVBL)))GOTO58

C

C THE VALUEWAS OUT OF RANGE;RETURNWITH ERROR:

IERR= 4

RETURN

- 98 -
58 CONTINUE

C

C VALUEWAS VALIDI SET IT INTOARRAY:

IVALUE(IINVBL,IFBCNO) = IINVAL

C

C GO WRITEOUT REGISTERSTO FBC IF REQUESTEDTO DO SO:

GO TO 250

60 CONTINUE

C

C SEE IF A REGISTERFIELDIS BEINGREADBACK:

IF (.NOT.(IMODE.EQ.4)) GO TO 90

C

C ALLOWREGISTERFIELDTO BE READBACK:

IINVAL= IVALUE(IINVBL,IFBCNO)

IF (.NOT.(IINVAL.EQ.-1)) GO TO 80

C

C ATTEMPTTO READAN UNINITIALIZEDVARIABLE:

IERR= 5

RETURN

80 CONTINUE

JINVAL= IINVAL

RETURN

go CONTINUE

C

C IMODEIS 1, 2, OR 3. INITIALIZEDEFAULTSFOR

C THE LOGICALVARIABLES:

DO 100 I = 1,NVALUE

IVALUE(I,IFBCNO)= IDEFAL(I,IMODE)

100 CONTINUE

C

C SET FBCADDRESS

200 CONTINUE

C

C NOW COMPUTETHE PHYSICALVARIABLESFROM

C THE LOGICALVARIABLES.

C FIRST,CLEARALL PHYSICALVBLSTO O.

250 CONTINUE

DO 300 I = I,NREGS

IREGS(I)= 0

300 CONTINUE

C

C NOW, FOR EACHLOGICALVARIABLE,ADD IN THE VALUETO THE CORRECT

C PHYSICALVARIABLE

UNINIT= 0

DO 310 I = I,NVALUE

IF (IVALUE(I,IFBCNO).EQ.-1) UNINIT= I

IREGS(IVBL(1)) = IREGS(IVBL(1))+IVALUE(I,IFBCNO)*ISCALE(1)

310 CONTINUE

C

C CONVERTFROM 16-BITVALUESTO IKONAS32-BITVALUES

NREG32= NREGS/2

DO 320 I = 1,NREG32

CALLJOIN32(IREG32(I), IREGS(I*2),IREGS(I*2-1))

320 CONTINUE

- 99 -
c

D WRITE(IOUT,350)(I,IVALUE(I,IFBCNO),I=1,NVALUE),(I,IREGS(I),I=1,16)

D350 FORMAT('(FBC)IVALUES:'/ 23(/ ,IX,13,07) //

D * ' IREGS:'/ 16(/,IX,13,07) )

IF (,NOT.(IWRITE.EQ.I))GO TO 340

C

C SEE IF ANY UNINITIALIZEDDATA;IF SO DON'TSEND IT:

IF (.NOT.(UNINIT.EQ.I))GO TO 335

D WRITE(IOUT,330)

D330 FORMAT('O(FBC)ATTEMPTTO WRITEUNINITIALIZEDDATA'/

D * ' TO FRAMEBUFFERCONTROLLER.DATANOT SENT')

IERR= 6

RETURN

335 CONTINUE

C

C THE IKONASFBHCWORDSARE COMPUTED.SEND EM IF SO COMMANDED:

D WRITE(IOUT,337) IKADDR,NREG32,IREG32

D337 FORMAT('(FBC)AT IKBWR.IKADDR,NREG32,IREG32(1-8)',

D * 012, I12/ 8(IX,012 /) )

CALL IKBWR(0,IKADDR,NREG32,IREG32)

CALL IKBWT

340 CONTINUE

RETURN

END

- 100 -
SUBROUTINEGET_SLD_COLR(CURCOLR, CLRA,CLRB,CLRC)

C

C THIS IS THE SOLIDM VERSIONCOLORCONVERSIONROUTINE

C (SMPCOLORS0-7 CONVERTTO SOLID0 < CLRA,-B,-C< 255 AS

C APPROPRIATE)(CLRA=RED,CLRB=GREEN,CLRC=BLUE)

C

IMPLICITNONE

INTEGER*4CURCOLR

INTEGER*2CLRA,CLRB,CLRC

C

IF (CURCOLR.EQ.O) THEN ! BLACK

CLRA = 0

CLRB = 0

CLRC= 0

ELSE IF(CURCOLR.EQ.1) THEN ! RED

CLRA= 255

CLRB= 0

CLRC= 0

ELSEIF(CURCOLR.EQ.2) THEN ! GREEN

CLRA= 0

CLRB= 255

CLRC= 0

ELSEIF(CURCOLR.EQ.3) THEN ! YELLOW

CLRA= 255

CLRB= 255

CLRC= 0

ELSEIF(CURCOLR.EQ.4) THEN ! BLUE

CLRA= 0

CLRB= 0

CLRC= 255

ELSEIF(CURCOLR.EQ.5) THEN ! MAGENTA

CLRA= 255

CLRB= 0

CLRC= 255

ELSEIF(CURCOLR.EQ.6) THEN ! CYAN

CLRA= 0

CLRB= 255

CLRC= 255

ELSEIF(CURCOLR.EQ.7) THEN ! WHITE

CLRA= 255

CLRB= 255

CLRC= 255

ELSE ! DEFAULTIS WHITE

CLRA= 255

CLRB= 255

CLRC= 255

END IF

RETURN

END

- 101 -
C SUBROUTINESLDSMOOTH(NNN,, IF )

C

C SMOOTHSHADESONE PARTUSINGADAGE'SSOLID-3000PACKAGE.

C* ROUTINESENDSALL FACESAND NORMALSIN ONE PARTTO SOLID.

C THE PARTSARE PASSEDTO THISROUTINEIN COMMONHS.CMN

C

C NN = NPOINT(# OF VERTICES(NODES)IN THIS PART)

C N = NFACE (# OF FACESIN THIS PART)

C IF(5,MAXFPP)=IFACE (LISTOF FACES(3 OR 4 VERTEXPOLYGONS))

C

C NPF = # OF NODESPER FACEIN THIS FACE

C

INCLUDE'PARTS.PRM'

INCLUDE'DEVICE.CMN'

INCLUDE'HS.CMN'

C

INTEGER*2ON, OFF,NRMLST,DUMMY

INTEGER*2ICOMP,I2NPF,NORMS(4,5)

C

REAL*4 XT(4,5),NORM

INTEGER*2NNODES,NFACES,NODE,FACE_NO,NPF, INDEX,COUNT(MAXNPP)

INTEGER*4IF(5,MAXFPP)

REAL*4 NORMX(MAXFAC),NORMY(MAXFAC),NORMZ(MAXFAC)

REAL*4 SUMX(MAXNPP),SUMY(MAXNPP),SUMZ(MAXNPP)

REAL*4 NORMXCOMP, NORMYCOMP, NORMZCOMP

C

DATAON/I/,OFF/O/

- 102 -
----N--

c

C INITIALIZE FORNORMALCALCULATION:

NNODES= NN

NFACES: N

C

DO10 NODE: I, NNODES

COUNT(NODE) = 0

SUMX(NODE): 0.0

SUMY(NODE)= 0.0

SUMZ(NODE): 0.0

I0 CONTINUE

C

C FOREACHFACE,CALCULATEANDACCUMULATEITS NORMAL:

II : NF

DO-30 FACENO: I, NFACES

NPF : IF_I,FACE_NO)

C

C FORMTHISFACE'SNORMAL:

C

C 1ST,COPYTHE FACEPOINTERSINTOFACE(J,II)FOR PLANEQ

C IGNORINGPOINTOR LINEELEMENTS:

IF (NPF.GE.3) THEN

II = II+l

FACE(1,II)= NPF

C

DO 14 J=2,NPF+I

FACE(J,II)= IF(J,FACE_NO)+ NG

14 CONTINUE

C

C LET PLANEQCOMPUTETHE EQUATIONOF THE PLANE:

CALLPLANEQ(II,A,B,C,D)

C

C NORMALIZEEQNOF THE PLANEOF THISFACETO GET ITSNORMAL

C AND CONVERTIT TO A 16-BITSIGNEDFRACTIONFOR SOLID-3000:

NORM = SQRT(A*A+ B*B+ C*C ) / 32767.0

A = A / NORM

B = B / NORM

C = C / NORM

C

C THE NORMALSARE INVERTEDBECAUSESMP HAS A

C RIGHT-HANDEDCOORDINATESYSTEMAND

C SOLID-3000HASA LEFT-HANDEDCOORDINATESYSTEM:

NORMXCOMP= -A

NORMYCOMP= -B

NORMZCOMP= -C

C

C FOR EACHNODE (POINT)IN THISFACE:

C ADD THISFACE'SNORMALCOMPONENTSINTOTHE NORMACCUMULATOR:

DO 11J = 2, NPF + 1

NODE= IF(J,FACENO)

COUNT(NODE)= COURT(NODE)+ I

SUMX(NODE)= SUMX(NODE)+ NORMXCOMP

SUMY(NODE)= SUMY(NODE)+ NORMYCOMP

- 103-
SUMZ(NODE): SUMZ(NODE) + NORMZCOMP

II CONTINUE

ENDIF

30 CONTINUE

C

C CALCULATETHE AVERAGENORMALFOR EACHNODE (POINT;VERTEX):

DO 700 NODE= 1, NNODES

NODE CNT = COUNT(NODE)

NORMX(NODE+NG)= NINT(SUMX(NODE)/ NODECNT)

NORMY(NODE+NG)= NINT(SUMY(NODE)/ NODE-CNT)

NORMZ(NODE+NG)= NINT(SUMZ(NODE)/ NODEZCNT)

700 CONTINUE

C

C GIVEONE FACE'SNODES (POINTS)AND AVERAGENORMALSTO SOLID-3000

C ONE FACEAT A TIMEAS REQUIREDBY SOLID'SSPOLYROUTINE:

II = NF

DO 800 FACENO = 1, NFACES

NPF: IF_I, FACE_NO)

DO750 J = 2, NPF+ I

C

C COPYFACE'SPOINTSTO XT(4,5)SO SEND_2_SOLIDCAN GET THEM:

JM1 = J - 1

INDEX= IF(J,FACENO)+ NG

XT(I,JMI)= XG(INDEX)

XT(2,JMI)= YG(INDEX)

XT(3,JMI)= ZG(INDEX)

C

C PUT FACE'SNORMSINTONORMS(4,N)FORSEND 2 SOLID:

NORMS(I,JMI) = NORMX(INDEX) - -

NORMS(2,JMI) = NORMY(INDEX)

NORMS(3,JMI) = NORMZ(INDEX)

750 CONTINUE

C

C GIVE FACE'SPOINTS& NORMALSTO SOLID-3000:

I2NPF= NPF

CALLSEND_2_SOLID(I2NPF,XT, NORMS,IDASH )

800 CONTINUE ! CLOSEFACELOOP

C

C UPDATENODEAND FACECOUNTERS

NG = NG+NN

NF = II

C

RETURN

END

- 104 -
C FILENAME: SLDSUBS.FOR

C

SUBROUTINESODRWA('XW,YW, IDASH )

C

C DRAWA LINEUSINGFLOATINGWORLDCOORDS. THE OTHERPOINTTO

C DRAW FROM IS (XCUR,YCUR)IN COMMON/ADAGE/•

C

IMPLICITNONE

C

COMMON/ADAGE/CURCOLR,ICURX,ICURY

INTEGER*4 CURCOLR

INTEGER*2 ICURX,ICURY

C

COMMON/ADVUPR/IXMINS,IXMAXS,IYMINS, IYMAXS,

• IXVSIZ,IYVSIZ,IXVCNTR,IYVCNTR

INTEGER IXMINS,IXMAXS,IYMINS, IYMAXS,

• IXVSIZ,IYVSIZ,IXVCNTR,IYVCNTR

COMMON/ADWIND/XMINW, XMAXW, YMINW, YMAXW,

• XWSIZE,YWSIZE,XWCNTR, YWCNTR

REAL XMINW, XMAXW, YMINW, YMAXW,

• XWSIZE,YWSIZE,XWCNTR, YWCNTR

C

INTEGER*2IX, IY

INTEGER*4IDASH

REAL XW, YW

C

INTEGER*2SCOLOR,SPOLY ! CALLEDFUNCTIONSNAMES

INTEGER*2INTEN,COLOR,DUMMY_COLOR,DUMMY,ICOMP

INTEGER*2SET_LINE_COLOR/4/

C

INTEGER*2NO VERTICES,VERTEXLIST(4,2)

DATANO VERTICES/2/, VERTEX-LIST/8"0/

C

C

C PERFORMWINDOWING& VIEWPORTING:

IX = (((XW-XWCNTR)/ XWSIZE)+ 0.5 ) * IXVSIZ+ IXMINS- 255

IY = (((YW-YWCNTR)/ YWSIZE)+ 0.5 ) * IYVSIZ+ IYMINS- 255

C

C CONVERTCURRENTCOLORTO SOLID'SFORMAT; SEND IT TO SOLID:

CALLGET SLD COLR(CURCOLR, INTEN,COLOR,DUMMY_COLOR)

ICOMP= _COLOR(INTENCOLOR , ,DUMMY_COLOR )

C

C PUT LINEENDPOINTSINTOFORMATREQUIREDBY SOLID:

VERTEXLIST(I,1)= ICURX

VERTEX-LIST(2,1)= ICURY

VERTEX-LIST(I,2)= IX

VERTEX-LIST(2,2) = IY

C

c DRAW LINEBY PRETENDINGIT IS A POLYGON:

ICOMP= SPOLY(SETLINECOLOR,INTEN,COLOR,DUMMY_COLOR,

• DUMMY,NO_VERTTCES,VERTEX_LIST,DUMMY )

C

C SET LAST POINTDRAWNTO AS THE 'CURRENT'POINT:

- 105-
ICURX = IX

ICURY = IY

C

RETURN

END

- 106 -
SUBROUTINESODRWS(IXS,IYS,IDASH )

C

C DRAWA LINEUSINGINTEGERSEREENCOORDS. THE OTHERPOINTTO

C DRAW FROMIS (ICURX,ICURY)IN COMMON/ADAGE/•

C

IMPLICITNONE

C

COMMON/ADAGE/CURCOLR,ICURX,ICURY

INTEGER*4 CURCOLR

INTEGER*2 ICURX,ICURY

C

COMMON/ADVUPR/IXMINS,IXMAXS,IYMINS, IYMAXS,

• IXVSIZ,IYVSIZ,IXVCNTR,IYVCNTR

INTEGER IXMINS,IXMAXS,IYMINS, IYMAXS,

• IXVSIZ,IYVSIZ,IXVCNTR,IYVCNTR

C

INTEGER*2IXS,IYS

INTEGER*4IDASH

INTEGER*2SCOLOR,SPOLY ! CALLEDFUNCTIONSNAMES

INTEGER*2INTEN,COLOR,DUMMY_COLOR,DUMMY,ICOMP

INTEGER*2SET LINECOLOR/4/

C

INTEGER*2NO_VERTICES,VERTEX_LIST(4,2)

DATANO VERTICES/2/, VERTEXLIST/8"0/

C

C

C CONVERTCURRENTCOLORTO SOLID'SFORMAT; SEND IT TO SOLID:

CALLGET SLD COLR(CURCOLR, INTEN,COLOR,DUMMY_COLOR)

ICOMP= SCOLOR(INTEN,COLOR,DUMMYCOLOR )

C

C OFFSETTHE POINTTO AGREEWITHSOLID'SCOORDINATESYSTEM:

IXS = IXS- 255

IYS = IYS- 255

C

C PUT LINEENDPOINTSINTOFORMATREQUIREDBY SOLID:

VERTEX_LIST(I,1)= ICURX

VERTEX_LIST(2,1)= ICURY

VERTEX_LIST(I,2)= IXS

VERTEX_LIST(2,2)= IYS

C

C DRAW LINEBY PRETENDINGIT IS A POLYGON:

ICOMP= SPOLY(SET_LINE_COLOR, INTEN,COLOR,DUMMY_COLOR,

• DUMMY,NO_VERTICES,VERTEX_LIST,DUMMY )

C

C SET LAST POINTDRAWNTO AS THE 'CURRENT'POINT:

ICURX= IXS

ICURY= IYS

RETURN

END

- 107 -
SUBROUTINESOMOVA(XW,YW )

C

C MOVE USINGFLOATINGWORLDCOORDS.

C

IMPLICITNONE

C

COMMON/ADAGE/CURCOLR,ICURX,ICURY

INTEGER*4 CURCOLR

INTEGER*2 ICURX,ICURY

C

COMMON/ADVUPR/IXMINS,IXMAXS,IYMINS, IYMAXS,

• IXVSIZ,IYVSIZ,IXVCNTR,IYVCNTR

INTEGER IXMINS,IXMAXS,IYMINS, IYMAXS,

• IXVSIZ,IYVSIZ,IXVCNTR,IYVCNTR

COMMON/ADWIND/XMINW, XMAXW, YMINW, YMAXW,

• XWSIZE,YWSIZE,XWCNTR, YWCNTR

REAL XMINW, XMAXW, YMINW, YMAXW,

• XWSIZE,YWSIZE,XWCNTR, YWCNTR

C

INTEGER*2IX, IY

REAL XW, YW

C

C PERFORMWINDOWING& VIEWPORTING:

IX = (((XW-XWCNTR)/ XWSIZE)+ 0.5 ) * IXVSIZ+ IXMINS- 255

IY = (((YW-YWCNTR)/ YWSIZE)+ 0.5 ) * IYVSIZ+ IYMINS- 255

C

C SET THE PASSEDIN POINTASTHE CURRENTPOINT:

ICURX= IX

ICURY= IY

RETURN

END

- 108-
SUBROUTINESOMOVS(IXS,IYS )

C

C MOVE USINGINTEGERSEREENCOORDS.

C

IMPLICITNONE

C

COMMON/ADAGE/CURCOLR,ICURX,ICURY

INTEGER*4 CURCOLR

INTEGER*2 ICURX,ICURY

C

COMMON/ADVUPR/IXMINS,IXMAXS,IYMINS, IYMAXS,

• IXVSIZ,IYVSIZ,IXVCNTR,IYVCNTR

INTEGER IXMINS,IXMAXS,IYMINS, IYMAXS,

• IXVSIZ,IYVSIZ,IXVCNTR,IYVCNTR

C

INTEGER*2IXS,IYS,IX, IY

C

ICURX= IXS- 255

ICURY= IYS- 255

RETURN

END

- 109-
SUBROUTINESEND_2_SOLID(N,X, NORMS,IDASH )

C

C DEFINEONE FACEOF A POLYGON.PUTA NORMAL

C AT THE FIRSTVERTEXIN EACHFACE. IDASHIS NOT USEDCURRENTLY•

C SEND POLYGONAND NORMALTO SOLID-3000.

C

C N.B. CONTAINSDEVICEDEPENDENTCODE

C

INCLUDE'PARTS.PRM'

INCLUDE'DEVICE.CMN'

INCLUDE'ADAGE.CMN'

C

COMMON/ADVUPR/IXMINS,IXMAXS,IYMINS, IYMAXS,

• IXVSIZ,IYVSIZ,IXVCNTR,IYVCNTR

INTEGER IXMINS,IXMAXS,IYMINS, IYMAXS,

• IXVSIZ,IYVSIZ,IXVCNTR,IYVCNTR

COMMON/ADWIND/XMINW, XMAXW, YMINW, YMAXW,

• XWSIZE,YWSIZE,XWCNTR, YWCNTR

REAL XMINW, XMAXW, YMINW, YMAXW,

• XWSIZE,YWSIZE,XWCNTR, YWCNTR

C

COMMON/SOZWND/ZMINSLDW,ZMAXSLDW,ZWSIZW,ZWCNTRW

REAL ZMINSLDW,ZMAXSLDW,ZWSIZW,ZWCNTRW

C

REAL*4X(4,5)

C

C VRTXLST(XIYIZIW,# OF VERTICES):

INTEGER*2VRTXLST(4,5)

INTEGER*2NORMS(4,5)

C

INTEGER*2ICOMP,SPOLY,DUMMY/O/,N

INTEGER*2DEFNORM/1/

C

C

C

C

C PUT POLYGONDEFINITIONINTOFORMATREQUIREDBY SOLID3000:

C

C PERFORMWINDOWING& VIEWPORTING:

IX = ((X(1,1)-XWCNTR)/ XWSIZE)* IXVSIZ+ XMINS

IY = ((X(2,1)-YWCNTR)/ YWSIZE)* IYVSIZ+ YMINS

C

C Z IS "WINDOWED"AND "VIEWPORTED"TO MAKE THE BESTUSE OF

C SOLID-3000'SZ-BUFFERALGORITHM:

IZ = ((X(3,1)-ZWCNTRW)/ ZWSIZW)* 32767.0

C

VRTXLST(I,I)= IX

VRTXLST(2,1)= IY

C

C TRY INVERTINGTHE Z VALUEOF POINTSTO SEE IF THATWILL MAKE

C THE PIXMATCHTHE HIDDENLINERENDEREDPIX IN THE PIXEL

C STUFFINGVERSIONOF SMP:

VRTXLST(3,1)= IZ

- 110 -
C

C THISTRICKYLITTLEBIT OF CODECOPIESTHE FIRST

C VERTEXAND ADDS IT AT THE END OF THE VERTEXLIST

C TO CLOSETHE POLYGON: -HHL

C

C

C NO IT DOESN'T; IT MERELYSHIFTSTHE POINTSAROUNDTHE FACEBY

C ONE INDEX. I DON'TKNOWWHY. -HHL

C

C

DO5I=I,N

IF (I .NE.N) THEN

IP1 = I + 1

ELSE

IP1 = 1

END IF

C

C PERFORMWINDOWING& VIEWPORTING:

IX = ((X(I,IPI)-XWCNTR) / XWSIZE)* IXVSIZ+ XMINS

IY = ((X(2,1P1)-YWCNTR) / YWSIZE)* IYVSIZ+ YMINS

C

C Z IS "WINDOWED"AND "VIEWPORTED"TO MAKETHE BESTUSE OF

C SOLID-3000'SZ-BUFFERALGORITHM:

IZ = ((X(3,1PI)-ZWCNTRW) / ZWSIZW)* 32767.0

C

VRTXLST(1,IPI)= IX

VRTXLST(2,IP1)= IY

C

C TRY INVERTINGTHE Z VALUEOF POINTSTO SEE IF THATWILLMAKE

C THE PIXMATCHTHE HIDDENLINERENDEREDPIX IN THE PIXEL

C STUFFINGVERSIONOF SMP:

VRTXLST(3,IPI)= -IZ

5 CONTINUE

C

C GIVE POLYGONDEFINITIONTO SOLIDSYSTEM(ITIS NOT SENT

C TO THE DISPLAYUNTILA DIDUMPCALLIS MADE):

ICOMP= SPOLY(DEFNORM,DUMMY,DUMMY,DUMMY,

. DUMMY,N, VRTXLST,NORMS )

C

RETURN

END

- 111 -
SUBROUTINESLDZWIND(ZMINSLDZMAXSLD , )

C

C SAVEZ-"WINDOW"SPECSIN COMMONIN WORLDCOORDINATES:

C

IMPLICIT NONE

C

COMMON/SOZWND/ZMINSLDW,ZMAXSLDW,ZWSIZW,ZWCNTRW

REAL ZMINSLDW,ZMAXSLDW,ZWSIZW,ZWCNTRW

C

REAL ZMINSLD, ZMAXSLD

C

CC

ZMINSLDW: ZMINSLD

ZMAXSLDW= ZMAXSLD

ZWSIZW = ZMAXSLDW- ZMINSLDW

ZWCNTRW= (ZMAXSLDW+ ZMINSLDW)/ 2.0

RETURN

END

- 112 -
NOTE: Althoughthissubroutinewas not entirelywrittenby RTI,

it is so heavilymodifiedthat it shouldbe includedhere.

C_w_w_w_w__________

SUBROUTINESTRMDL(NMAX,NN,X,N,IF,T, IPC,INERR)

C

C* ROUTINETO STOREALL MODELNODESAND FACESIN ONE PART

CSLD:

C N.B.DEVECEDEPENDENTCODE

C

C NMAX = MAXNPP(MAXNODESPERPARTPARAMETERIN PARTS.PRM

C ACTUALLYSHOULDNOT BE PASSED)

C NN = NPOINT(# OF VERTICES(NODES)IN THIS PART)

C X(3,4) = XKNOT (VERTEX(NODE)LIST)

C N = NFACE (# OF FACESIN THISPART)

C IF(5,MAXFPP)IFACE = (LISTOF FACES(3OR 4 VERTEXPOLYGONS))

C T(4,4) = TRANSFORMATIONARRAYTO RE-ORIENTPARTFOR VIEWING)

C IPC = THISPARTSCOLOR.(SETBY SUBR.STRCOLR)

C INERR = ARRAYOVERFLOWINDICATOR= 0,1,OR 2. (RETURNED)

C

C NPF = # OF NODESPER FACEIN THIS FACE

C

INCLUDE'PARTS.PRM'

INCLUDE'PARTS.CMN'

INCLUDE'DEVICE.CMN'

CSLDEND

INCLUDE'HS.CMN'

C

COMMON/TMNMX/TXMIN,TXMAX,TYMIN,TYMAX,TZMIN,TZMAX

COMMON/HSOPT/SORL,BFCULL,ISMOTH,DIF,EN,DORD

CHARACTER*ISORL,BFCULL

COMMON/OBSRVR/OX,OY,OZ

CSLD:DIMENSIONX(NMAX,3),IF(5,1),T(4,4)

CSLD:

DIMENSION X(NMAX,3),IF(5,MAXFPP),T(4,4)

INTEGER*2COLORA,COLORB,COLORC,ON, NORMS(4,5),NRMLST,DUMMY

INTEGER*2ICOMP,I2NPF,OFF,LIGHT1,SCOLOR

INTEGER*2XLITVEC,YLITVEC,ZLITVEC,VECTOR,IBFINV

INTEGER*2AMBLIT,DIFUSE,RFLCTD,EXPONT,WEIGHT,WHITE

REAL*4 XT(4,5),NORM

CHARACTER*IANS

DATANRMLST/1/,ON/l/,OFF/O/

DATAXLITVEC/IO0/YLITVEC , /IO0/ZLITVEC , /-500/VECTOR , /O/

C

- 113 -
C

CSLDEND

C

C CHECKFORNODENUMBERAND FACENUMBERLIMITS

INERR = 0

IF ((NG+NN) .GT. MAXNOD) THEN

INERR = I

GO TO 999

ENDIF

IF ((NF+N) .GT. MAXFAC) THEN

INERR : 2

GO TO 999

ENDIF

C

C TRANSFORMAND STORENODES

CSLD:

IF (IDEV .EQ. 6) THEN

DOI0 I:I,NN

NODENO: I + NG

CALL UAPPLY(X(I,I),X(I,2),X(I,3), T,

• XG(NODENO),YG(NODENO),ZG(NODENO))

TXMAX: MaX (TXMAX, XG(NODENO))

TXMIN : MIN (TXMIN , XG(NODENO))

TYMAX: MAX(TYMAX, YG(NODENO))

TYMIN : MIN (TYMIN , YG(NODENO))

TZMAX: MAX (TZMAX, ZG(NODENO))

TZMIN : BIN (TZMIN , ZG(NODENO))

I0 CONTINUE

ELSE

CSLDEND

DO II I:I, NN

II : I+NG

CALL UAPPLY(X(I,I),X(I,2),X(I,3), T, XG(II),YG(II),ZG(II))

TXMAX: MAX (TXMAX XG(II))

TXMIN : BIN (TXMIN XG(II))

TYMAX: MAX (TYMAX VG(ll))

TYMIN : MIN (TYMIN YG(II))

TZMAX: MAX (TZMAX ZG(II))

TZMIN : BIN (TZMIN ZG(II))

II CONTINUE

CSLD:

ENDIF

CSLDEND

CSLD I0 CONTINUE

C

C DEFINE OBSERVER POSITION

CRG OZ = TZMAX + O.I*ABS(TZMAX-TZMIN)

OZ = TZMAX + 2.0* ABS(TZMAX-TZMIN)

CSLD:

IF (IDEV .EQ. 6) THEN

C

C GIVE COLOR OF PART TO SOLID-3000:

CALL GET SLD COLR(IPC, COLORA, COLORB, COLORC)

ICOMP = SCOLOR(COLORA,COLORB, COLORC )

- 114 -
C

C IF REQUESTED,DO SMOOTHSHADING:

IF (ISMOTH.EQ.1) THEN

CALLSLDSMOOTH(NN,N, IF )

RETURN

END IF

END IF

CSLDEND

C

C STOREFACESAND COLOR

II = NF

DO 30 I=I,N

CSLD:

NPF = IF(1,I)

C

C FOR EACHFACE,GIVE FACEDATA,COLOR,& NORMALSTO SOLID:

IF (IDEV.EQ.6) THEN

C

C FORMTHIS FACE'SNORMAL(REQUIREDBY SOLID-3000):

C

C 1ST,COPYTHE FACEPOINTERSINTOFACE(J,II)FOR PLANEQ

C IGNORINGPOINTOR LINEELEMENTS:

IF (NPF.GE.3) THEN

II = II+l

FACE(1,II)= NPF

C

DO 14 J=2,NPF+I

FACE(J,II)= IF(J,I)+ NG

14 CONTINUE

C

C LET PLANEQCOMPUTETHE EQUATIONOF THE PLANE:

CALL PLANEQ(II,A,B,C,D)

C

C NORMALIZEEQNOF THE PLANEOF THISFACETO GET ITSNORMAL

C AND CONVERTIT TO A 16-BITSIGNEDFRACTIONFOR SOLID-3000:

NORM= SQRT(A*A+ B*B+ C*C ) / 32767.0

C

C INSURETHATTHEREWILL BE NO FLOATINGDIVIDEBY ZERO:

IF (NORM.EQ.0.0)THEN

A = 32767.0

B = 32767.0

C = 32767.0

ELSE

A = A / NORM

B = B / NORM

C = C / NORM

END IF

C

C SOLID-3000ONLY REQUIRES1 NORM FOR EACHFACE:

C THE NORMALSARE INVERTEDBECAUSESMP HAS A

C RIGHT-HANDEDCOORDINATESYSTEMAND

C SOLID-3000HASA LEFT-HANDEDCOORDINATESYSTEM:

C

C INSURENO OVERFLOWWHEN CONVERTINGFROMREAL*4TO 1"2:

- 115.-
IF (A .GT.32767.0)THEN

NORMS(I,1)= -32767

ELSE

NORMS(I,I)= -NINT(A)

END IF

C

IF (B .GT.32767.0)THEN

NORMS(2,I) = -32767

ELSE

NORMS(2,1)= -NINT(B)

END IF

C

IF (C .GT.32767.0)THEN

NORMS(3,1)= -32767

ELSE

NORMS(3,1)= -NINT(C)

END IF

C

C COPY FACE'SPOINTSTO XT(4,5)SO SEND_2SOLIDCANGET THEM:

DO 12 J = 2, NPF + 1

JM1 = J - 1

INDEX= IF(J,I) + NG

XT(I,JMI)= XG(INDEX)

XT(2,JMI)= YG(INDEX)

XT(3,JMI)= ZG(INDEX)

12 CONTINUE

C

C GIVE FACE'SPOINTS& NORMALSTO SOLID-3000:

I2NPF= NPF

CALLSENDm 2 SOLID(I2NPF,XT, NORMS,IDASH )

END IF

ELSE

CSLDEND

NPF = IF(I,I)

C

C IGNOREPOINTOR LINEELEMENTS

IF (NPF.LT.3) GO TO 30

II = II+l

FACE(I,II)= NPF

IFC(II)= IPC

DO 20 J=2,NPF+I

FACE(J,II)= IF(J,I)+ NG

20 CONTINUE

C

C "CULL"THE BACK-FACESBY TAKINGDOT PRODUCTOF PLANE

C NORMALWITH VECTORIN DIRECTIONOF OBSERVER

IF (BFCULL.EQ. 'Y') THEN

C

C COMPUTETHE PLANEEQUATIONOF THE GIVENFACE

CALLPLANEQ(II,A,B,C,D)

DOTPR = A*OX+ B*OY+ C*OZ

IF (DOTPR.LE.0.0) THEN

PFLAG(II)= .FALSE.

II = II-1

- 116 -
END IF

END IF

CSLD"

END IF

CSLDEND

30 CONTINUE

C

C UPDATENODEAND FACECOUNTERS

NG = NG+NN

NF = II

C

999 CONTINUE

C

RETURN

END

• - 117 -
NOTE: Althoughthis subroutinewas not entirelywrittenby RTI,

it is so heavilymodifiedthat it shouldbe includedhere.

C____________

SUBROUTINEHSDRVR

C

C N.B.CONTAINSDEVICEDEPENDENTCODE

C

C* DRIVERFORTHE HIDDENSURFACE(LINE)REMOVALROUTINES•

C* DISPLAYAND SHADINGOPTIONSARE SPECIFIEDBY THE USER

C* IN THIS ROUTINE.

C

INCLUDE'PARTS.PRM'

CSLD:

INCLUDE'DEVICE.CMN'

INCLUDE'ADAGE$SOLID:SPARMS.INC/NOLIST'

CENDSLD

INCLUDE'PARTS.CMN'

INCLUDE'LL.CMN'

CHARACTER*80LINE

LOGICALLSHRINK,PLABEL

COMMON/DISOPT/LHIDE,LSHRINK,SFAC,PLABEL,LSELECT(MAXPART),LINE

+ , IDSDW(MAXPART)

COMMON/TW/T,W,S

DIMENSIONT(4,4),W(4),S(4)

COMMON/HSOPT/SORL,BFCULL,ISMOTH,DIF,EN,DORD

CHARACTER*ISORL,BFCULL

COMMON/SCROPT/ IMIN,IMAX,ICTABL

CHARACTER*IIANS

DIMENSIONXT(3,4)

DIMENSIONORG(3)

CHARACTER*4OPTION

DIMENSIONNREC(4)

CSLD:

COMMON/ANTIALIASAALIAS_REQ /

CHARACTER*IAALIASREQ

INTEGER*2FULCOL/17

INTEGER*2ON/l/,OFF/O/,ICOMP

INTEGER*2AMBLIT,DIFUSE,RFLCTD,

• EXPONT,WEIGHT,WHITE,LIGHT1

INTEGER*2COLORA,COLORB,COLORC,DUMMY

INTEGER*2XLITVEC,YLITVEC,ZLITVEC,VECTOR

DATAXLITVEC/IO0/YLITVEC , /IO0/ZLITVEC , /-500/,VECTOR/O/

DATAAMBLIT/6000/DIFUSE , /22000/RFLCTD , /4000/,

CSLDEND EXPONT/20/,WEIGHT/32767/WHITE , /7/,LIGHT1/1/

DATA ISMOTH,EN,DIF/0,1.0,0.30/

- 118-
C

C

C READHIDDENSURFACEINPUTOPTIONS

WRITE (lOUT,2002)

2002 FORMAT(' ENTER S - ELIMINATEHIDDENSURFACE',/,

+ ' L - ELIMINATEHIDDENLINES',/

+ ' B - BOTH (SEPARATEVIEWS)',/,

+ ' R - RETURN')

READ (IN,'(A)',END=I,ERR=I)SORL

I IF (SORL.EQ.'R')RETURN

IF (SORL.NE.'S'.AND.SORL.NE.'L')SORL='B'

C

CSLD:

IF (IDEV.EQ.6) THEN

IF (SORL.EQ. 'B' .OR. SORL .EQ. 'L')THEN

WRITE(lOUT,2001)

2001 FORMAT('DEVICE6: S - ELIMINATEHIDDENSURFACEUSED'/)

SORL = 'S'

END IF

ENDIF

CSLDEND

C THE NEXTTHREEOPTIONSARE "SPECIALPURPOSE"ONLY

C ALLOWTHE USERTO BYPASSTHESEAND USE DEFAULTVALUES

120WRITE (IOUT,2018)

2018 FORMAT('ENTER"Y"TO OVERRIDEDEFAULT',/,

+ 'IMAGEDISPLAYOPTIONS')

IANS= 'N'

READ (IN,'(A)',ERR=120,END=130)IANS

C IF RESPONSEIS "NEGATIVE"USE DEFAULTS

130 IF (IANS.NE. 'Y') THEN

DORD= 0

IANS= 'N'

ICTABL= 2

ICHANG= 0

GO TO 199

END IF

C

C

C IF HIDDENSURFACESHAVEBEENREQUESTED,DETERMINEWHETHER

C IMAGESHOULDBE DISPLAYEDOR STOREDON DISK

DORD = 0

IF (SORL.NE.'L')THEN

150 WRITE (IOUT,2013)

2013 FORMAT('ENTERDISPLAY/DISKIMAGEOPTION',/

1 ' 0 - IMAGEOUTPUTTO DISPLAY',/,

CADGSLD2 ' 1 - IMAGESTOREDON FILE "SMP.IMG"')

CADGSLD READ (IN,'(I1)',END=160,ERR=150) DORD

CADGSLD:

2 ' I - IMAGESTOREDON FILE"SMGG.IMG"')

READ (IN,'(FI.O)',END=I60,ERR=I50) DORD

CADGSLDEND

160 IF (DORD.NE.O.AND.DORD.NE.I)THEN

DORD= 0

END IF

• - 119 -
END IF

C

CSLD:

IF (IDEV.EQ.6 .AND. DORD .EQ.I) THEN

WRITE(lOUT,2014)

2014 FORMAT('DEVlCE6: IMAGENOT IN STORABLEFORMAT'/ )

DORD= 0

END IF

C

IF (IDEV.NE.6) THEN

CSLDEND

170 WRITE (IOUT,2015)

2015 FORMAT('ENTERRESOLUTIONCHANGEOPTION',/,

1 ' N - DEFAULTTO DEVICELIMITS',/,

2 ' Y - REDUCEFOR FASTERDISPLAY')

ICHANG= 0

READ (IN,'(A)',ERR=I70,END=I80)IANS

180 IF (IANS.EQ.'Y') THEN

ICHANG= 1

190 WRITE (IOUT,2016)"

2016 FORMAT('ENTERNEW RESOLUTION(SQUAREONLY)',/,

1 ' RESOLUTIONFOLLOWEDBY STARTINGPIXEL')

READ (IN,*,ERR=190,END=195)IMAX,IMIN

195 ITEMP= IMIN

IMIN= MIN (ABS(ITEMP),ABS(IMAX))

IMAX= IMIN+ MAX(ABS(ITEMP),ABS(IMAX))

IF (IMIN.EQ.IMAX) IANS='N'

END IF

C

197 WRITE (IOUT,2017)

2017 FORMAT('ENTERCOLORTABLEOPTION',/,

1 ' 0 - USE ASSIGNEDPARTCOLORS',/,

2 ' 1 - OVER-RIDEWITHGREYSCALE')

READ (IN,'(I1)',ERR=197,END=198) ITEMP

198 IF (ITEMP.EQ.I) THEN

ICTABL= 1

ELSE

ICTABL= 2

END IF

C

C SET "COMPUTATIONRESOLUTION"

199 CALL CMPRES(DORD,ICHANG,IMIN,IMAX)

CSLD:

END IF

CSLDEND

CRG

IF (SORL.NE.'L')THEN

200 WRITE(IOUT,2004)

2004 FORMAT('ENTERSHADINGOPTION',/,

+ ' 0 - FLATELEMENTSHADING',/,

+ ' I - SMOOTHELEMENTSHADING')

READ(IN,'(II)',END= 200,ERR=200)ISMOTH

IF (ISMOTH.GT.I)ISMOTH= I

IF (ISMOTH.LT.O)ISMOTH= 0

- 120-
C

C CHANGESHADINGPARAMETERS?

250 WRITE(lOUT,2005)

2005 FORMAT('ENTERY TO CHANGESHADINGPARAMETERS')

READ(IN,'(A)',ERR=250,END = 500) IANS

IF (IANS.EQ.'Y')THEN

CSLD:

IF (IDEV.EQ.6) THEN

C

WRITE(IOUT,*)'ENTERAMBIENT,DIFFUSE,REFLECTEDVALUESOF',

' LIGHT:'

WRITE(IOUT,*)'(THESUM OF AMBIENT,DIFFUSE,& REFLECTED',

' SHOULDBE < 32767)'

WRITE(IOUT,*)'(AMB=6000, DIF=22000,& REF=4000IS GOOD)'

READ(IN,19,END=I7,ERR=I7) AMBLIT,DIFUSE,RFLCTD

19 FORMAT(316)

17 CONTINUE

C

WRITE(IOUT,*)'ENTEREXPONENTFOR REFLECTEDLIGHT',

' (20IS GOOD):'

READ(IN,*,END=21,ERR=21) EXPONT

IF (EXPONT.EQ.0.0)THEN

WRITE(IOUT,*)'EXPONENTMUST NOT BE ZERO'

GO TO 17

END IF

21 CONTINUE

C

ICOMP= SLINUM(LIGHTI,OFF,OFF,OFF )

CALLGET SLD COLR(WHITE, COLORA,COLORB,COLORC)

CALLSLIGHT(lIGHT1,XLITVEC,YLITVEC,ZLITVEC,VECTOR,

• COLORA,COLORB,COLORC,AMBLIT,DIFUSE,RFLCTD,

• EXPONT,WEIGHT )

C

WRITE(lOUT,*) 'ANTI-ALIASING?(DEFAULT-NONE)(YOR N):'

READ(IN,50,END=22,ERR=22) AALIAS_REQ

50 FORMAT(AI)

22 CONTINUE

C

IF (AALIAS_REQ.EQ.'Y')THEN

ICOMP= SALIAS(ON)

ICOMP= SQDRAW(OFF)

C

C MONITORGAMMA?

WRITE(lOUT,*) 'ENTERMONITORGAMMA(1.8IS TYPICAL):'

READ(IN,'(F5.3)',END=557,ERR=557)GAMMA

557 CALLSLUVO(FULCOLGAMMA) ,

ELSE

ICOMP= SALIAS(OFF)

ICOMP= SQDRAW(ON)

END IF

C

C DON'TASK PHONG/GOURAUDQUESTIONIF DOINGFLATSHADING:

IF (ISMOTH.EQ.I) THEN

- 121 -
C

WRITE(IOUT,*) 'PHONGSHADING?(DEFAULT-GOURAUD)(Y OR N):'

IANS= 'N'

READ(IN,50,END=23,ERR=23) IANS

23 CONTINUE

C

IF (IANS.EQ. 'Y')THEN

ICOMP= SPHONG(ON)

ELSE

ICOMP= SPHONG(OFF)

END IF

END IF

ELSE

C

C DEVICEIS NOT 6:

CSLDEND

300 WRITE(lOUT,2006)

CHHL:

CHHL2006 FORMAT('ENTERDIFFUSEDLIGHTVALUE')

2006 FORMAT('ENTERDIFFUSEDLIGHTVALUE(0.0-1.0)')

CHHLEND

READ(IN,*,END= 300,ERR=300)DIF

IF (DIF.GT.I.O.OR.DIF.LT.O.O) THEN

WRITE(lOUT,2008)

2008 FORMAT('WARNING-VALUERANGE(0.0-I.0)')

GO TO 300

ENDIF

400 WRITE(IOUT,2007)

2007 FORMAT('ENTERREGULARLIGHTEXPONENT')

READ(IN,*,END=4OO,ERR=400) EN

500 CONTINUE

END IF

ENDIF

ENDIF

WRITE (lOUT,2003)

2003FORMAT(' ENTERBACKFACECULLOPTION',/,

+ ' N - NO BACKFACECULL',/,

+ ' Y - PERFORMBACKFACECULL',/,

+ ' R - RETURN')

READ (IN,'(A)',END=Z,ERR=2)BFCULL

2 IF (BFCULL.EQ. 'R')RETURN

IF (BFCULL.NE.'Y') BFCULL= 'N'

C

CSLD:

IF (IDEV.EQ.6) THEN

ICOMP= SSHADE(ON)

ICOMP= SQDRAW(OFF)

C

IF (BFCULL.EQ. 'Y')THEN

ICOMP= SBFCUL(ON)

CDEBUG:

CCCC WRITE(lOUT,'("(HSDRVR)SBFCUL(ON)- ON=", 11)'),ON

ELSE

ICOMP= SBFCUL(OFF)

- 122-
CDEBUG•

CCCC WRITE(IOUT,'("(HSDRVR)SBFCUL(OFF)- OFF=", I1)'),OFF

END IF

C

IF (ISMOTH.EQ.1) THEN

ICOMP= SSFLAT(OFF)

ELSE

ICOMP= SSFLAT(ON)

END IF

C

C SENDALL DRAWINGATTRIBUTESTO THE ADAGE-3000-

CALLDIDUMP

END IF

CSLDEND

C

OPTION---'READ'

C

C INITIALIZEFORHIDDENSURFACEREMOVAL

CALLDIERAS

CALL INITPRI

C

C LOOPTHRU FORTHE NUMBEROF PARTS

DO 100 NP=I,NUMPART

C

C

C SKIP IF PART IS NOT TO BE DISPLAYED

IF (LSELECT(NP).NE.O) GO TO 100

C

IERR= 0

IF (PSTAT(1,NP).EQ.0.0)THEN

IC = 1

CALLSTRCOLR(NP,IERR)

ELSE

IC=O

NFCOLR= INT(PSTAT(I,NP))

END IF

C

LCN = LLPNTR(NP)

30 CALLLLNXT(LCN,NREC, LNN)

CALLGEOFIL(OPTION,NREC(3))

C

C

IF (IC .NE.0 .AND.IERR.EQ.O) THEN

NFCOLR= NCMPCOL(IC)

IC = IC + 1

END IF

C

C STOREMODELFORHIDDENSURFACEREMOVALCALLSTRMDL(MAXNPP,NPOINT,XKNOT,NFACE,IFACE,T,NFCOLR,

+ INERR)

IF (IERR.NE.O) THEN

IF (INERR.EQ.1) THEN

WRITE (IOUT,2011)MAXNOD,NP

2011 FORMAT(' ERROR- MAXIMUMNODENUMBERLIMIT(',I5,

- 123 -
+ ')EXEEEDED',/,'PART',15,'IGNORED')

END IF

IF (INERR.EQ.2) THEN

WRITE (IOUT,2012)MAXFAC,NP

2012 FORMAT('ERROR- MAXIMUMFACENUMBERLIMIT(',I5,

+ ')EXEEEDED',/,'PART',I5,'IGNORED')

END IF

END IF

CSLD:

C

C SENDTHE PARTTO THE DISPLAY:

IF (IDEV.EQ.6) CALLDIDUMP

CSLDEND

C

IF (LNN.NE.O) THEN

LCN.=LNN

GO TO 30

END IF

100CONTINUE

C

C PERFORMHIDDENSURFACEREMOVAL

CSLD CALL HIDSRF

CSLD:

IF (IDEV.EQ.6) THEN

C

C ANTI-ALIASTHE IMAGE(IFREQUESTED):

IF (AALIAS_REQ.EQ. 'Y') ICOMP= SFILT(O)

ELSE

CALLHIDSRF

END IF

CENDSLD

C

C PERFORMHOUSEKEEPING

CSLD:

C RESTORELINEDRAWINGCAPABILITY:

IF (IDEV.EQ.6) THEN

ICOMP= SSHADE(OFF)

C

C SET ANTI-ALIASINGAND QUICK-DRAWON/OFFIF THEYWEREASKED FOR:

IF (AALIASREQ .EQ.'Y')THEN

ICOMP=-SALIAS(ON)

ICOMP= SQDRAW(OFF)

ELSE

ICOMP= SALIAS(OFF)

ICOMP= SQDRAW(ON)

END IF

END IF

CSLDEND

CALLDIHOME

CALLDIDUMP

CADGSLD:REWINDIU

C

RETURN

END

- 124 -
C FILENAME: XBS.FTN

C PROGRAMMER: HAROLDLANE,JR.

C VERSION: 1.0

C

C EXTERNALCALLS (FILENAME):

C NONE

C

C FUNCTION: XBS ALLOWSBOTHTHE CROSSBARSWITCHAND THE

C CHANNELCROSSBAR IN THE LUVO-24TO BE SET. A READBACK

C FUNCTIONIS SIMULATED,BECAUSETHE ACTUALREGISTERSIN

C THE XBS AND CHANNELXBS ARE NOT ABLETO BE READBACKTO

C THE HOST. EXTENSIVEVALIDATIONIS DONEON THE ARGUMENTS

C PASSEDTO XBS TO INSURETHAT REASONABLEVALUESARE SENT

C TO THE HARDWARE.AN OPTIONIS AVAILABLETO SET THE

C CROSSBARSTO A STRAIGHTTHROUGHFULLCOLORDEFAULT.

C ALSO,VALUESCAN BE SET IN THE MASTERXBS ARRAYIN COMMON

C WITH OR WITHOUTTHE ARRAYBEINGSENTTO THE IKONASDISPLAY.

C AN ATTEMPTTO SENDANY UNINITIALIZEDDATATO THE DISPLAY

C IS TRAPPEDAND REPORTED.UNINITIALIZEDCROSSBARBITSARE

C READBACKAS THE VALUE-1. BETWEEN1 AND 35 BITSCAN

C BE SET AT THE SAMETIME. THE INTEGER*4DATA TO BE SET

C INTOTHE CROSSBARSIS PASSEDIN (ORBACKOUT) IN THE

C ARRAYIODATAWHICHSHOULDBE DIMENSIONEDWITH 35 ELEMENTS

C IN THE CALLINGPROGRAMTO BE ABLE TO RECEIVETHE MAXIMUM

C AMOUNTOF DATA RETURNED.THE ENTIREXBS AND THE CHANNEL

C XBS ARE ALL SENTWHENEVERTHEWRITEMODE IS SPECIFIED.

C

- 125 -
SUBROUTINEXBS(N,STRTAD,IODATA,IMODE, IERR)

C___________

c

C XBS CALLINGPARAMETERUSAGE:

C

C N: # OF OUTPUTBITSTO BE SET IN THE XBS OR CHANNELXBS

C STRTAD:O-ORIGINBIT # OF XBS TO BE SET.34 TO SET CHANNELXBS

C IODATA:35 ELEMENT1"4ARRAYTO PASSDATA IN OR OUT

C FOR XBS ADDRESSES0-33,VALUESOF 0-33,63ARE ALLOWED.

C VALUEOF 63 FORCESXBS OUTPUTBIT TO 0 VALUE

C FORCHANXBS ADDR (34),VALUESOF 0,21,36,&42 ALLOWED

C O: RED PSEUDOCOLOR

C 21: GREENPSEUDOCOLOR

C 36: FULLCOLOR

C 42: BLUE PSEUDOCOLOR

C IMODE: O: READBACKN (1{N{35)XBS OUTPUTBIT SETTINGS

C 1: SET ONE OR MOREVALUESINTOXBS ARRAY.NO DATASENT

C 2: SET 1 OR MOREVALUESIN XBS ARRAY.ALL DATASENT

C 3: SET XBS TO DEFAULTSTRAIGHTTHRU 32 BIT FULLCOLOR

C THE DATA IS SENTTO THE IKONAS

C IERR: O: NO ERROR

C 1: # OF WORDSTO BE WRITTENTO XBS BAD.1-35ALLOWED

C 2: STARTADDROF XBS BIT(S)TO SET BAD.0-34ALLOWED

C 3: ENDADDR OF LASTXBS BIT TO SET BAD.34 MAX ALLOWED

C 4: VALUEOF IMODEBAD.0-3ALLOWED

C 5: CHANNELXBARVALUETO SET BAD.0,21,36,&42 ALLOWED

C 6: XBS VALUETO BE SET IS BAD.0-33OR 63 ALLOWED

C

C___________

C TYPEDECLARATIONS:

C___________

C

C

COMMON/SYSIO/ TTYIN,TTYOUT,HELPIN,PIXFIL

INTEGER*2 TTYIN,TTYOUT,HELPIN,PIXFIL

C

INTEGER*4XBDATA(35)

INTEGER*2N, STRTAD,ENDAD,TNDAD,IMODE,IERR

C

INTEGER*4IODATA(35),DATA,DEFALT(35),XBSADR,CXBADR

INTEGER*4ADDR

C

C INITIALLY,DATA IS SET TO THE UNINITIALIZEDDATAVALUE:

DATAXBDATA/35"-I/

DATADEFALT/O,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,

* 19,20,21,22,23,24,25,26,27,28,29,30,31,32,33, 36/

c

- 126 -
c

c FORM32-BITCROSSBARSWITCHADDR - 302\0OCTAL:

CALLJOIN32(XBSADR,194,O)

C

C FORM32-BITCHANNELCROSSBARSWITCHADDR - 203\2000:

CALLJOIN32(CXBADR,131,1024)

C

C TEST FORVALID# OF WORDSTO WRITE:

IF (.NOT.(N.LT.I .OR.N .GT.35))GO TO 100

WRITE(TTYOUT,50) N

50 FORMAT('O(XBS)# OF WORDSTO SEND TO XBS:',I6, ' BAD.',

* ' 1-35ALLOWED')

IERR= 1

RETURN

100 CONTINUE

C

C VALIDATESTARTINGADDRESSOF XBS BIT TO SET:

IF (.NOT.(STRTAD.LT.0 .OR.STRTAD.GT.34))GO TO 200

WRITE(TTYOUT,150)STRTAD

150 FORMAT('O(XBS)STARTINGADDRESSOF XBS:'I6,

* ' BAD.0-34ALLOWED')

IERR= 2

RETURN

200 CONTINUE

C

C VALIDATEENDINGADDRESSOF XBS BIT TO SET:

ENDAD= STRTAD+ N - 1

IF (.NOT.(ENDAD.GT.34))GO TO 300

WRITE(TTYOUT,250) ENDAD .-

250 FORMAT('O(XBS)ENDINGADDRESSOF XBS:',I6,

* ' BAD.A MAX OF 34 IS ALLOWED')

IERR= 3

RETURN

300 CONTINUE

C

C VALIDATEIMODEPARM:

IF (.NOT.(IMODE.LT.0 .OR.IMODE.GT.3))GOTO 400

WRITE(TTYOUT,350)IMODE

350 FORMAT('O(XBS)IMODE:',I6, ' BAD.0-3 ALLOWED')

IERR= 4

RETURN

400 CONTINUE

C___________

C

c IS THISA REQUESTTO READBACKDATA?

IF (.NOT.(IMODE.EQ.O)) GO TO 425

C

C YES, IT IS.ALLOWDATATO BE PASSEDBACK:

- 127 -
DO 415 ADDR = STRTAD,ENDAD

IODATA(ADDR-STRTAD+I) = XBDATA(ADDR+I)

415 CONTINUE

RETURN

425 CONTINUE

CW_w__w__w_w_w_w_w_w_w_w_w_

c

C SEE IF THISIS REQUESTTO WRITEDATAINTOTHE MASTERXBS ARRAY:

IF (.NOT.(IMODE.EQ.1 .OR. IMODE.EQ.2))GO TO 625

C

C YES,COPYDATAINTOARRAY;REPORT& RETURNIF BADDATA:

TNDAD= ENDAD

IF (.NOT.(ENDAD.EQ.34))GO TO 430

C

C VALIDATECHANNELXBS SETTINGVALUE:

DATA = IODATA(ENDAD- STRTAD+ 1)

IF (.NOT.(DATA.NE.0 .AND.DATA .NE.21

* .AND.DATA .NE.36 .AND.DATA .NE.42))GOTO420

CC INVALIDCHANNELXBS DATAVALUE;REPORT:

WRITE(TTYOUT,417)DATA

417 FORMAT('O(XBS)CHANNELXBARDATA:',Ill,

* ' BAD.0,21,36,42ALLOWED')

IERR= 5

RETURN

420 CONTINUE

C

C SET CHANNELCROSSBAR:

XBDATA(35)= DATA

TNDAD= 33

IF (N .EQ.I) GO TO 600

430 CONTINUE

C

C SET XBS DATA INTOARRAY;REPORTBADDATA & RETURN:

DO 600 ADDR = STRTAD,TNDAD

DATA = IODATA(ADDR- STRTAD+ 1)

IF ((DATA.GE.O.AND.DATA.LE.34).OR.DATA.EQ.63)GOT0500

C

C XBS INPUTDATA BAD:

WRITE(TTYOUT,450)ADDR,DATA

450 FORMAT('O(XBS)DATAAT ADDRESS:',16,

* ' HAS BADVALUE:',Ill, '. 0-34,63ALLOWED')

IERR= 6

RETURN

500 CONTINUE

C

C DATA IN RANGE;PUT INTOMASTERARRAY:

XBDATA(ADDR+ 1) = DATA

600 CONTINUE

IF (IMODE.EQ.I) RETURN

625 CONTINUE

C___________

c

C SEE IF DEFAULTXBS SETTINGSWANTED:

- 128 -
IF (.NOT.(IMODE.EQ.3)) GO TO 640

DO 630 ADDR= 1, 35

XBDATA(ADDR)= DEFALT(ADDR)

630 CONTINUE

640 CONTINUE

C___________

c

C SEE IF DATA IS TO BE WRITTENTO IKONAS:

IF (.NOT.(IMODE.EQ.2 .OR. IMODE.EQ.3))GO TO 800

C

C YES, IT IS. INSUREALL DATATO BE SENT IS INITIALIZED:

DO 750 ADDR = O, 34

IF (.NOT.(XBDATA(ADDR+I) .EQ.-1))GO TO 700

C

C UNINITIALIZEDDATA;REPORT& RETURN:

WRITE(TTYOUT,650)ADDR

650 FORMAT('O(XBS)UNINITiALIZEDDATA'

* ' ASKEDTO BE SENT TO XBS BIT:',I6 /)

IERR= 7

RETURN

700 CONTINUE

750 CONTINUE

C

C ALL DATAIS INITIALIZEDISEND IT:

CALL IKBWR(O,XBSADR,34,XBDATA)

CALL IKBWT

CALL IKBWR(O,CXBADR, I, XBDATA(35))

CALL IKBWT

RETURN

800 CONTINUE

C___________

C

C YOU ARN'TSUPPOSEDTO BE ABLETO GET HERE.IF SO, ERROR:

WRITE(TTYOUT,850)

850 FORMAT('O(XBS)INTERNALPROGRAMERROR.NO DATASENT TO IKONAS')

RETURN

END

- 129 -
APPENDIX D

SUBROUTINESLISTED BY SOURCE CODE MODULE

ADSUBS.FOR

SUBROUTINEADDRWA(XW,YW, IDASH )

SUBROUTINEADDRWS(IXS,IYS,IDASH )

SUBROUTINEADLINE(Xl,Y1, IDASH )

SUBROUTINEADMOVA(XW,YW )

SUBROUTINEADMOVS(IXS,IYS )

SUBROUTINEADVUPR(IXMIN,IXMAX,IYMIN,IYMAX )

SUBROUTINEADWIND(XMIN,XMAX,YMIN,YMAX )

ALPHA.FOR

SUBROUTINEAEDIT

SUBROUTINEEDADD

SUBROUTINEEDPRNT(FIRST,LAST)

SUBROUTINEHEADR(NAME,NUMHD,STATHD,TRANSHD)

SUBROUTINETFORM

SUBROUTINEEDCHNG(ID,IOPT)

SUBROUTINECHNGALL(ID,IOPER,NCOMPNU,PCOMPNU)

SUBROUTINECKASCO(IDC,IDP,MCOMP,ACOMP,INDX,IERR)

SUBROUTINECYCLIC(IDP,INC,NCOMPNU,PCOMPNU,IERR)

SUBROUTINEEDDEL(ID,IOPT)

SUBROUTINEEDREST(ID,IOPT)

SUBROUTINEEDCOPY(ID,IOPT)

SUBROUTINEEDDRAW(IPART)

SUBROUTINEANGCALC(A,B,C,ISTAT)

SUBROUTINECKID(ID,ICODE,INDX)

SUBROUTINEEXIMPFN(NUMP,NSS2,NSTACK)

SUBROUTINECHEKATT(ID)

- 130 -
CLIP.FOR

SUBROUTINECLIP2D(P2X,P2Y, XMIN, XMAX, YMIN, YMAX, IDASH )

SUBROUTINEENDPT CODE (PX, PY° CLIPPINGBOX, PCODES, SUM)

SUBROUTINELOGIC-INTERSECT(PICODES,P2CODES, INTERSECT)

CMAPLD.FOR

SUBROUTINECMAPLD

CTABLE.FOR

SUBROUTINECTABLE (IOPT)

CURSLD.FOR

SUBROUTINECURSLD

DICTAB.FOR

SUBROUTINEDICTAB (IOPT)

DIDDGS.FOR

SUBROUTINEGDINIT (IGD,IBAUD)

SUBROUTINEPRINIT(IIBAUD)

SUBROUTINECMPRES (IDISK,ICHANG,IMIN,IMAX)

SUBROUTINEDDSTOV (IXS,IYS,XV,YV)

SUBROUTINEDDVTOS (XV,YV,IXS,IYS)

SUBROUTINEDDWTOS (XW,YW,IXS,IYS)

SUBROUTINEDICHRSZ (NUM)

SUBROUTINEDICOLR (NUM)

SUBROUTINEDICTAB (IOPT)

SUBROUTINEDICURS (ICH,XW,YW)

SUBROUTINEDIDRWS (XV,YV)

SUBROUTINEDIDRWW(XW,YW)

SUBROUTINEDIDSHS (XV,YV,IDASH)

SUBROUTINEDIDSHW(XW,YW,IDASH)

SUBROUTINEDIDUMP

SUBROUTINEDIERAS

SUBROUTINEDIHOME

SUBROUTINEDIINQD (JDEV)

SUBROUTINEDIMOVS(XV,YV)

SUBROUTINEDIMOVW(XW,YW)

SUBROUTINEDIOVRR(ITORA)

SUBROUTINEDIPAUS

SUBROUTINEDISCTE (NCTE,IR,IG,IB)

SUBROUTINEDITEXT (LENS,CHARS)

- 131 -
SUBROUTINEDIVUPR(XMINV,XMAXV,YMINV,YMAXV)

SUBROUTINEDIWIND (XMINW,XMAXW,YMINW,YMAXW)

SUBROUTINELOGO

SUBROUTINETITLE

SUBROUTINEPCFFIO (IVW,ILINES)

SUBROUTINEWPXLA(XV,YV,MAXR,NR,NC,IPIXEL)

DISPLAY.FOR

SUBROUTINEDISPLAY

SUBROUTINEDMENU

SUBROUTINESPP (LINE,LSELECT,ICODE)

SUBROUTINEDRAW

SUBROUTINEHSDRVR

SUBROUTINERSETTV

SUBROUTINEVIEW4(IFLAG)

SUBROUTINEZOOM

SUBROUTINEWINDOW

SUBROUTINESETRNG

SUBROUTINEAXlS

SUBROUTINEHIDDEN (N,X,ORG,IFLAG)

SUBROUTINEDFACE(N,X,IDASH)

SUBROUTINESHRINK (F,N,X)

SUBROUTINESAVOPT

SUBROUTINERSTOPT

SUBROUTINESTRCOLR(NP,IERR)

FBC.FOR

SUBROUTINEFBC(IMODE, IFBNO, IWRITE, IINVBL, JINVAL, IERR)

GETCOLORM.FOR

SUBROUTINEGET_SLD_COLR(CURCOLR, CLRA, CLRB, CLRC)

GRAPHICS.FORI5

SUBROUTINEGRAPHIC

SUBROUTINEPICVIEW(IVW,ICODE)

SUBROUTINESUCES(ICNT,IVW,ITRY,CHOICE,ISAVPT,ISAVID,ISEND)

SUBROUTINEFNDPRT(ISAVPT,NVW)

SUBROUTINEFNDPNT(NPART,IPT,NVW)

SUBROUTINEPICKPNT(XI,YI,IX,IY,NVW, IPART,IPT, ICODE)

SUBROUTINESQUARE(X,Y,Z)

SUBROUTINECROSS(X,Y,Z)

SUBROUTINEDISPNT

SUBROUTINETRANPRT

SUBROUTINEMOVPRT

SUBROUTINEMOVPNT

SUBROUTINEEXORNEW(XI,YI,ZI,IX,IY,IVW, IPART,IPT, IPICK,STRING,

- 132-
SUBROUTINEDISTCK(XPT,YPT,XNEW,YNEW, IVW,INRNG)

SUBROUTINEMODPNT

SUBROUTINEADDPNT

SUBROUTINEDELPT

SUBROUTINEADDFACE

SUBROUTINEDELFACE

SUBROUTINECAPIT

SUBROUTINEWRTGEO(NPART)

SUBROUTINEROTPRT

SUBROUTINEDEGREES(X,Y,XC,YC,THETA)

SUBROUTINEGETPNT(X,Y,IX,IY,IPT)

SUBROUTINELODGEO(NPART,NP)

HSDRVR.FOR

SUBROUTINEHSDRVR

MASPROP.FOR

SUBROUTINEMASPROP

SUBROUTINEVOLUME

SUBROUTINEDIMEN

SUBROUTINEDIMPART

SUBROUTINEDIMALL

SUBROUTINEDIMNODE

PF2GF.FOR

SUBROUTINEPRT

SUBROUTINEINITLL

SUBROUTINEBUILDPF (NUMP,IOPER,NCOMPNU,PCOMPNU)

SUBROUTINEASTRAN(NUMP)

SUBROUTINEPADD (NUMP,NCOMPNU,PCOMPNU)

SUBROUTINEPCADD (NUMP,MCOMP,MCNUM)

SUBROUTINEPPADD (NUMP,NAMP,NUMC,NER,LCNC)

SUBROUTINEPMOD (NUMP,NCOMPNU,PCOMPNU)

SUBROUTINEPPMOD (NUMP,NAMP)

SUBROUTINEPDEL (NUMP)

SUBROUTINEEXIMPF (NUMP)

SUBROUTINELLNXT (LCN,NREC,LNN)

SUBROUTINELLADD (LSN,NREC)

SUBROUTINELLDEL (LSN,LCN,INDX)

SUBROUTINELLREP (NUMP,NUMC,LCN)

SUBROUTINELLINS (LSN,LCN,NRECC)

PRIMTV.FOR

SUBROUTINEBUILDGF(NUMP,IER,INR)

SUBROUTINEEXTRN (NPART,TP,INR)

SUBROUTINECUBE(NPART,L,H,W,TP,INR).

- 133 -
SUBROUTINECONE(NPART,RU,RL,H,NF,DVANGL,TP,INR)

SUBROUTINESPHERE(NPART,R,NH,NV,DVANGL,TP,INR)

SUBROUTINEPARAB(NPART,R,P,NH,NV,DVANGL,TP,INR)

SUBROUTINETORUS(NPART,RI,RO,NV,NH,STANG,TP,INR)

SUBROUTINETRANSWP(NPART,PNTORGI,PNTORG2,PNTORG3,

SUBROUTINECROSSV(X,I,J)

FUNCTIONLNGTHV(X,Y,Z)

SUBROUTINEROTASWP(NPART,NS,DVANGL,NDCAP,XYCAPI,XYCAP2,TP,INR)

SUBROUTINEASSEM(NPART,TP,IER,INR)

SUBROUTINEASSMRNG(NPART)

SUBROUTINEBOOLEN(NPART,INR)

SUBROUTINEPRTRNG(NPART)

SUBROUTINERST(VECTOR,ARRAY,NPART)

SUBROUTINEGEOFIL (OPTION,NPART)

SUBROUTINEOPENGEO(IOPT)

SUBROUTINEMOVORG(T,NPART)

SUBROUTINEMVORGAS(T,NPART)

PRIORTY.FOR

SUBROUTINEINITPRI

SUBROUTINESTRMDL(NMAX,NN,X,N,IF,T, IPC,INERR)

SUBROUTINEHIDSRF

SUBROUTINEPRIORTY(ISTART)

SUBROUTINEFOREST(NUM,DATIN,DATOUT,INDEX,ICOMP)

SUBROUTINESPECIAL

SUBROUTINEMINIMAX (II,JJ,IFLAG)

SUBROUTINEMNMX(N,X,XMAX,XMIN)

SUBROUTINEPLANEQ(II,A,B,C,D)

SUBROUTINEPDEEPQ(II,JJ,IALLPT,IFLAG)

SUBROUTINEOVERLAP(II,JJ,IFLAG)

SUBROUTINECONTANP(X,Y,JJ,IFLAG)

SUBROUTINEEDGMNMX(II,12,JI,J2,!FLAG)

SUBROUTINENTRSCT(AI,BI,CI,A2,B2,C2,EPS,XO,YO,IFLAG)

SUBROUTINESAMPLN(II,JJ,IFLAG)

SUBROUTINESLICEP (ll,JJ)

SUBROUTINEMIDDIV (II)

SUBROUTINEPENTRAT(ll,JJ)

SUBROUTINERESORT(N)

SUBROUTINEPPLAN(II,JJ,IFLAG)

SCANLINE.FOR

SUBROUTINEDRAWHS

SUBROUTINECENTER (II,CM,DIST)

SUBROUTINESCNFIL(IFAC,NVPF,XYI,ICOLOR, ISCAN,IBUFF)

SUBROUTINEVTOS (X,Y,IFLAG)

SUBROUTINESCNINT (N,X,Y,ISCAN,XI,IE,HFLAG)

SUBROUTINEEMAXY(ISTART,IEDGE,Y,N,ICOUNT,ILAST,INDX)

SUBROUTINEDSPLASL (N,LINE,ISCAN)

SUBROUTINE INTENS (RINT,CLR)

SUBROUTINENORAV (NODE,NNODE,XNORM)

- 134 -
SUBROUTINESMOOTH(IEDGE,NVPF,Y,RI,ISCAN,AI,BI)

SUBROUTINESHADER(COLOR)

SUBROUTINECHKNOD(NODE,NODLIST,ICOUNT)

SUBROUTINESL2D (N,LINE)

SUBROUTINEINITAET

SUBROUTINEINITSET

SUBROUTINESETSET(SCAN,IFAC,XINT,IEDGE,HFLAG,ICOLOR)

SUBROUTINENEARHOR(SCAN,J,NSET)

SUBROUTINESETHOR(HFLAG,XINT,ICOLOR)

SUBROUTINENXTHOR(NHL)

SUBROUTINESETAET(ISCAN)

SUBROUTINEDRWHOR(ISCAN)

SUBROUTINEDRWEDG(I,NAET,J,NSET,SCAN)

SUBROUTINECINTSCT(XI,YI,X2,Y2,NSET,CINTX,CINTY,SCAN)

SUBROUTINESETINT(XI,Y1,X2,Y2,J,NSET,CINTX,CINTY,SCAN,DIST)

SUBROUTINEGETINT(Xl,YI,X2,Y2,XF1,YFI,XF2,YF2,X,Y)

SUBROUTINEDRWLIN(N,I)

SETOP.FOR

SUBROUTINESETOP (NPART,IA,IB,SOP,LLEGAL)

SUBROUTINESOLBOX(XYZA,XYZB,XYZS,INTFLG)

SUBROUTINEPCENTR(MAXN,N,XYZ,C)

SUBROUTINEFACBOX(NVPF,IFACE,MAXN,XYZ,XYZMM)

SUBROUTINEEDGBOX(X1,YI,Zl,X2,Y2,Z2,XYZMM)

SUBROUTINEEIFP (Xl,Y1,ZI,X2,Y2,Z2,A,B,C°D,CTR°INTFLG)

SUBROUTINEEPINT(Xl,YI,Zl,X2,Y2,Z2,A,B,C,D,XO,YO,ZO,LFLAG)

SUBROUTINEINTEXT(MAXN,N,XYZ,P,A,B,C,EPS,LFLAG)

SUBROUTINEEQPLAN(NVPF,IFACE,MAXN,XYZ,A,B,C,D)

SUBROUTINEDUPNOD(XO,MAXN,NNODE,XYZ,EPSN,NINDX,IERR)

SUBROUTINEORDCON(NEDGE,MAXC,NUMC,IFACE, ITAG,MAXN,XYZ)

SUBROUTINEXCHANG(MAXC,IFACE,ITAG,INDX,JNDX)

SUBROUTINECRNRPT(LFLAG,MAXC,NUMC,IFACE,ITAG)

SUBROUTINESUBFAC(MAXC,NUMC,IFACE,ITAG,NSF,JFACE,MAXS,ITYPE,

SUBROUTINEREDUNE(MAXC,JFACE,IFACE, ITAG,IROOToNVPF,

SUBROUTINECOLINR(IVI,IV2,1V3,MAXP,XYZ,LCOLIN)

SUBROUTINECNVXFC(MAXC,JFACE,IFACE, ITAG,IROOT,

SUBROUTINENNCNVX(MAXC,KFACE,ITAG,IROOT,NFL,NSF,

SUBROUTINEADDCON(MAX,ICONN,INDX,NFL, IERR)

SUBROUTINEDISTSQ(MAX,XYZ,INDX,JNDX,DIST)

SUBROUTINEREVRSE(IROOT,MAXL,LLIST)

SUBROUTINENUEDGE(IEVI,IEV2,MAXD,IFACE,IROOT,LFLAG)

SUBROUTINECONCAV(IIN,ITVl,ITV2,ITV3,MAXC,IFACE,MAXP,XYZ,LFLAG)

SUBROUTINECLEANN

SLDSMOOTH.FOR

SUBROUTINESLDSMOOTH(NN, N, IF )

- 135-
SLDSUBS.FOR

SUBROUTINESODRWA(XW,YW, IDASH )

SUBROUTINESODRWS(IXS,IYS, IDASH )

SUBROUTINESOMOVA(XW,YW )

SUBROUTINESOMOVS(IXS,IYS )

SUBROUTINESEND 2 SOLID(N,X, NORMS, IDASH )

SUBROUTINESLDSMOOTH(NN,N, IF )

SUBROUTINESLDZWIND(ZMINSLD,ZMAXSLD )

SMPMISC.FOR

SUBROUTINESINITT

SUBROUTINEGINITT

SUBROUTINESAVEGM

SUBROUTINESAVMODL

SUBROUTINESAVGEO

SUBROUTINETOMOV

SUBROUTINECOLMOV(IASSEMI)

SUBROUTINETOPAT

SUBROUTINEFILMAT(I,ONE,TWO,TRE,FOR,T)

SUBROUTINEFLGCOMP(LSELECT)

SUBROUTINEREADGM

SUBROUTINEREADER(IREAD)

SUBROUTINERDRNEW(IREAD)

SUBROUTINERDGEO(IREAD)

SUBROUTINEGETNUM(IREAD,ISTART, ICODE)

SUBROUTINERDMOV(IREAD)

SUBROUTINEHELP (I)

SUBROUTINESMPDOC(INDEX,ICODE)

SUBROUTINEOPENR(DESC,ICODE)

SUBROUTINEOPENW(DESC,ICODE)

SUBROUTINEFICLOSE(ICODE)

SUBROUTINERIDBLK (FILNAM,LEN,ISTART,IEND)

SUBROUTINEERRLOG(NUMERR,NAMROU)

SUBROUTINEBREAKIT (IPNTR)

SUBROUTINESTRCOMP(NUM,NCOMPNU,PCOMPNU,ICODE)

SUBROUTINEPICWNDO(IVW, IX,IY)

FUNCTIONAMAX(A,NPTS)

FUNCTIONAMIN(A,NPTS)

STRMDL.FOR

SUBROUTINESTRMDL(NMAX,NN,X,N,IF,T, IPC,INERR)

U.FOR

SUBROUTINEUCLR (A)

SUBROUTINEUCOPY(A, B)

- 136 -
SUBROUTINEUTRNSP(A,AT)

SUBROUTINEUMULT (A,B, C)

SUBROUTINEUIDENT(A)

SUBROUTINEUAPPLY(X,Y,Z,A, U,V,W)

SUBROUTINEUINVRT(A,B)

SUBROUTINEUPRINT(LUN,LABEL,A)

SUBROUTINEUSETAU(NAME,VAL)

SUBROUTINEUSCLC (SX,SY, SZ, A)

SUBROUTINEUSCLB (SX,SY, SZ, A)

SUBROUTINEUSCLA (SX,SY,SZ, A)

SUBROUTINEUTRNC (DX,DY, DZ,A)

SUBROUTINEUTRNB (DX,DY, DZ,A)

SUBROUTINEUTRNA(DX,DY, DZ,A)

SUBROUTINEUROTOC(IAXIS,ANGLE,A)

SUBROUTINEUROTOB(IAXIS,ANGLE,A)

SUBROUTINEUROTOA(IAXIS,ANGLE,A)

SUBROUTINEUROTIC(PX,PY, PZ,ANGLE,A)

SUBROUTINEUROTIB(PX,PY, PZ,ANGLE,A)

SUBROUTINEUROTIA(PX,PY, PZ,ANGLE,A)

SUBROUTINEUROT2C(OX,OY,OZ,PX,PY,PZ,ANGLE,A)

SUBROUTINEUROT2B(OX,OY,OZ,PX,PY,PZ,ANGLE,A)

SUBROUTINEUROT2A(OX,OY,OZ,PX,PY,PZ,ANGLE,A)

SUBROUTINEUFIXC(I,VAL,A)

SUBROUTINEUFIXB(I,VAL,A)

SUBROUTINEUFIXA(I,VAL,A)

SUBROUTINEUMAPC(A1,A2,Xl,X2, B1,B2,Y1,Y2,

SUBROUTINEUMAPB(A1,A2,Xl,X2, BI,B2,Y1,Y2,

SUBROUTINEUMAPA(A1,A2,Xl,X2, B1,B2,Y1,Y2,

SUBROUTINEUSCTRC(SX,DX,SY,DY,SZ,DZ,A)

SUBROUTINEUSCTRB(SX,DX,SY,DY,SZ,DZ,A)

SUBROUTINEUSCTRA(SX,DX,SY,DY,SZ,DZ,A)

SUBROUTINEUPRMC (I,J, K, A)

SUBROUTINEUPRMB (I,J, K, A)

SUBROUTINEUPRMA (I,J, K, A)

XBS.FOR

SUBROUTINEXBS(N,STRTAD,IODATA,IMODE, IERR)

- 137 -
APPENDIXE

VAX/VMSCOMPILATIONCOMMANDFILE

$ FORADSUBS.FOR

$ FORALPHA.FOR

$ FORCLIP.FOR

$ FOR/NOI4 /NOF77 CMAPLD.FOR

$ FORCTABLE.FOR

$ FOR/NOI4 /NOF77 CURSLD.FOR

$ FORDICTAB.FOR

$ FORDIDDGS.FOR

$ FORDISPLAY.FOR

$ FOR/NOI4 DSPLSTRTI

$ FOR/NOI4 /NOF77 FBC.FOR

$ FORGETCOLORM.FOR

$ FORGRAPHICS.FOR

$ FORHSDRVR.FOR

$ FORLINKDUMMY.FOR

$ FORMASPROP.FOR

$ FORPF2GF.FOR

$ FORPRIMTV.FOR

$ FORPRIORTY.FOR

$ FORSCANLINE.FOR

$ FORSETOP.FOR

$ FORSLDSMOOTH.FOR

$ FORSLDSUBS.FOR

$ FORSMPMISC.FOR

$ FORSTRMDL.FOR

$ FORU.FOR

$ FOR/NOI4 /NOF77 XBS.FOR

• - 138-
APPENDIXF

INCLUDEFILES: VMS LOGICALSREQUIREDFOR SMP SYSTEM

1) IncludeFiles.-

INCLUDE'ADAGE$SOLID:SPARMS.INC'

INCLUDE'ADAGE$SOLID:DSPLSTDEF.INC'

INCLUDE'ADAGE$SOLID:SMNAME.INC'

INCLUDE'ADAGE.CMN'

INCLUDE'AEDDUM.FOR'

INCLUDE'AEDSTAT.FOR'

INCLUDE'DEVICE.CMN'

INCLUDE'HS.CMN'

INCLUDE'LL.CMN'

INCLUDE'PARTS.PRM'

INCLUDE'UNITS.CMN'

2) VMS Logicals Requiredfor SMP Source Compilation.-

$ DEFINE ADAGE$SOLID US2$:[ADAGE.SMP.SMP.SOLID]

3) VMS Logicals Requiredfor SMP Link.-

$ DEFINE ADAGE$SOLID US2$:[ADAGE.SMP.SMP.SOLID]

$ DEFINE ADAGE$AIDS US2$:[ADAGE.V4]

$ DEFINE TEK$LIB US2$:[LIBS]

4) VMS LogicalsRequiredfor SMP Execution.-

$ DEFINE SMP$SCRATCH US2$:[ADAGE.SMP.SMP.SCRATCH]

$ DEFINE ADAGE$SOLID US2$:[ADAGE.SMP.SMP.SOLID]

- 139-
APPENDIXG

SMP LINKCOMMANDFILE: OBJECTMODULESAND LIBRARIES

$ SET VERIFY

$!

$ ! COMPILE FBC,CURSLD,XBS,& CMAPLD USINGFOR/NOI4/NOF77!!!!

$1

$ I (NOTE: Its OK to have%LINK-W-MULDEFfor DICTAB,STRMDL,SLD_SMOOTH,

$! HSDRVR)

$!

$ DEFINE ADAGE$SOLID US25:[ADAGE.SMP.SMP.SOLID]

$ DEFINE ADAGE$AIDS US25:[ADAGE.V4]

$ DEFINE TEKSLIB US25:[LIBS]

$ SET NOVERIFY

$1

$LINK/EXE=SMP-

$ ! SUBROUTINESPUT IMMEDIATELYFOLLOWINGTHISLINEARE FOR DEBUGONLY.

CTABLE,-

HSDRVR,- ! GOES BACKINTODISPLAY

GETCOLORM,- ! THISSHOULDGO INTOSLDSUBS.FOR

SLDSMOOTH,- I GOES BACKINTOSLDSUBS.FOR

STRMDL,- ! GOES BACKINTOPRIORTY.FOR

$ ! ENDOF DEBUGSUBROUTINES

ADSUBS,-

ALPHA,-

CLIP,-

CMAPLD,-

CURSLD,-

DICTAB,-

DIDDGS,-

DISPLAY,-

FBC,-

GRAPHICS,-

LINKDUMMY,- ! < THISSHOULDBE AN AED LIBRARY

MASPROP,-

PF2GF,-

PRIMTV,-

PRIORTY,-

SCANLINE,-

• - 140 -
SETOP,-

SLDSUBS,-

SMPMISC,-

U_-

XBS,-

!................. LIBRARYDEFS:............................................

ADAGESAIDS:DMAVMS,ALUVMS,-

ADAGE$SOLID:SOLID/LIB,UTLLIB/LIB,-

TEKSLIB:TEKLIB/LIB

- 141 -
APPENDIXH

SUBROUTINESTRMDL

Thisappendixincludesa descriptionof modificationsto and listingof

subroutineSTRMDL. This subroutineis singledout fordescriptionbecauseit

is the SMP subroutinethatmodifythemost in theprocessof integratingSMP

with theADAGE3000. Otherrequiredchangesto SMP oftenresultedin new

routinesbeingwrittenso thatthe actualchangeto SMP sourcecodeusuallywas

onlyan addedcallto the new routine.

SubroutineSTRMDLrequireda significantamountof modificationbecauseit

is the routinewhich interfacesthe modeldata structuresto the rendering

method. Thus,when the SOLID3000 systemwas addedas an optionalrendering

method,SMP'smodeldata structureshadto be interfacedto the data structures

requiredby SOLID3000. Briefly,eachof the model'spolygonverticesand

normalsare storedin arraysindexedby coordinateaxis (1,2, and 3 signify

x-axis,y-axis,and z-axis,respectively)and vertexnumber. Normalsare also

indexedby coordinateaxisand vertexnumber. Thesearraysof verticesand

normalscan thenbe passedto SOLID3000. To seedetailsof thisprocess,such

as codeto avoiddivideby zero)see the listingwhichfollows.

SUBROUTINESTRMDL(NMAX,NN,X,N,IF,T, IPC,INERR)

C

C* ROUTINETO STOREALL MODELNODESAND FACESIN ONE PART

CSLD:

C N.B. DEVECEDEPENDENTCODE

C

C NMAX = MAXNPP(MAXNODESPER PARTPARAMETERIN PARTS.PRM

C ACTUALLYSHOULDNOT BE PASSED)

C NN = NPOINT(# OF VERTICES(NODES)IN THIS PART)

C X(3,4) = XKNOT (VERTEX(NODE)LIST)

c N = NFACE (# OF FACESIN THISPART)

C IF(5,MAXFPP)=IFACE (LISTOF FACES(3 OR 4 VERTEXPOLYGONS))

C T(4,4) = TRANSFORMATIONARRAYTO RE-ORIENTPARTFOR VIEWING)

C IPC = THISPARTSCOLOR.(SETBY SUBR.STRCOLR)

C INERR = ARRAYOVERFLOWINDICATOR= 0,I,OR 2. (RETURNED)

C

C NPF = # OF NODESPER FACE IN THISFACE

- 142 -
C

INCLUDE'PARTS.PRM'

INCLUDE'PARTS.CMN'

INCLUDE'DEVICE.CMN'

CSLDEND

INCLUDE'HS.CMN'

C

COMMON/TMNMX/TXMIN,TXMAX,TYMIN,TYMAX,TZMIN,TZMAX

COMMON/HSOPT/SORL,BFCULL,ISMOTH,DIF,EN,DORD

CHARACTER*ISORL,BFCULL

COMMON/OBSRVR/OX,OY,OZ

CSLD:DIMENSIONX(NMAX,3),IF(5,1),T(4,4)

CSLD:

DIMENSIONX(NMAX,3),IF(5,MAXFPP),T(4,4)

INTEGER*2COLORA,COLORB,COLORC,ON, NORMS(4,5),NRMLST,DUMMY

INTEGER*2ICOMP,I2NPF,OFF,LIGHT1,SCOLOR

INTEGER*2XLITVEC,YLITVEC,ZLITVEC,VECTOR,IBFINV

INTEGER*2AMBLIT,DIFUSE,RFLCTD,EXPONT,WEIGHT,WHITE

REAL*4 XT(4,5),NORM

CHARACTER*IANS

DATA NRMLST/1/,ON/l/,OFF/O/

DATA XLITVEC/IO0/YLITVEC , /IO0/ZLITVEC , /-500/VECTOR , /O/

C

C

CSLDEND

C

C CHECKFOR NODENUMBERAND FACENUMBERLIMITS

INERR= 0

IF ((NG+NN).GT.MAXNOD) THEN

INERR= 1

GO TO 999

END IF

IF ((NF+N) .GT.MAXFAC) THEN

INERR= 2

GO TO 999

END IF

C

C TRANSFORMAND STORENODES

CSLD:

IF (IDEV.EQ.6) THEN

DO 10 I=I,NN

NODENO= I + NG

CALLUAPPLY(X(I,I),X(I,2),X(I,3), T,

XG(NODENO),YG(NODENO),ZG(NODENO))

TXMAX= MAX (TXMAX XG(NODENO))

TXMIN= MIN (TXMIN XG(NODENO))

TYMAX= MAX (TYMAX YG(NODENO))

TYMIN= MIN (TYMIN YG(NODENO))

TZMAX= MAX (TZMAX ZG(NODENO))

TZMIN= MIN (TZMIN ZG(NODENO))

10 CONTINUE

ELSE

CSLDEND

DO 11 I=1,NN

- 143 -
II : I+NG

CALLUAPPLY(X(I,1),X(I,2),X(I,3), T, XG(II),YG(II),ZG(II))

TXMAX= MAX (TXMAX, XG(II))

TXMIN= MIN (TXMIN, XG(II))

TYMAX= MAX (TYMAX, YG(II))

TYMIN= MIN (TYMIN, YG(II))

TZMAX= MAX (TZMAX, ZG(II))

TZMIN= MIN (TZMIN, ZG(II))

11 CONTINUE

CSLD:

END IF

CSLDEND

CSLD 10 CONTINUE

C

C DEFINEOBSERVERPOSITION

CRG OZ = TZMAX+ O.I*ABS(TZMAX-TZMIN)

OZ = TZMAX+ 2.0*ABS(TZMAX-TZMIN)

CSLD:

IF (IDEV.EQ.6) THEN

C

C GIVE COLOROF PARTTO SOLID-3000:

CALLGET SLD COLR(IPC, COLORA,COLORB,COLORC)

ICOMP= SCOLOR(COLORACOLORB, , COLORC )

C

C IF REQUESTED,DO SMOOTHSHADING:

IF (ISMOTH.EQ.I) THEN

CALLSLDSMOOTH(NN,N, IF )

RETURN

END IF

END IF

CSLDEND

C

C STOREFACESAND COLOR

II = NF

DO 30 I=I,N

CSLD:

NPF = IF(I,I)

C

C FOR EACHFACE,GIVE FACEDATA,COLOR,& NORMALSTO SOLID:

IF (IDEV.EQ.6) THEN

C

C FORMTHIS FACE'SNORMAL(REQUIREDBY SOLID-3000):

C

C 1ST,COPYTHE FACEPOINTERSINTOFACE(J,II)FOR PLANEQ

C IGNORINGPOINTOR LINEELEMENTS:

IF (NPF.GE.3) THEN

II = II+l

FACE(1,II)= NPF

C

DO 14 J=2,NPF+I

FACE(J,II)= IF(J,I)+ NG

14 CONTINUE

C

C LET PLANEQCOMPUTETHE EQUATIONOF THE PLANE:

- 144-
CALL PLANEQ(II,A,B,C,D)

C

C NORMALIZEEQNOF THE PLANEOF THISFACETO GET ITSNORMAL

C AND CONVERTIT TO A 16-BITSIGNEDFRACTIONFORSOLID-3000.

NORM = SQRT(A*A+ B*B+ C*C ) / 32767.0

C

C INSURETHATTHEREWILL BE NO FLOATINGDIVIDEBY ZERO:

IF (NORM.EQ.0.0)THEN

A = 32767.0

B = 32767.0

C = 32767.0

ELSE

A = A / NORM

B = B / NORM

C = C / NORM

END IF

C

C SOLID-3000ONLY REQUIRES1 NORMFOR EACH FACE:

C THE NORMALSARE INVERTEDBECAUSESMP HAS A

C RIGHT-HANDEDCOORDINATESYSTEMAND

C SOLID-3000HASA LEFT-HANDEDCOORDINATESYSTEM:

C

C INSURENO OVERFLOWWHEN CONVERTINGFROMREAL*4TO 1"2:

IF (A .GT.32767.0)THEN

NORMS(I,1)= -32767

ELSE

NORMS(I,I)= -NINT(A)

END IF

C

IF (B .GT.32767.0)THEN

NORMS(2,1)= -32767

ELSE

NORMS(2,I) = -NINT(B)

END IF

C

IF (C .GT.32767.0)THEN

NORMS(3,1)= -32767

ELSE

NORMS(3,1)= -NINT(C)

END IF

C

C COPY FACE'SPOINTSTO XT(4,5)SO SENDB 2 SOLIDCAN GET THEM:

DO 12 J = 2, NPF + 1

JM1 = J - 1

INDEX= IF(J,I) + NG

XT(1,JMI)= XG(INDEX)

XT(2,JM1)= YG(INDEX)

XT(3,JH1) = ZG(INDEX)

12 CONTINUE

C

C GIVE FACE'SPOINTS& NORMALSTO SOLID-3000-

I2NPF= NPF

CALLSEND2 SOLID(I2NPF,XT, NORMS,IDASH )

END IF

- 145 -
ELSE

CSLDEND

NPF = IF(1,I)

C

C IGNOREPOINTOR LINEELEMENTS

IF (NPF.LT.3) GO TO 30

II = II+l

FACE(1,II)= NPF

IFC(II)= IPC

DO 20 J=2,NPF+I

FACE(J,II)= IF(J,I)+ NG

20 CONTINUE

C

C "CULL"THE BACK-FACESBY TAKINGDOT PRODUCTOF PLANE

C NORMALWITHVECTOR IN DIRECTIONOF OBSERVER

IF (BFCULL.EQ. 'Y') THEN

C

C COMPUTETHE PLANEEQUATIONOF THE GIVENFACE

CALL PLANEQ(II,A,B,C,D)

DOTPR= A*OX+ B*OY+ C*OZ

IF (DOTPR.LE.0.0) THEN

PFLAG(II)= .FALSE.

II = II-1

END IF

END IF

CSLD:

END IF

CSLDEND

30 CONTINUE

C

C UPDATENODEAND FACECOUNTERS

NG = NG+NN

NF = II

C

999 CONTINUE

C

RETURN

END

- 146 -
APPENDIXI

REFERENCES

1. Randall,D. P., K. H. Jones,et. al., "SMP- A SolidModeling

Program."NASACR 172473,November1984.

2. Anon.,RDS 3000User'sGuide.ADAGE,Inc.,No. 10-301-095-10A,

Billerica,Massachusetts.March1982.

3. Anon.,BPS 32 ProgrammingGuide.ADAGE,Inc.,Billerica,

Massachusetts,July 1982.

4. Anon., SOLID 3000 Users' Guide. ADAGE, Inc., No. 104174, Rev. C.

Billerica,Massachusetts,August 1985.

5. Anon.,IDL2ReferenceManual.ADAGE,Inc.Billerica,

Massachusetts,March1983.

6. Foley,J. D. and A. VanDam:Fundamentalsof InteractiveComputer

Graphics.Addison-WesleyPublishingCompany,Reading,

Massachusetts,1983.

General

7. Schumacker,R. A. et. al., "Studyfor ApplyingComputer-generated

Images to Visual Simulation."AFHRL-TR-69-14,U.S. Air Force

Human ResourcesLaboratory,September1969.

- 147 -
REFERENCES

(Concluded)

8. Newman,W. M. and R. F. Sproull:Principlesof Interactive

ComputerGraphics.McGraw-HillBookCompany,New York,1973.

9. Anon., VAX-11 FORTRAN LanguageReferenceManual. Digital Equipment CorporationOrder No. AA-DO34C-TE.April 1982.

10. Anon.,VAX-11FORTRANUsersGuide.DigitalEquipmentCorporation

OrderNo.AA-DO35C-TE.April1982.

11. Anon.,VAX-11LinkerReferenceManual.DigitalEquipmentCorporation

OrderNo. AA-DO19C-TE.May 1982.

- 148-
m

Standard Bibliographic Page

I.NAsAReportcR78065 _INO. 2. GovernmentA_:cessiNoon. 3. Recipient'Catal s ogNo.

4.TitlandSubt e iDispla tle y System Softwarefor the Integration5."ReportDate

of an ADAGE3000 Programmable Display Generator into March 1986

the Sol id Model ing Package C.A.D. Software 6 PerformingOrganizationCode

7. Author(s) 8. Performing Organization Report No.

R. J. Montoya and H. H. Lane, Jr. RTI/3052/OO-OIF

9. Performing Organization Name and Address 10. Work Unit No.

Research Triangle InstituiEe

P.O. Box 12194 11.ContraorcGrant t No.

Research Triangle Park, NC 27709 NASI-17890

12. Sponsoring Agency Name and Address 13. "l_]peof Report and Period Covered

Contractor Report _//21//84

National Aeronauti cs and Space Admini strati on 14.SponsoringAgencyCode

Washington, D.C. 20546

15.SupplementaryNotes

Langley Technical Monitor: Dariene D. DeRyder

16"Rb_6_ware system that integrates an ADAGE3000 Programmable Display Generator

into a C.A.D. software package known as the Solid Modeling Program is described.

The software system was designed, implemented, and tested at the Research Triangle

Institute and later installed and demonstrated at the Systems and Analysis

Branch's display system laboratory.

The Solid Modeling Program (SMP) is an interactive program that is used to model

complex solid object through the composition of primitive geometric entities. In

addition, SMPprovides extensive facilities for model editing and display. SMP

was developed at LaRC by Computer Sciences Corporation.

The ADAGE3000 Programmable Display Generator (PDG) is a color, raster scan,

programmable display generator with a 32-bit bit-slice, bipolar microprocessor

(BPS). The modularity of the system architecture and the Width and speed of the

system bus allow for additional co-processors in the system. These co-processors

combine to provide efficient operations on and rendering of graphics entities.

The resulting software system takes advantage of the graphics capabilities of

the PDGin the operation of SMPby distributing its processing modules between the

host and the PDG. Initially, the target host computer was a PRIME850, which was

later substituted with a VAX-I1/785. Two versions of the software system were

developed, a phase I and a phase II. In phase I, the ADAGE3000 is used as a

frame buffer. In phase II, SMPwas functionally partitioned and some of its

functions were implemented in the ADAGE3000 by means of ADAGE's SOLID 3000

_nffwarp package.

£7:key Wo_s(Suggestedby Authors(s)) i8. DistributionStatement

Interactive graphics, computer aided

design, solid modeling, distributed soft- Unclassified - Unlimited

ware system, programmable display generator, shading models

19.UnclassifiedSClassi ecurfit.(of y this report) 120.UncedSe)ascsuClassif.(o irfity i f this page) 21.. No.159oPaf ges 22. Price

For sale by the National Technical Information Service, Springfield, Virginia 22161

NASA Langley Form 63 (June 1985)

- 149 -

- . . . , , :. . .