Home

Three-dimensional computer graphics visualization of target detection

image

Contents

1. ake ae ak ake ae ak ake ak ake ake ake ake ake ak ake ak ake void drawCharstring GLuint base char s Save the List Base Setting glPushAttrib GL LIST Specify the display list base for CallLists glListBase base Draw the chars giCallLists strlen s UNSIGNED BYTE unsigned char s Restore the List Base setting glPopAttrib 143 oj oe ke ok oe oe ok oe ae ke ok eoe e ehe oj afe ke oe dee de ke oe oj oe ke ok joke oj ok This is file NPSimage C This file contains the methods that implement the NPSimage class include NPSimage h include lt string h gt include lt iostream h gt Get the I O stuff include GL gl h Get the SGI routines include lt GL glu h gt include image h SGI image structures External def for SGI image routines extern C IMAGE iopen const char filename char access extern C void getrow IMAGE image unsigned short buf int y int z extern C void putrow IMAGE image unsigned short buf int y int z extern C void iclose IMAGE temp arrays to hold scratch info for processing an sgi image RGBA order for the indices unsigned short buf 4 4096 Here is a constructor with no specs NPSimage NPSimage i If an NPSimage is previously defined de
2. 12 b 13 et iis 13 JADpDIVITIg _ hanes 13 ill PROBLEM d uode ene ees 15 A DEFINITION OF THE PROBLEM 15 B ASSUMPTIONS e a e 15 IVs DESIGN ccd drip 17 A SELECTION OF WORKING ENVIRONMENT 17 T incer comp 17 2 Hawa andare ut mu 17 B SENSOR DESIGN AND STRUCTURE 18 1 Infrared Sensor Design 18 2 Infrared Data Structure 19 TV SensorDesign 20 C VISUALIZATION DESIGN d MI PE 20 V THE PROGRAM _ 2 2 ae Sci ah EROR e re 23 Vi ACKNOWLEDGMENT We would like to thank Prof Chris Olsen for his constructive and supportive guidance during our work Also we would like to thank Prof Dave Pratt for his un limited consultation Finally thanks to Prof A Cooper for his consultation and for his generosity in providing resources during our research vii I INTRODUCTION A A BRIEF DESCRIPTION OF OUR WORK Visual effects have increased in importance in the last decade in both program ming and interacti
3. ak ske void create target screen widgets Widget parent Widget pulldown Pulldown widget option Cascade for the pulldown XmString label string String Arg wargs 10 Same old args stuff This the rowcolumn that holds Target puldown widgets under it 0 XtSetArg wargs n XmNtopAttachment XmATTACH FORM XtSetArg wargs n XmNleftAttachment XnATTACH FORM n XtSetArg wargs n XmNrightAttachment XnATTACH FORM XtSetArg wargs n XmNorientation XnHORIZONTAL XtSetArg wargs n XmNnumColumns 1 n XtSetArg wargs n XmNpacking XmPACK TIGHT Widget TargetRowColumn XmCreateRowColumn parent TargetRowColumn wargs n XtManageChild TargetRowColumnl Add a pulldown to the RowColumn n 0 pulldown XmCreatePulldownMenu TargetRowColumnl pulldown wargs Add the entries to the pulldown make pulldown entry pulldown TANK targetCB XtPointer amp TANK make pulldown entry pulldown TRUCK targetCB XtPointer amp TRUCK make pulldown entry pulldown SHIP targetCB XtPointer amp SHIP make pulldown entry pulldown targetCB XtPointer amp make pulldown entry pulldown BUILDING targetCB XtPointer amp HOUSE make pulldown entry pulldown AIRCRAFT targetCB XtPointer amp PLANE Create the option menu that has the pulldown und
4. 25 AA 59 OES LZ 22252 2 255255255552 Figure 19 The Screen Output Of The User Interface 4 5455256 5 LE 556 SLES v A 277 IS UN 9 lt de meni d OK re 5502 i lt gt 2 The IR Screen Output Of The Tank Target Figure 20 24 H 5 aN D I UIN AAS ANONN S N Figure 21 The IR Screen Output Of The Ship Target DAN lt Figure 22 The IR Screen Output Of The Aircraft Target INS 25 226 gt Figure 23 The IR Screen Output Of The Building Target VAN MATE 29 252 2 EIST j Ra pee pet nene Dit ap ANE SERA DAL AREAS APA ED NNER OMIM prim MM Aui eae fj NS aa Net PAPAE LI 7 P fos S a ANAON Figure 24 The TV Screen Output Of The Tank Target M ARRA VP AR PN NS AVIS EM gt NEE 2 MP E 1 E Acn ttt Pt PARTY gt 8 5 4
5. XtSetArg wargs n XmNorientation XmVERTICAL Widget rc3 XmCreateRowColumn parent degree wargs n XtManageChild rc3 Create the bulletin board widget for Exit push button n 0 BboardForExit XmCreateBulletinBoard rc3 BboardForExit wargs n XtManageChild BboardForExit Now add an Exit PushButton label string XmStringCreateLtoR EXIT charset 0 XtSetArg wargs n XmNalignment XmALIGNMENT CENTER XtSetArg wargs n XmNlabelString label string button XmCreatePushButton BboardForExit exit wargs n XtManageChild button XmStringFree label_string Now add an Exit callback for the PushButton XtAddCallback button XmNarmCallback quitCB XtPointer NULL End of the create the scales 101 This initial calback where it iscalled when the program reaches the definition of the glw display widget What this callback does is it initializes the window routines display lists for texturing and the cube which is used for sky polygons It also loads the initial values of some user defined variables ak ok e de ke ke ke ak a afe ie ak ake ae static void initCB Widget w XtPointer XtPointer call da
6. 5 31 E gt j be d vC M PP t vn pad Md bes a E e pma re acram nmn gt a eR CAT ERE eem pn yn mm A mmn ass ttt od 4 atributi on f M MEE M wu B n 42 LAN Aiar ama ea cate netos Aliis MUN UE E vend 17 2 amp fur d ABSTRACT The purpose of this thesis is to visualize the sensor performance for a generic missile We simulate the processes performed by a missile using IR or TV sensors Two generic scenes background were created one for each generic sensor The program simulates the scene from the point of view of a missile sensor graphical user interface was included for user input These inputs provide the initial environmental conditions and the structural specifications of the sensor and the targets Depending on these inputs the sensor will show a detection and a lock on range to the user The detection range for the IR sensor was based on the intensity of the signal above a specific threshold For the TV system target contrast was used Atmospheric extinction was included Several aspects of the SGI hardware and software capability were used to mimic physical problems and processes at considerable savings in computational effort One was the use
7. i cout lt lt I can t open lt lt InputFile lt lt File lt lt return 0 j Since this function is called when a target is initialized find the mu value according to either default or sellected values of firin angle mu Calculate Extinction while from eof i from gt gt Vertice from gt gt Vertex x from gt gt Vertex from gt gt Vertex z from gt gt Temp from getline buffer size n Go to next line Temp Temp Original Temp Vertice 0 Temp Vertex Vertice no 0 Vertex Vertex Vertice 1 Vertex Vertex Vertice no 2 Vertex z We read the temperature values then calculate theradiance of the target for this temperature value assuming the target is a black body radiator 115 kt Boltzman Constant Temp total radiance Find Total Radiance Temp Now with this radiance and mu extinction coef find the equilant temp on the sensor This function applies necessary extinction to the signal and after finding the new level of the signal it transforms it to temperature value again This calculated temp is loaded to the current temp array Temp Temp At Sensor total radiance mu Temperature Vertice no 0 Temp Here the temperature values transformed to the equilant color values and color array is loaded Fill Up Color Table Vertice no MODE end while from close return 1
8. void create_background_screen_widgets Widget parent Widget rowcolumn button XmString label string Arg wargs 10 Same old args stuff This the form that holds Background puldown widgets under it 0 XtSetArg wargsI n XmNfractionBase 40 XtSetArg wargs n XmNtopAttachment XmATTACH FORM XtSetArg wargs n XmNbottomAttachment XmATTACH POSITION XtSetArg wargs n XmNleftAttachment XmATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH POSITION XtSetArg wargs n XmNrightPosition 15 n XtSetArg wargs n XmNbottomPosition 30 Widget Backgroundform1 XmCreateForm parent Backgroundform1 wargs n XtManageChild Backgroundform1 This the rowcolumn that holds Pull down Menu widget under it 0 XtSetArg wargs n XmNtopAttachment XmATTACH POSITION XtSetArg wargs n XmNleftAttachment XnATTACH POSITION XtSetArg wargs n XmNtopPosition 20 n XtSetArg wargs n XmNleftPosition 5 XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNnumColumns 1 XtSetArg wargs n XmNpacking XmPACK TIGHT Widget BackgroundRowColumnl XmCreateRowColumn Backgroundform1 BackgroundRowColumn1 wargs Add another pulldown to the RowColumn for object selection n 0 Widget pulldown XmCreatePulldownMenu BackgroundRowColumnl pulldown2 wargs n Add the entries to the pulldow
9. READ ONES 1 else It means this screen reading is at least second reading RED gt 55 0 55 is our treshhold value for red pixels It is approximately equial to 0 2 red value of the pixel where 1 0 being the max ifMAX X OLD MAX X amp amp MAX OLD MAX Y Print Lock On 400 150 j X lt 1000 amp amp MAX Y lt 1000 We are inside the display screen i draw a rectangle int avarage red datas INDEX FOR MAX int avarage red datas J NDEX FOR MAX REDJ 2 750 End of if MAX RED gt 55 0 Y End of else Y End of else Here we draw the color scale in two dimensional screen if MODE SYCLIC SCALE DrawTheSyclicColorScale else DrawTheColorScale MODE Print_Numbers_On_Color_Scale 128 of Call IR Functions This function is called from draw the scene function if the sensor is IR type void Call TV Functions ifTfGEARCHED ONES Then the box we are drawing to simulate the scanning doesn t completly scanned the whole display screen So go ahead and update the position of the box for the next frame draw a rectangleeROW COLOMN Update ROW COLOMN ROW COLOMN End of if SEARCHED ONES else Yes we completed scanning the sceene ifREAD ONES Then w
10. we do not return FALSE the work procedure will stop calling this function return FALSE 109 ok ak ak ke ae ak ak e ake ake draw the scene This function draws the picture k ok sje a ok ae fe E EE E E E E ake a E E ok a E E sje ok ofc ake a E ook ok ae a ae ie void draw_the_scene i Turn on z buffering glEnable GL DEPTH TEST Set the background color to cyan RGBA and clear the z buffer glCiearColor 0 25 0 0 1 0 1 0 glClear GL DEPTH BUFFER GL COLOR BUFFER Set the projection matrix The near and far values are distances from the viewer to the near 1 0 and far 10000 0 clipping planes glMatrixMode GL PROJECTION glLoadlIdentity gluPerspective 45 0 1 25 1 0 18000 0 Load the ModelView matrix with a unit matrix giMatrixMode GL_MODELVIEW glLoadIdentity if SENSOR Turn on the Light Model turnOnTheLightModel Turn on the Lights turnOnTheLights Q Enable the fog for the target EnableFog density Here we check the position of the viewer load the viewpoint We are at the viewpoint and looking towards the reference point of the object Up vector is the vector orienting our view volume around the line of sight gluLookAt Viewpoint 0 Viewpoint 1
11. BackgroundRC6 XmNorientation XmHORIZONTAL NULL This is the Hour label gadget XtVaCreateManagedWidget Hour xmLabelGadgetClass BackgroundRC6 XmNorientation XmHORIZONTAL NULL This is the label widget which holds the hourlabel TimeLabelHour XtVaCreateManagedWidget TimeLabelHour xmLabelGadgetClass BackgroundRC6 XtVaTypedArg XmNlabelString XmRString 1 2 XmNuserData amp Time of day NULL Here we create an arrow to increment the hour Widget HourUpArrow XtVaCreateManaged Widget HourUpArrow xmArrowButtonGadgetClass BackgroundRC6 XmNarrowDirection XmARROW UP NULL Add the callback for Up Arrow XtAddCallback HourUpArrow XmNarmCallback ChangeTimeHourCB XtPointer 1 Here we create an arrow to decrement the hour Widget HourDownArrow XtVaCreateManagedWidget HourDownArrow xmArrowButtonGadgetClass BackgroundRC6 XmNarrowDirection XmARROW_DOWN NULL Add the callback for Down Arrow XtAddCallback HourDownArrow XmNarmCallback ChangeTimeHourCB XtPointer 1 This is the Month label gadget XtVaCreateManagedWidget Month xmLabelGadgetClass BackgroundRC6 XmNorientation XMHORIZONTAL NULL This is the label widget which holds the Month label TimeLabelMonth XtVaCreateManaged Widget TimeLabelMonth xmLabelGadgetClass BackgroundRC6 83 XtVaTypedArg XmNlabelString XmRString 1 2 AmNuserData amp Time of day NULL Here we create an
12. 55 amp amp App Angle gt 50 return 0 1251 if App Angle lt 50 amp amp App Angle gt 45 return 0 1239 if App Angle lt 45 amp amp App Angle gt 40 return 0 1217 if App Angle lt 40 amp amp App Angle gt 35 return 0 1068 if App Angle lt 35 amp amp App Angle gt 30 return 0 0960 if App Angle lt 30 amp amp App Angle gt 25 return 0 0877 if App Angle lt 25 amp amp App Angle gt 20 return 0 0816 if App Angle lt 20 amp amp App Angle gt 15 return 0 0739 if App Angle lt 15 amp amp App Angle gt 10 return 0 0739 if App Angle lt 10 amp amp App Angle 5 return 0 0716 116 if App Angle lt 5 amp amp App Angle gt 0 return 0 0703 if App Angle 0 return 0 0703 ehe ke ke ok IOI IO ake ake ae ake ae aR This function finds the temperature equilant color for three different coloring schemes and loads the color array ok a ke je oe ok ke ke afe ok oj oj oe ake ke ok ok je ake ke ke ke afe ale ake ae int Fill Up Color Table int Vertice COLOR MODE double red if Temperature Vertice no 0 lt 10 Dark Blue i red 0 0 if COLOR MODE SYCLIC SCALE Color Array With Given Mode Vertice no COLOR MODE red else 4 Color Vertice no 0 0 0 Color Vertice no 1 0 0 C
13. For buildings PARKED 71 For Aircraft These variables are used to control loop control variables upper limit which is different for different targets int Tank Index 1384 5 Airplane Index 208 Ship Index 629 Building Index 38 VERTICE NUM Index Default value for num of vertices endif 162 Sk ke ke se se ake oe oe oe se se oe oe oe ok oe oe ok ake ahe ale afe afe afe ske This is eotda globals h file Here all necessary global variables and constants are defined which could be refered in all C files x Authors Ltjg Mustafa YILMAZ Ltjg Mehmet GORGULU x oe ke ifndef COMMON __ define COMMON _ extern endif COMMON _ float Vertex 2500 3 Array to hold the coordinates Color 2500 4 Array to hold RGBAlpha values Normal 2500 3 Array to hold Normal array values Temperature 2500 1 Array to hold Temperature for each veretex Original Temp 2500 1 Array to hold initial temp Viewpoint 3 x y z coordinates for viewer Refpoint 3 x y z coordinates for the point looked towards avarage red datas 110 3 GroundColor 4 _ COMMON GLuint Index BACKGROUND MOUNTAIN CLOUDS CUBE COMMON _ int SENSOR 39 Default sensor is IR IR 39 define TV 40 de
14. Institutional Archive of the Naval Postgraduate School Gorgulu M ehmet Y Mustafa Three di mensi onal computer graphics visualization of target detection Monterey Califomia Naval Postgraduate School http hdl handle net 10945 42804 This document was downloaded on May 04 2015 at 22 50 06 14 DUDLEY Calhoun is a project of the Dudley Knox Library at NPS furthering the precepts and FW Eoals of open government and government transparency All information contained WW KN OX herein has been approved for release by the NPS Public Affairs Officer im PRAESTANTIA PER SCIEN LIBRARY Dudley Knox Library Naval Postgraduate School em ny 411 Dyer Road 1 University Circle V Monterey California USA 93943 http www nps edu library http www nps edu NAVAL POSTGRADUATE SCHOOL Monterey California di A v EUREN d 27 7 e E PL MENS THESIS THREE DIMENSIONAL COMPUTER GRAPHICS VISUALIZATION OF TARGET DETECTION by Mehmet Gorgulu Mustafa Yilmaz December 1994 Thesis Advisor Richard Chris Olsen Co Advisor David R Pratt Approved for public release distribution is unlimited cec mh 3 i emmen oa C 442 00 h 0 nc LL LL emnes cr FONTE 7 YE REPORT DOCUMENTATION PAGE Form Approved OMB No 0704 Public reporting burden for this collectio
15. Viewpoint 2 View point Refpoint 0 Refpoint 1 Refpoint 2 Ref point point we are looking towards 0 0 1 0 0 0 Up vector 110 Concatenate onto the Model View matrix the results of our accumulative transformations The coordinate passed in is the point about which we would like our operations rotations scales to occur Think of this point as the center of the displayed object concatenate_accumulative_matrices 0 0 0 0 0 0 First draw the target That is the nearest object to the user drawTarget Target 0 0 2 0 0 0 if SENSOR TV Draw the target shadow drawTargetShadow Target 0 0 2 0 0 0 Turn on texturing glEnable GL_TEXTURE_2D Here we are drawing the ground and calling the ground texturing glCallList BACK GROUND drawGround 0 0 2 0 0 0 BACK GROUND MODE Here we are drawing the mountains and calling the mountain texturing gICallList MOUNTAIN DrawTheMoutains MODE Call the display list for clouds texture and Cube glCallList CLOUDS glCallList CUBE Here we draw the sun The position of the sun is time dependent DrawTheSun HOUR if SENSOR TV Turn off everything being turned on Save energy glDisable GL TEXTURE 2D DisableFog turnOffTheLights turnOffTheLightModel Call TV Functions Y End of if TV 111 if SENSOR IR Call IR Functions Swap the buffers as
16. amp TANK make pulldown entry pulldown2 ALIMINIUM materialCB XtPointer amp TANK make pulldown entry pulldown2 materialCB XtPointer amp TANK make pulldown entry pulldown2 COMPOSITE materialCB XtPointer amp TANK Create the option menu that has the pulldown under it label string XmStringCreateSimple MATERIAL n 0 XtSetArg wargs n XmNlabelString label_string n XtSetArg wargs n XmNsubMenuld pulldown2 Widget option2 XmCreateOptionMenu TargetRowColumnl 1 optionMenu2 wargs n XtManageChild option2 Free the string XmStringFree label_string This the rowcolumn that holds TargetArea widget under it 0 XtSetArg wargs n XmNtopAttachment XnATTACH WIDGET XtSetArg wargs n XmNtopWidget TargetRowColumn1 1 XtSetArg wargs n XmNleftAttachment XnATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH FORM XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNnumColumns 1 n XtSetArg wargs n XmNpacking XmPACK TIGHT n Widget TargetRowColumn2 XmCreateRowColumn parent TargetRowColumn2 wargs 65 This 1s the Target area gadget XtVaCreateManagedWidget Target Area A x xmLabelGadgetClass TargetRowColumn2 XmNorientation XmHORIZONTAL NULL Create the text widget for the Target Area Widget TextWidgetl XtVaCreateManaged Widget TextWid
17. static GLfloat un 4 4 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 3 long ij GLfloat ptr Get a temp ptr Get a ptr to the start of m copy the matrix elements for i 0 i lt 4 i i 1 for j 0 j lt 4 1 ptr 113 j End oj unit A AE A A ke ok ke kk ok ok ak ak ke This function sets the initial viewing parameters void set initial viewing values Set the initial angles heading 0 0 pitch Firing Angle tz Firing Distance roll 0 0 This value is not used but saved for future implementations which can be modified in rotatezCB density 0 0 This value is used for fog implimentation Viewpoint 0 0 0 Viewpoint 1 0 0 Viewpoint 2 tz 5 We don t want get in the targets which is at the origin We are loo ing to the center Refpoint 0 0 0 Refpoint 1 0 0 Refpoint 2 0 0 j P kk ke ke o e ke ke o oe se coke ke ok e obe ke oh ke ke ke oe oe he he ke oe oe oj oe e oe ok ok oj ae ae ok This function sets the initial viewing parameters void load the viewpoint Viewpoint 0 0 0 Viewpoint 1 0 0 Viewpoint 2 tz 5 e ke ke o ok oj oe ke obe ode ke be he oe ake ae ke
18. 0 glptr width giptr gt height Set the initial viewing parameters set initial viewing values Load the default target arrays here FillInInitialTargetArrays TanklInitialFile dat Call the display list to form the texturing list CallDisplayListForTexturing Make a display List for Cube CallDisplayListForCube Load the default initial values to the variables MOUNTAIN Index 6 CLOUDS Index 5 BACKGROUND Index 3 Set the texture environment we want setGLTextureEnvironment Unmanage the info screen so it wnt be visiuble any more XtUnmanageChild info end of initCB 103 exposeCB This routine is called whenever the window ts uncovered 3 ake ke ake ke ook ok ok ook ke ke ai 3 static void exposeCB Widget w XtPointer XtPointer Set the window into which GL drawing should be done GLwDrawingAreaMakeCurrent w glx context ifDISPLAY ENABLED draw the scene 3 otherwise we in the input screen so don t spent time by calling display window resizeCB This routine is called whenever the window is moved or resized kk ke ke ke ke oe oe oc afe ok ke je ok oj oj oe ee ae a static void resi
19. Authors Ltjg Mustafa YILMAZ Ltjg Mehmet GORGULU X ahe ake afk ake afe afe ae ake ahe afe ake ale ake ae ake ake ake ifndef_EOTDA_GLOBALS__ define EOTDA GLOBALS Jaaa aoaaa oook kkk kk kkk Global widgets definitions kc ke je le k ak ak ak ak fe le oe ak ae ok je e ae je a de ake a ake ke ake oc oe ke ake ake ke afe ke afe afe ahe ale ake afe Widget toplevel MainWindow InputWindow 0 DisplayWindow 0 Control Window DisplayButton bulletin board bulletin board2 bulletin board3 bulletin board4 The top level shell widget The topmost container widget excluding the shell This type of widget is used as a container for a collection of widgets that dynamically resize together This is the main widget that we use for input window This is the main widget that we use for display window BboardForExit BboardForReset Bulleten boards for reset and exit buttons BboardForInput B B for InputScreen button MainDisplayFrame Freame that holds the DisplayWindow frame Frame widget attached to Form widget framel frame2 frame3 frame4 Frame widget attached to bulletin board widgets glw The GL widget that we use to draw into info scalel scale2 scale3 scale4 Scale widget controls Form widget for the toggle controls
20. Color Vertice 2 0 5 Color Vertice no 3 1 0 return 1 if Temperature Vertice no 0 gt 50 amp amp Temperature Vertice no 0 lt 55 Fading Red red 9 0 16 0 119 if COLOR MODE SYCLIC SCALE Modify Color Array With A Given Mode Vertice no COLOR MODE red else Color Vertice 0 0 5625 Color Vertice 1 0 1568 Color Vertice no 2 0 5607 Color Vertice no 3 1 0 return 1 j if Temperature Vertice no 0 gt 55 amp amp Temperature Vertice no 0 lt 60 Purple red 10 0 16 0 if COLOR MODE SYCLIC SCALE Color Array With A Given Mode Vertice no COLOR MODE red else Color Vertice no 0 0 6250 Color Vertice_no 1 0 0 Color Vertice no 2 1 0 Color Vertice no 3 1 0 return 1 if Temperature Vertice no 0 gt 60 amp amp Temperature Vertice 0 lt 65 Dark Gold i red 11 0 16 0 if COLOR MODE SYCLIC SCALE Modify Color Array With A Given Mode Vertice no COLOR MODE red else i Color Vertice 0 0 6875 Color Vertice 1 0 8156 Color Vertice 2 0 0 Color Vertice 3 1 0 j return 1 if Temperature Vertice no 0 gt 65 amp amp Temperature Vertice no 0 lt 70 Dirty Red red 12 0 16 0 if COLOR MODE SYCLIC SCALE Modify Color Array With A Given Mode Vertice no COLOR MODE else Color Vertice no 0 0 75 Color Ver
21. Ref 3 In our work we applied diffused and specular reflection rules to the targets in the TV part d Applying Fog Fog is a natural phenomenon and it affects the propagation of waves and the energy in nature It works as an absorbent in the atmosphere Even though we do not have the absorption models in our program we simulated this natural effect in our program OpenGL provides a fog function In our program we determined the fog coefficient as a variable and the user can control the density of the fog by using a slider in the TV visible mode Ref 10 13 PROBLEM A DEFINITION OF THE PROBLEM The problem being approached here is two fold We have a sensor detection problem and a visualization task There are two sensors with different detection algorithms As illustrated in Figure 11 for both the IR and TV sensor codes there is a tar get a transmission medium and a sensor For our program we implemented four tar gets a tank an aircraft a ship and a building This implementation can be broadened by creating more target files and making the necessary changes both in the interface and in the related programming routines The detection algorithms utilize emission and reflections for the IR and TV sensors respectively In each case we model the effect of sensor field of view sensi tivity and spectral range Depending on their design properties and the ambient ef fects these sensors have different detec
22. TV sensors generate electrical pulses which represent light intensities present in the optical image focused on the tube The light intensities luminance are called gray level of the targets The difference between the gray levels of a target 15 called contrast In nature how we recognize objects is by detecting the contrast between the object and its background So we used the same idea in our TV detection algorithm This idea is similar to IR detection too We used fog feature to emulate the atmos pheric extinction because we were not using false color graphics implementation used for the IR sensor In the program the whole screen of the computer was scanned and the contrast difference between pixels was checked The area which gives the highest contrast difference was accepted to be the possible target C VISUALIZATION DESIGN The user interface in our program has two purposes To control the input for the program To test performance for different sensors whose parameters are different from each other There are a lot of parameters that control the infrared signature of the targets These parameters are related with the temperature of the background temperature of the target atmospheric propagation conditions and the properties of the sensor These parameters are in the user interface The user can enter the data and measure the per formance depending on these parameters Inclusion of all of the programming rou tines th
23. The right button was pressed break default break end switch on which mouse button it was break case MotionNotify We have motion on the mouse We only get notified of motion when a mouse button is pressed break default break end of switch on event gt type end of inputCB PS A ak e ke ke ake afe ahe ae ake a ake ake ahe afe ake afe ae ake ake ak quitCB This function is called whenever the Quit menu option 15 selected static void quitCB Widget XtPointer XtPointer Bye bye XtCloseDisplay XtDisplay w exit 0 End of quitCB oe ok ke je a ke je koe kk ke ale afe afe ahe afe rotatexCB This function is called whenever the Top view scale is moved kc ke ke he ae he de ale de ake oj oe ke ake ke je ode je oe ake afe e ke ke ole oc afe ke afe oe oe ke ake ae ake ake sfe ake afe ake ale ake ake 3e 106 static void rotatexCB Widget XtPointer XtPointer call data float Temp mu total radiance Extincted temp XmScaleCallbackStruct call value XmScaleCallbackStruct call data pitch call value gt value Firing Angle pitch if SENSOR IR First Find the mu value mu Calculate Extinction Now modify the color table with previo
24. XmNleftAttachment XmATTACH POSITION XtSetArg wargs n XmNrightAttachment XmATTACH POSITION XtSetArg wargs n XmNbottomAttachment XnATTACH POSITION XtSetArg wargs n XmNtopPosition 4 XtSetArg wargs n XmNleftPosition 8 n XtSetArg wargs n XmNrightPosition 10 XtSetArg wargs n XmNbottomPosition 12 n XtSetArg wargs n XmNorientation XmHORIZONTAL n XtSetArg wargs n XmNnumColumns 1 n XtSetArg wargs n XmNpacking XmPACK TIGHT Widget BackgroundRC31 XmCreateRowColumn Backgroundform3 BackgroundRC31 wargs Add an Display PushButton label string XmStringCreateLtoR DISPLAY charset n 0 XtSetArg wargs n XmNalignment XnALIGNMENT CENTER XtSetArg wargs n XmNlabelString label string n DisplayButton XmCreatePushButton BackgroundRC31 Display wargs n Initial callback is finished so we can manage Display button so the user can use XtManageChild DisplayButton XmStringFree label string 79 Now add an Display callback for the PushButton XtAddCallback DisplayButton XmNarmCallback DisplayCB XtPointer NULL Now manage the parent RowColumn Widget XtManageChild BackgroundRC3 1 This the form for Background widgets n 0 XtSetArg wargs n XmNtopAttachment XnATTACH FORM XtSetArg wargs n XmNbottomAttachment XmATTACH POSITION n XtSetArg wargs n XmNleftAttachment XmATTACH P
25. gt month 1 if TIME gt month gt 31 TIME gt month 31 sprintf buf d TIME gt month XtVaSet Values TimeLabelMonth XtVaTypedArg XmNlabelString XmRString buf 2 NULL j ck ok koh kk kk kk joke jb ok OSE E E E GI This is the Change Time Year Callback kkk kkk kkk static void ChangeTimeYearCB Widget XtPointer user_data XtPointer int incr int user data timedata TIME char buf 8 XtVaGetValues TimeLabel Year XmNuserData amp TIME NULL TIME gt year incr if TIME gt year lt 1994 TIME gt year 1994 if TIME gt year gt 2100 TIME gt year 2100 sprintf buf 9od TIME year XtVaSetValues TimeLabelYear XtVaTypedArg XmwNlabelString XmRString buf 4 NULL 96 ak ak kak ak ake e e ae ak 3k ak ak CIO This is the Fog Density Callback The scale value is divided to 30000 to make the density smaller so the fog color doesn t cover the whole screen kc ok e ok ok k c ok kc ke ke ake ake ak 3e ake ake static void FogDensityCB Widget XtPointer XtPointer call data XmScaleCallbackStruct call value XmScaleCallbackStruct call data density call_ value gt value 30000 0 ae ae ae ake a a a a I i ia This is the IR
26. vided by three i e R G B 3 After finding the luminance values for each pixel in the scanning box on the screen we took the value of the lowest and highest luminance in the box By using the relation C GL GL we found the C contrast value for each scanner box Then this value is stored in the multi dimensional array for compari son with the other box areas on the screen The values in each cell of the array as shown in Figure 18 are the contrast val ues x coordinate and y coordinate of the scanner box We don t need the z coordinate because we read the pixels of the screen After storing all of the C con trast values for each box these values are compared with each other and the largest contrast value is found The x and y screen coordinates of the largest contrast box are accessible to us at any time so we can detect at which point there is possible detection and we can plot this area on the screen Another condition for the detection to occur is that the C value must be above a threshold level Having the same area as the highest contrast area for the second time results in lock on 29 E SOME OBSERVATIONS In Table 6 and Table 7 some observations of the program output are pre sented In Table 6 the detection range for the tank target is shown The distance val ues in the tables depend on the sensor characteristic and the environmental conditions In this table the only chancing value is the approach angle of
27. xmLabelGadgetClass SensorRowColumn5 XmNorientation XmHORIZONTAL NULL Create the text widget for the Optical Transmittance Widget TextWidget4 XtVaCreateManagedWidget TextWidget4 xmTextWidgetClass SensorRowColumn5 NULL Add Callbacks to the TextWidget4 widget XtAddCallback Text Widget4 XmN modify VerifyCallback OpticalTransmittanceCB NULL Now manage the parent RowColumn Widget XtManageChild SensorRowColumn5 This the rowcolumn that holds Band Width widget under it n 0 XtSetArg wargs n XmNtopAttachment XmATTACH_WIDGET XtSetArg wargs n XmNtopWidget SensorRowColumn5 XtSetArg wargs n XmNleftAttachment XmATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH FORM XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNnumColumns 1 XtSetArg wargs n XmNpacking XmPACK TIGHT Widget SensorRowColumn6 XmCreateRowColumn parent SensorRowColumn6 wargs n This is the Relative Aperture gadget XtVaCreateManagedWidget Eln Band Width xmLabelGadgetClass SensorRowColumn6 XmNorientation XmHORIZONTAL NULL Create the text widget for the Eln Band Width Widget TextWidget5 XtVaCreateManagedWidget TextWidget5 xmTextWidgetClass SensorRowColumn6 NULL Add Callbacks to the TextWidget5 widget XtAddCallback TextWidgetS XmNmodify VerifyCallback ElectronicBandwidthCB NULL Now manage the parent R
28. 0 Integral Constant 1 1916 pow 1 0 16 0 define PT 100 define STROKE 101 define END 102 ee k ske oe eoe je oe ke ke oe de ke ok oe fe ok je oj ke ok oe oe he ae ke ke ae oe ke ke sk ae sfe afe afe afe ale ake afe ae ake ake ake akae CLASS DEFINITIONS ok ok e ale oe je je afe ke ale ok ale oe ake class winddata public int value 4 int direction 160 class timedata public int hour int month int year typedef struct charpoint 4 GLfloat x y int type 3 VARIABLES oe ak fc ok ok le a oe ko ok ak ok ole ae fe int n i Used to specify number of args static float tz translation on in the z direction static float pitch rotation on in the x direction static float heading rotation on in the y direction static float roll rotation on in the z direction static float density used for fog density static float values 27 4 0 0 This array is keeping the red color values for each box which is 100 by 100 pixel float MAX RED 0 0 Max Contrast Of Scene 0 0 int MAX X 0 Y 0 Max Contrast X Max Contrast Y ROW 0 COLOMN 900 OLD MAX X 1 OLD MAX Y INDEX FOR MAX RED
29. 039216 0 078431 0 039216 GLfloat t72_3mat0_diffuse 0 196078 0 392157 0 196078 GLfloat t72_3mat0_specular 0 000000 0 000000 0 000000 GLfloat t72_3mat0_shininess 0 000000 Make the brass material calls 139 makeGLMaterialCalls whichFace t72 3mat0 ambient 172 3mat0 diffuse 172 3matO0 specular 472 3matO shininess j break case 72 3matl 4 GLfloat t72 3matl ambient 0 039216 0 094118 0 039216 GLfloat t72 3matl diffuse 0 196078 0 470588 0 196078 GLfloat 172 3mat1 specular 0 000000 0 000000 0 000000 GLfloat 172 3matl shininess 0 000000 3 Make the brass material calls makeGLMaterialCalls whichFace t72 3mati ambient t72 3mat l diffuse 172 3matl specular 72 3matl shininess break case 72 2 GLfloat 72 3mat2 ambient 0 039216 0 062745 0 039216 GLfloat t72 3mat2 diffuse 0 196078 0 313725 0 196078 GLfloat t72 3mat2 specular 0 000000 0 000000 0 000000 GLfloat t72_3mat2_shininess 0 000000 3 Make the brass material calls makeGLMaterialCalls whichFace t72_3mat2_ambient t72_3mat2_diffuse t72_3mat2_specular 472 2 55 j break case t72 3mat3 i GLfloat t72 3mat3 ambient 0 039216 0 070588 0 039216 GLfloat 172 3mat3 diffuse 0 196078 0 352941 0 1960783 GLfloat 172 3mat3 specular 0 000000 0 000000 0 000000 GLfloat t72 3mat3 shininess 0 000000 Ma
30. 775 0 63 0 0 0 drawCharstring fontHandle2 70 glRasterPos3f 825 0 63 0 0 0 drawCharstring fontHandle2 75 glRasterPos3f 875 0 63 0 0 0 drawCharstring fontHandle2 80 glRasterPos3f 925 0 63 0 0 0 drawCharstring fontHandle2 85 glRasterPos3f 975 0 63 0 0 0 drawCharstring fontHandle2 90 glMatrixMode GL_MODELVIEW glPopMatrix glMatrixMode GL_PROJECTION glPopMatrix 126 s eee ek ke ke ke ke ke ok ok kc kc kc ok ale ake oco s afe 34e ake ke ake ke oe ake ake ae afe eK fe This function finds the total radiance for a given temperature xk kc ok ke ok ae ae ake afe afe ake oe ake ale ake afk ke koe afe afe ke ok afe afe ke afe ale ahe ahe a afe ale ake ake aie ake afe ak float Find Total Radiance float Temp 1 float total radiance 0 0 e 1 0 total radiance e sigma Temp Temp Temp Temp return total radiance j ake afe oko oe ake ke a ahe ake afe ake This function apply the atmospheric extinction to the signal and finds the equilant temp value at the sensor ake ake ake afe float Temp At Sensor float total radiance float mu i float pas Temp Firing Distance 100 e 1 0 pas total radiance PI exp mu R Tempesqrt sqrt pas e si
31. CODE 12a DISTRIBUTION AVAILABILITY STATEMENT Approved for public release distribution unlimited 13 ABSTRACT The purpose of this thesis is to visualize the sensor performance for a generic missile We simulate the proceses performed by a missile using IR or TV sensors Two generic scenes background were created one for each generic sensor The program simulates the scene from the point of view of a missile sensor graphical user interface was included for user input These inputs provide the initial environmental conditions and the structural specifications of the sensor and the targets Depending on these inputs the sensor will show a detection and a lock on range to the user The detection range for the IR sensor was based on the intensity of the signal above a specific threshold For the TV system target contrast was used Atmospheric extinction was included Several aspects of the SGI hardware and software capability were used to mimic physical problems and processes at considerable savings in computational effort One was the use of the SGI Gouraud shading capability to establish the temperature distribution for IR targets a second was use of the hardware screen projection to map from 3 D to 2 D For further work this program can be integrated to the EOTDA Electro optical Tactical Decision Aid software The graphics part of the program was written by using OpenGL graphics library and the user interface was implemented by usin
32. ON glPopAttrib glMatrixMode GL_MODELVIEW glPopMatrix glMatrixMode GL_PROJECTION glPopMatrix kk ek ke ke This function prints the temperature equilant values of the colors on each color box on bottom of the screen sk ok ok oj a ake ke ke ke ke ake ae ake ae afe ake ake ake afk void Print Numbers On Color Scale i glMatrixMode GL_PROJECTION glPushMatrix glLoadIdentity gluOrtho2D 0 0 1400 0 0 0 800 0 giMatrixMode GL MODELVIEW glPushMatrix glLoadldentity glColor3f 1 0 1 0 1 0 glRasterPos3f 175 0 63 0 0 0 drawCharstring fontHandle2 10 glRasterPos3f 225 0 63 0 0 0 drawCharstring fontHandle2 15 glRasterPos3f 275 0 63 0 0 0 drawCharstring fontHandle2 20 125 glRasterPos3f 325 0 63 0 0 0 drawCharstring fontHandle2 25 glRasterPos3f 375 0 63 0 0 0 drawCharstring fontHandle2 30 glRasterPos3f 425 0 63 0 0 0 drawCharstring fontHandle2 35 glRasterPos3f 475 0 63 0 0 0 drawCharstring fontHandle2 40 glRasterPos3f 525 0 63 0 0 0 drawCharstring fontHandle2 45 glRasterPos3f 575 0 63 0 0 0 drawCharstring fontHandle2 50 glRasterPos3f 625 0 63 0 0 0 drawCharstring fontHandle2 55 glRasterPos3f 675 0 63 0 0 0 drawCharstring fontHandle2 60 glRasterPos31 725 0 63 0 0 0 drawCharstring fontHandle2 65 glRasterPos3f
33. Scale Callback With the help of Mode variable the color that is going to loaded onto the targets are desided 2 of ole ke ae ke ae afe ake afe ale ake static void IR_ScaleCB Widget XtPointer user_data XtPointer int SCALE NO int user_data MODE IR SCALE NO 97 ok ke ok ok oko ok okc sje oke ke fe ok ok ak ak ok we Create The Scales for the display screen There are three scales created afe ake ao oe ak gt k void Create The Scales Widget parent i Widget pulldown Row coloumn widget Option button Arg wargs 16 Args used with XtSetArg below XmFontList fontlist Font List XmsString titleStringl for scales titleString2 titleString3 XFontStruct font Ptr to a font structure Xmstring label string Create a compound string for the scale title font XLoadQueryFont XtDisplay toplevel spc12x12c fontlist XmStringCreateFontList font charset titleString XmStringCreateLtoR Side View Angle charset titleString2 XmStringCreateLtoR Top View Angle charset titleString3 XmStringCreateLtoR Viewing Distance km charset Cre
34. WIDGET n XtSetArg wargs n XmNleftWidget bulletin_board1 XtSetArg wargs n XmNbottomAttachment XmATTACH_FORM XtSetArg wargs n XmNbottomOffset 2 bulletin board2 XmCreateBulletinBoard parent bulletin2 wargs n XtManageChild bulletin board2 Create a Frame widget 0 XtSetArg wargs n XmNshadowThickness 2 n XtSetArg wargs n XmNshadowType XmSHADOW IN frame2 XmCreateFrame bulletin board2 frame2 wargs XtManageChild frame2 Set up arglist and create the scale2 0 XtSetArg wargs n XmNfontList fontlist nt XtSetArg wargs n XmNshowValue True n XtSetArg wargs n XmNtitleString titleString2 n XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNmaximum 90 n XtSetArg wargs n XmNminimum 0 XtSetArg wargs n XmNprocessingDirection XmMAX ON RIGHT scale2 XmCreateScale frame2 scale2 wargs n XtManageChild scale2 Here we set the initial value of this scale since it is different than minvalue of ths scale XmScaleSetValue scale2 int Firing Angle Add the callbacks XtAddCallback scale2 XmNvalueChangedCallback rotatexCB XtPointer NULL XtAddCallback scale2 XmNdragCallback rotatexCB XtPointer NULL 99 Add a separator 0 XtSetArg wargs n XmNorientation XmVERTICAL sep XmCreateSeparator parent separator wargs
35. XmHORIZONTAL XtSetArg wargs n XmNn mColumns 1 n XtSetArg wargs n XmNpacking XmPACK TIGHT n Widget SensorRowColumn8 XmCreateRowColumn parent SensorRowColumn8s wargs n This is the Relative Aperture gadget XtVaCreateManagedWidget Detectivity xmLabelGadgetClass SensorRowColumn8 XmNorientation XmHORIZONTAL NULL Create the text widget for the Detectivity Widget TextWidget7 XtVaCreateManagedWidget TextWidget7 xmTextWidgetClass SensorRowColumn8 Add Callbacks to the TextWidget7 widget XtAddCallback TextWidget7 XmNmodify VerifyCallback DetectivityCB NULL Now manage the parent RowColumn Widget XtManageChild SensorRowColumn8 75 This the rowcolumn that holds Detector Elements widget under it 0 XtSetArg wargs n XmNtopAttachment XmATTACH WIDGET XtSetArg wargs n XmNtopWidget SensorRowColumn8 XtSetArg wargs n XmNleftAttachment XnATTACH FORM n XtSetArg wargs n XmNrightAttachment XnATTACH FORM XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNnumColumns 1 XtSetArg wargs n XmNpacking XmPACK TIGHT Widget SensorRowColumn9 XmCreateRowColumn parent SensorRowColumn wargs n This is the Relative Aperture gadget XtVaCreateManagedWidget Detector Elements xmLabelGadgetClass SensorRowColumn9 XmNorientation XmHORIZONTAL NULL Create the text widget
36. XtSetArg wargs n XmNpacking XmPACK TIGHT rc XmCreateRowColumn ControIWindow rowcol wargs n XtManageChild rc Call the function that creates the Scales under the bulletin board and manages them Create The Scales rc Create a GL widget amp initialize the z buffer XtSetArg wargs n GLwNdepthSize 1 n is essential to initialize the z buffer Without this line z buffering doesn t work and there will be no hidden surface elemination 60 0 XtSetArg wargs n GLwNdepthSize 1 glw GLwCreateMDrawingArea MainDisplayFrame glwidget wargs n XtManageChild glw Add callbacks to the glw widget XtAddCallback glw GLwNginitCallback initCB XtPointer NULL XtAddCallback glw GLwNexposeCallback exposeCB XtPointer NULL XtAddCallback glw GLwNresizeCallback resizeCB XtPointer NULL XtAddCallback glw GLwNinputCallback inputCB XtPointer NULL Add in the work procedure work procedure is called repeatedly whenever there no events to process workprocid XtAppAddWorkProc app context XtWorkProc drawWP XtPointer NULL Instantiate it now the toplevel container widget XtRealizeWidget toplevel Loop for events XtAppMainLoop app context 61 Here we create all the widgets for input screen and manage the parent InputWindow widget so that we will see this scree
37. arrow to increment the Month Widget MonthUpArrow XtVaCreateManagedWidget MonthUpA row xmArrowButtonGadgetClass BackgroundRC6 XmNarrowDirection XnARROW UP NULL Add the callback for Up Arrow XtAddCallback MonthUpArrow XmNarmCallback ChangeTimeMonthCB XtPointer 1 Here we create an arrow to deccrement theMonth Widget MonthDownArrow XtVaCreateManagedWidget MonthDownArrow xmArrowButtonGadgetClass BackgroundRC6 XmNarrowDirection XmARROW DOWN NULL Add the callback for Down Arrow XtAddCallback MonthDownArrow XmNarmCallback ChangeTimeMonthCB XtPointer 1 This is the Year label gadget XtVaCreateManagedWidget Year xmLabelGadgetClass BackgroundRC6 XmNorientation XmHORIZONTAL NULL This is the label widget which holds the wind speed and it is modified when the wind speed is changed TimeLabelY ear XtVaCreateManaged Widget TimeLabel Year xmLabelGadgetClass BackgroundRC6 XtVaTypedArg XmNlabelString XmRString 1994 4 XmNuserData amp Time of day NULL Here we create an arrow to increment the wind velocity Widget YearUpArrow XtVaCreateManagedWidget YearUpArrow xmArrowButtonGadgetClass BackgroundRC6 XmNarrowDirection XmARROW_UP NULL Add the callback for Up Arrow XtAddCallback YearUpArrow XmNarmCallback ChangeTimeYearCB XtPointer 1 Here we create an arrow to deccrement the Month Widget YearDownArrow XtVaCreateManaged Widget MonthDownArrow
38. factors that affect the transmission of atmosphere For our program we ignored scattering and the molecular absorption both for simplicity and lack of real data To get the atmospheric coefficient we ran Lowtran in 8 12 um frequency band and got extinction coefficient values which are changing from 0 0703 to 1 166 The TV sensor is affected by the same underlying rules TV systems work in the visible part of the electro magnetic spectrum as seen in Figure 5 5 Lowtran Lowtran is FORTRAN Computer code designed to calculate atmospheric transmittance and radiance averaged over a 20 cm intervals in steps of 5 cm in the spectral range of 350 to 40 000 The code uses single parameter band models for molecular absorbtion Ref 8 Figure 6 illustrate the resolution of the code near 2200 cm wave number This is the 4 4 4 6 um wavelength range with absorbtion due to N O and Ref 12 In our program we used Lowtran to calculate the atmospheric extinction coef ficient for different paths The change of path in the atmosphere changes the extinc tion coefficient For our program the coefficients have been calculated for each 5 increments from 0 to 90 The calculated data is kept in a different file and is read into the program interactively depending on the angle value coming from the top view angle slider In Figure 7 the plot of the calculated atmospheric extinction coefficients are seen These are the calculated values at 4
39. for the Detector Elements Widget TextWidget8 XtVaCreateManaged Widget Text Widget8 xmTextWidgetClass SensorRowColumn9 NULL Add Callbacks to the TextWidget8 widget XtAddCallback Text Widget8 XmNmodify VerifyCallback DetectorElementsCB NULL Now manage the parent RowColumn Widget XtManageChild SensorRowColumn9 This the rowcolumn that holds Firing Angle widget under it n 0 XtSetArg wargs n XmNtopAttachment XnATTACH WIDGET n XtSetArg wargs n XmNtopWidget SensorRowColumn XtSetArg wargs n XmNleftAttachment XmATTACH FORM XtSetArg wargs n XmNrightAttachment XnATTACH FORM XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNnumColumns 1 n XtSetArg wargs n XmNpacking XmPACK TIGHT Widget SensorRowColumn10 XmCreateRowColumn parent SensorRowColumn10 wargs This is the Relative Aperture gadget XtVaCreateManagedWidget Firing Angle xmLabelGadgetClass SensorRowColumn10 XmNorientation XmHORIZONTAL NULL Create the text widget for the Firing Angle FiringAngleTextWidget XtVaCreateManagedWidget FiringAngleTextWidget xmTextWidgetClass SensorRowColumn10 XmNvalue 10 0 NULL Add Callbacks to the FiringAngleTextWidget widget XtAddCallback FiringAngleTextWidget XmNmodify VerifyCallback FiringAngleCB NULL Now manage the parent RowColumn Widget XtManageChild SensorRowColumn10 This the rowcolumn
40. h This header file includes the global variables and the con stants for the whole program Data for drawing the building target ship list C Data for drawing the ship target plane list C Data for drawing the aircraft target material support C h Properties related with the lightning and the material prop erties of the targets Functions related with texturing Table 4 The main files in the program 25 C PROGRAM INPUT AND OUTPUT The program takes files as input and outputs the visual color values on the screen and the numerical distance and angle values on the sliders But as future work a cursor connected to mouse movement can read pixel temperature values on the screen So there is no output file which is created by the computer The input files which are read by the program load the arrays and these files are as listed in Table 5 FILE DESCRIPTION EXPLANATION AircraftInitialFile dat Vertex number 3 D coordinates and the initial tempera tures of the facets of the aircraft model BuildingInitialFile dat Vertex number 3 D coordinates and the initial tempera tures of the facets of the building model ShipInitialFile dat Vertex number 3 D coordinates and the initial tempera tures of the facets of the ship model TankInitialFile dat Vertex number 3 D coordinates and the initial tempera tures of the facets of the tank model Table 5 Input Files and their Contents The fil
41. j we must now step across the row and set each long integer of the NPSimage format by combining the info from the sgi rows for x 0 x lt size 0 x x 1 Someday we should generalize the below code to make it useable for images with only 1 and 2 channels compute the RGBa long to plug in and plug it in if size 2 4 Data reversed for OpenGL implementation ptr buf 0 x lt lt 24 buf 1 x lt lt 16 buf 2 x lt lt 8 buf 3 xp 147 else i RGBA image with alpha forced to Oxff Originally ptr buf 0 x buf 1 x lt lt 8 buf 2 x lt lt 16 lt lt 24 Images are stored in memory differently in OpenGL RGBA instead of ABGR as in IRISGL ptr buffO x lt lt 24 buf 1 x lt lt 16 buf 2 x lt lt 8 Oxff step the ptr to the next long ptr j j Close the image file iclose image We need to write out the image in SGI format void NPSimage write to const char filename register IMAGE image a ptr to an SGI image structure int X y Z Loop temps unsigned int ptr Ptr to the image longs open an sgi rgb image for writing image iopen filename w RLE 1 size 2 size 0 size 1 size 2 get a pointer to the NPSimage longs ptr imagedata for each row of the image for y 0 lt size 1 1 we must now step across the row and decod
42. km range for each top view angle theta where the measured angle is the angle from zenith to horizon as seen in Figure 8 6 The Detectors And The Detection Algorithms The detector is a sensor which measures the energy that reaches to it The en ergy which reaches the detector differs from the zero range value because of atmos pheric extinction The IR detector scans within a certain frequency range The energy is collected by a lens and directed on the detector An infrared interference filter is placed in front of the detector to limit the spectral region or band of the energy reach ing the detector The detector generates voltage which is proportional to the energy arriving from the target This voltage 15 processed through some electronic circuits and then changed to target surface temperature Ref 5 Sensors scan the field of view The scan techniques of sensor changes the structures of the sensors There are three scanning techniques Parallel serial serial parallel Ref 7 There are a variety of detection algorithms for IR sensors The most known ones of these algorithms are Ref 9 Contrast Box Algorithm as shown in Figure 9 which depends on the con trast difference of the background and the target within the gate Double gated filter algorithm is like a contrast box but uses a non linear double gated contrast filter to localize the target Spoke Filter depends on scanning the image of the target and it examine
43. oe ake include GL gl h Get the OpenGL required includes include lt GL giu h gt include lt GL glx h gt include TextureDisplayList h include texturesupport funcs h Get the texture support functions include drawsupport funcs h Get the drawing functions include eotda globals for all programs h void CallDisplayListForCube CUBE glGenLists 1 glNewList CUBE GL COMPILE drawCube 0 0 0 0 0 0 17998 0 glEndList j void CallDisplayListForTexturing i Index glGenLists 11 glNewList Index GL COMPILE makeGL TextureFromImagefile sea rgb glEndList glNewList Index 1 GL COMPILE makeGL TextureFromImagefile carpet1 rgb glEndList glNewList Index 2 GL COMPILE makeGLTextureFromImagefile cement4 rgb glEndList glNewList Index 3 GL_COMPILE makeGL TextureFromImagefile sand3 rgb glEndL 1510 152 This program is written to support the texturing need of the software Here we used the display list phenomena to make the switching of texturing faster Without display list it is almost imposible to switch in a short time period though we developed this program under Reality Engines This Program is also very flexable when more textures are needed simply call makeGLTextureFromImagefile rgb function X glNewList Index 4 01 COMPILE makeGL TextureFromImagefile brick3 rgb glE
44. scene or whether it should be considered to be an infinite distance away We have selected an infinite viewpoint glLightModeli GL LIGHT MODEL LOCAL VIEWER GL FALSE Say that we want two sided lighting glLightModeli GL LIGHT MODEL TWO SIDE GL TRUE Enable the lighting model there is a glDisable glEnable GL LIGHTING 13 EEE EE following function turns off the Light Model ak sk ok ke be ok ke je ok ke ke ake ok ke afe ale afe ake a ke ke oe ale ke ok ke afe akk ake ke ke afe ake ale afe void turnOffTheLightModel i glDisable GL LIGHTING j ale a following function turns on the Sun Light ak ak sk ok ok ok o ok e ke ake oj ae ok oe ke ake ake ee ake ake ake afe afe ake ake ale ake ake void turnOnTheL ights GLfloat light_ambient 0 5 0 5 0 5 1 0 light diffuse 0 7 0 7 0 7 1 0 GLfloat light diffusel 0 7 0 7 0 7 1 0 GLfloat light specular 0 5 0 5 0 5 1 0 GLfloat light specularl 1 0 1 0 1 0 1 0 The ending 0 0 means directional light at infinity GLfloat light position 0 0 100 0
45. sons why the IR window is used All targets radiate energy in the infrared spectrum The hotter the target the more energy radiated Very hot targets radiate in the visible spectrum Infrared detec tors can sense the infrared radiant energy and produce useful electrical signals propor tional to the temperature of target surfaces Every target surface above absolute zero 0 K or 273 C radiates energy in the infrared When the targets are hot enough they radiate or glow in the visible part of the spectrum As surfaces cool not only do they emit less energy but the wavelength distri bution shifts to longer infrared wavelengths Even though the human eye is incapable of sensing this energy infrared sensors can sense these invisible longer wavelengths They enable us to measure the self emitted radiant energy from even very cold targets Ref 14 A blackbody radiator is an idealized source of radiation Blackbody radiation has two important characteristic Total energy and the shape of the curve of intensity vs wavelength Location of peak Blackbody radiation is perfectly diffuse and radi ates at all wavelengths A blackbody source has an emissivity of 1 0 but the real sources in the nature have varying emissivities In our program we accepted our tar gets as blackbodies and made our calculations accordingly Every blackbody has a spectral emittance curve Figure 1 shows a family of blackbody spectra varying with temperature These spe
46. that holds Relative Aperture widget under it 76 0 XtSetArg wargs n XmNtopAttachment XmATTACH WIDGET XtSetArg wargs n XmNtop Widget SensorRowColumn10 n XtSetArg wargs n XmNleftAttachment XmATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH FORM XtSetArg wargs n XmNorientation XmHORIZONTAL n XtSetArg wargs n XmNnumColumns 1 n XtSetArg wargs n XmNpacking XmPACK TIGHT Widget SensorRowColumn11 XmCreateRowColumn parent SensorRowColumn l 1 wargs n This is the Firing Distance gadget XtVaCreateManagedWidget Firing Distance xmLabelGadgetClass SensorRowColumnl 1 XmNorientation XmHORIZONTAL NULL Create the text widget for the Firing Distance FiringDistanceTextWidget XtVaCreateManagedWidget FiringDistanceTextWidget xmTextWidgetClass SensorRowColumn11 XmNvalue 4000 0 NULL Add Callbacks to the FiringDistanceTextWidget widget XtAddCallback FiringDistanceTextWidget XmNmodifyVerifyCallback FiringDistanceCB NULL Now manage the parent RowColumn Widget XtManageChild SensorRowColumnl 1 7 3e ake ake afe This function creates the necessary widgets for the background part ofthe input screen ale ake a
47. the sensor to the target Since the approach angle changes the extinction coefficient this angle affects the de tection range of the sensor APPROACH ANGLE Degrees ENSOR TYPE _ 0 5 45 R 06km Table 6 The Detection Ranges of IR and TV sensors for Tank target Un In Table 6 only the approach angle of the sensor changes In Table 7 detection ranges for different targets for 15 approach angle and soil background are presented SENSOR TARGET TV No Fog TV 50 Fog Table 7 The Detection Ranges of IR and TV Sensors for Different Targets F HOW DOES THE INTERFACE WORK The user interface as shown in Figure 19 provides input to the program and it consists of three main parts The first part lets the user choose the target type and enter data about the target area target speed and target course From the target menu we can choose from six targets But we have implemented four of these targets in our program The targets which are ready to be displayed are tank ship building and air craft The target area direction and speed of the target areas are put on the interface for future use In our program we do not need these values 30 The second part of the interface 1s the sensor part In this part we provide the sensor information to the program The sensor type can have three different values IR TV and laser We have implemented the first two of these sensors For the IR sensor we have
48. wargs n XmNsubMenuld pulldown10 Widget option10 XmCreateOptionMenu BackgroundRC7 optionMenu10 wargs n XmStringFree label string Here manage the widget XtManageChild option10 This is the FOG DENSITY gadget XtVaCreateManagedWidget FOG DENSITY xmLabelGadgetClass BackgroundRC7 XmNorientation XmHORIZONTAL NULL Create a Frame widget n 0 XtSetArg wargs n XmNtopAttachment XnATTACH FORM XtSetArg wargs n XmNrightAttachment XnATTACH FORM XtSetArg wargs n XmNbottomAttachment FORM XtSetArg wargs n XmNshadowThickness 2 n XtSetArg wargs n XmNshadowType XmSHADOW OUT Widget FogFrame XmCreateFrame BackgroundRC7 FogFrame wargs XtManageChild FogFrame Crate the fog scale n 0 XtSetArg wargs n XmNshowValue True ntt XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNminimum 0 n XtSetArg wargs n XmNmaximum 100 XtSetArg wargs n XmNprocessingDirection XmMAX ON RIGHT n Widget Fogscale XmCreateScale FogFrame Fogscale wargs n XtManageChild Fogscale 85 Add the callbacks XtAddCallback Fogscale XmNvalueChangedCallback FogDensityCB XtPointer NULL XtAddCallback Fogscale XmNdragCallback FogDensityCB XtPointer NULL Here manage the widget XtManageChild BackgroundRC7 End of create background screen widgets
49. 0 000000 0 000000 GLfloat t72mat6 shininess 0 000000 Make the brass material calls makeGLMaterialCalls whichFace t72mat6 ambient t72mat6 diffuse t72mat6_specular t72mat6_shininess j break case t72mat 7 GLfloat t72mat7 ambient 0 039216 0 086275 0 039216 GLfloat t72mat7 diffuse 0 196078 0 431373 0 196078 GLfloat t72mat7_specular 0 000000 0 000000 0 000000 GLfloat t72mat7 shininess 0 000000 Make the brass material calls makeGLMaterialCalls whichFace t72mat7_ambient t72mat7 diffuse t72mat7 specular t72mat7_shininess j break case t72mat8 i GLfloat t72mat8 ambient 0 062745 0 062745 0 062745j GLfloat t72mat8 diffuse 0 313725 0 313725 0 313725 GLfloat t72mat8 specular 0 000000 0 000000 0 000000 GLfloat t72mat8 shininess 0 000000 1 Make the brass material calls makeGLMaterialCalls whichFace t72mat8 ambient t72mat8 diffuse t72mat8 specular t72mat8_shininess j break case t72mat9 GLfloat t72mat9_ambient 0 0392 16 0 047059 0 039216 GLfloat t72mat9 diffuse 0 196078 0 235294 0 196078 GLfloat t72mat9_specular 0 000000 0 000000 0 000000 GLfloat t72mat9_shininess 0 000000 Make the brass material calls makeGLMaterialCalls whichFace t72mat9 ambient t72mat9 diffuse t72mat9 specular 472 19 shininess break case 72 3mat0 GLfloat t72_3mat0_ambient 0
50. 0 25 Color Vertice 2 0 0 Color Vertice 3 1 0 return 1 if Temperature Vertice_no 0 gt 30 amp amp Temperature Vertice 0 lt 35 Purplish i red 5 0 16 0 if COLOR MODE SYCLIC SCALE Modify Color Array With A Given Mode Vertice no COLOR MODE red else 4 Color Vertice no 0 0 3125 Color Vertice no 1 0 0 Color Vertice 2 1 0 Color Vertice no 3 1 0 j return 1 118 j if Temperature Vertice no 0 235 amp amp Temperature Vertice no 0 lt 40 Gray i red 6 0 16 0 if COLOR MODE SYCLIC SCALE Modify Color Array With A Given Mode Vertice no COLOR MODE red j else Color Vertice no 0 0 3750 Color Vertice_no 1 0 3750 Color Vertice 2 0 3750 Color Vertice_no 3 1 0 return 1 j if Temperature Vertice no 0 240 amp amp Temperature Vertice no 0 lt 45 Dark Brown red 7 0 16 0 if COLOR MODE SYCLIC SCALE Modify Color Array With A Given Mode Vertice no COLOR MODE red else Color Vertice no 0 0 4375 Color Vertice_no 1 0 5843 Color Vertice 2 0 0 Color Vertice 3 1 0 j return 1 if Temperature Vertice no 0 gt 45 amp amp Temperature Vertice no 0 lt 50 Cherry red 8 0 16 0 if COLOR MODE SYCLIC SCALE Modify Color Array With A Given Mode Vertice no COLOR MODE red j else 4 Color Vertice 0 0 5 Color Vertice 1 0 0
51. 1 End of function oe ao This function calculte the extinction coeficient with respect to the angle that comes from View Angle scale We used the complimentary angle for this calculation because the top view is 90 degree for scale but 0 degree for LOWTRAN LT codes This extinction values can be found directly running the LT itself but it is very time consuming so we couldn t afford to spend that much time for a simulation that the time is very critical Instead we calculated the extinction coefficient by running LT with five degree increments and used those values here ak fe ake ake ke ke i le ok oj a le oe oj oj ke ake oe oj je ae e je ole oc ae o oe oj ok sje ake ae a je oe oe e ok oe sje je oc ke ke ke afe ale afe ake ke ak ak 3 float Calculate Extinction float App Angle 90 0 Firing Angle if App Angle lt 90 amp amp App Angle gt 85 return 1 1660 if App Angle lt 85 amp amp App Angle gt 80 return 0 8099 if App Angle lt 80 amp amp App Angle gt 75 return 0 6134 if App Angle lt 75 amp amp App Angle gt 70 return 0 4650 if App Angle lt 70 amp amp App Angle gt 65 return 0 3518 if App Angle lt 65 amp amp App Angle gt 60 return 0 2702 if App Angle lt 60 amp amp App Angle gt 55 return 0 2123 if App Angle lt
52. 100 0 0 0 5 GLfloatlight2 position 0 0 0 0 100 0 0 0 Specify the ambient rgba for the lights glLightfv GL LIGHTO AMBIENT light ambient Specify the diffuse rgba for the lights glLightfv GL LIGHTO GL DIFFUSE light diffuse Specify the specular rgba for the lights glLightfv GL LIGHTO SPECULAR light specular The position of the light is moving So we didn t specify here glLightPosition GL LIGHTO y Turn the light on glEnable GL LIGHTO 132 Chee ke ke ke ke ok ke ok ke ke oe ke ke oe ke oj ak ake ke ake ake ke ke ok ke ke oe ke ok ke ke ke a fe ae ake ake a ale ale The following function turns off the Sun Light oko ke void turnOff TheLights i glDisable GL j sek ke ke ake oko oe ke oe ke ke ok eo ke ok ke joke ke ale afe ake The following function enables the fog ake ke ke ok kc afe fe afe ke afe afe ake ke ke afe ake ake afe ake afe ale ahe afe afe ake ae oe af ake afe ake afe ak ae we are enabling the fog so the objects in the far distance look blury void EnableFog float density i Apply Extinction to Electro optical Signal GLint fogmode glEnable GL FOG i GL float fogcolor 4 0 8 0 894 0 815 0
53. 37 APPENDIX A FIGURES AND SCREEN OUTPUTS 0 8 0 7 Spectral radiant ecuttancg 0 1 01 2 3 4 6 7 8 0 12 Wavelength Figure 1 The change of the blackbody curves with temperature From Ref 7 38 CALCULATION OF PROJECTED AREA OF A TARGET of Sight Figure 2 The calculation of the projection area of a target Electron Beam Photoconductive Target Signal Output Figure 3 Schematical appearance of a TV camera tube From Ref 7 39 LLL LLL Figure 4 The Representation of Contrast Values on Computer Screen Short wavelength infrared Ultra violet Near infrared Far infrared Visible Mid infrared Transmission 96 1 0 1 5 2 0 3 0 5 0 10 0 15 0 20 0 30 0 Wavelength Figure 5 Atmospheric Transmission Windows From Ref 16 40 2 CM FaSCOD2 2 MITRAN C2 Z C gt p gt paj P C C 844 KENE 23 iy o lt o 5 4 2 NIE o dE m SIE coy 22 Approach Angle Degrees Figure 7 The plot of the atmospheric extinction at the range of 4 km for 8 12 IR window 41 Figure 8 The measurement of theta in Lowtran Code SCAN DIRECTION TARGET CONTRAST SENSOR FIELD OF VIEW Figure 9 The Schematical Representation of the Contrast Box Alg
54. 5 fogmode GL EXP glFogi GL MODE fogmode glFogfv GL COLOR fogcolor glFogf GL DENSITY density glHint GL HINT GL NICEST glClearColor 0 3921 0 3921 0 3921 0 5 End of EnableFog kk kool E E OG IORI The following function disables the fog ak ake ok oe fe ake de oe e ok e e be hehe oe oj oe he oe oe oe sk afe ke ahe ok ake oe afe ale afe ahe afe afe afe ahe ake ak Disable the fog here void DisableFog glDisable GL akka k akak ke ak ak a ae ak ak ak ak Turn on a Material for a particular face I Prof Zyda collected a number of materials I found and made them easily accessible via define constant Options for whichFace GL FRONT GL BACK amp others ok ake ak ke ake je de oe ok ke ke ok oe ok ke ke afe ok ke oe oe afe afe ake akk afk afe void turnOnMaterial GLenum whichFace int whichMaterial Set the appropriate material type 133 switch whichMaterial i case BRASS i j Here are the brass material values GLfloat brass ambient 4 0 35 0 25 0 1 1 0 3 GLfloat brass diffuse 0 65 0 5 0 35 1 0 GLfloat brass specular 0 65 0 5 0 35 1 0 GLfloat brass shininess 5 0 Make the brass material calls makeGLMate
55. 86 make pulldown entry The goal of this function is to simplify the construction of individual entries in the pulldown menu The routine assumes that a menubar has already been created anda p y menupane created for that menubar kk ok sje ke ok oe oe void make pulldown entry Widget menupane menupane of the menubar char entrytext Display text for the pulldown entry XtCallbackProc callback Name of procedure to call when this menu entry is selected XtPointer user data Data to be sent the callback Arg wargs 10 Same old args stuff Widget button Temp to hold the widget not managed Specify the character set set up XmStrings XmStringCharSet charset XmStringCharSet XmSTRING DEFAULT CHARSET Create this particular entry in the pulldown menu 0 XtSetArg wargs n XmNlabelString XmStringCreateLtoR entrytext charset n button XmCreatePushButton menupane entrytext wargs n We are assuming no data structure needs to be passed in to the callback XtAddCallback button XmNactivateCallback callback user data Manage the entry in the menupane XtManageChild button 87 void Backgroundl CB Widget XtPointer XtPointer Call the display list for soil texturing BACKGROUND Index 3 glCallLis
56. Arrays AircraftInitialFile dat XtManageChild TargetRowColumn3 XtManageChild TargetRowColumn4 XtManageChild TargetBB5 XtManageChild TargetBB6 XtUnmanageChild TargetBB7 BACKGROUND Index 10 glCallList BACKGROUND break default break j Y End of targetCB 92 This is the Display Callback This callback activates the display and a ControlWindow widgets and Unmanage the InputWindow widget sk ok ok ke ok ok ok ke ke void DisplayCB Widget XtPointer XtPointer float Temp mu total_radiance Remove the InputWindow widget so it will be unvisible XtUnmanageChild InputWindow Manage DisplayWindow Widget Make it visible XtManageChild Display Window Manage MainWindow Widget Make this window visible too XtManageChild Control Window Store the targets vertice number in VERTICE_NUM so when we are modifying the color arrays we don t try to modify the unnacessary part of the array switch Target i case TANK VERTICE NUM Tank Index break case TRUCK VERTICE NUM Truck Index break case SHIP VERTICE NUM Ship Index break case HELO NERTICE NUM Helo Index break case HOUSE VERTICE NUM Building Index break case PLANE VERTICE NUM Airplane Index break End of switch statement 1f the sensor is IR then we
57. EE CREER 5555 NS IS LI ESLER SS SNL Dp Mie ly PBS VECES A 7 4 ANTE m NA ja e gt UNIA i 2 25 Figure 27 TV Screen Output Of The Building Target APPENDIX B AE ke ke ke ok oko ok oko o This is eotda main C Authors 4 X X This program is written to form a core program for EOTDA software and utilizes the 3 D graphical target models The program basically written by using openGL programming language The program consist of basically three major parts First part is related with the physical inputs and calculations second part is User Interface Design and finally the third part is related with displaying the graphical model based on the inputs entered by the user Since texturing costs a high computing time of CPU this program is developed under Reality Engines Ltjg Mustafa YILMAZ Ltjg Mehmet GORGULU X KF X X HF 2 ee ok sk ok ok oe ok AE okc ok ae ok ok ok ok k kk k k kk k oe k k seo k k k kk k include lt iostream h gt include lt stdio h gt include lt stdlib h gt include lt math h gt include lt fstream h gt include lt stream h gt include lt st
58. IC The bulleten board widget for control window rc2 The bulleten board for pushbuttons in display screen sep The seperator widget 159 SensorRC11 TargetRowColumn3 TargetRowColumnd TargetBBS5 TargetBB6 TargetBB7 FogBB WindSpeedLabel The label Gadget holds the wind speed TimeLabelHour The label Gadget holds the Hour TimeLabelMonth The label Gadget holds the Month TimeLabel Year The label Gadget holds the Year FiringAngleTextWidget FiringDistanceTextWidget ke ok ke koe e oc ke ok ke ak WINDOW VARIABLES ae ke ahe je oj je ok oj ole ke oj afe ake afe ok coke oe ale aie ale ake afe ake static XtAppContext app context Applications context static XtWorkProcId workprocid NULL Id of the work procedure static GLXContext glx context GL context see initCB Display global display Global display Window global window Global window static XmStringCharSet charset XmStringCharSet XmSTRING DEFAULT f s khe e ke ok ok ok oe e je ke ke oe a 3e ke oj oe ke ok ok ake oj sje ke ke ke eoe CONSTANTS ak ak ok ok ok e oe define sigma 5 6697 pow 1 0 12 0 define PI 3 1415926545 define Speed Of Light 3 pow 1 0 8 0 Boltzman Constant 1 38 pow 1 0 23 0 hc 1 986 pow 1 0 25
59. NESS shininess Here is the function that makes the actual gl calls for sun material void makeGLSunMaterialCalls GLenum whichFace GLfloat ambient GLfloat diffuse GLfloat specular float shininess GLfloat emission Make the material calls glMaterialfv whichFace GL_AMBIENT ambient glMaterialfv whichFace GL_DIFFUSE diffuse giMaterialfv whichFace GL_SPECULAR specular glMaterialfv whichFace GL_SHININESS shininess glMaterialfv whichFace GL EMISSION emission 141 This is makeRasterFont C ok This file contains two functions to support the reading of X fonts as raster bitmaps for use with OpenGL character display ake ake ae ae afe afe ale afe ake include lt Xm Xm h gt Get the Motif stuff include lt GL GLwMDrawA h gt We are going to use an OpenGL Motif Draw widget include lt X11 StringDefs h gt include lt X11 keysym h gt include lt GL gl h gt Get the OpenGL required includes include lt GL glu h gt include lt GL glx h gt include lt iostream h gt Get the C functions include lt stdlib h gt Get the exit function PEE a eak e ke ae ke desk ke oj ke oj oe oe koe oe ke makeRasterFont make a set of display lists for a particular X font returns base of
60. NPSimage Create an image Copy the size size 0 xsize size 1 size 2 75172 Allocate an image of the appropriate size imagedata new unsigned int size 0 size 1 No name for the image yet name new char strlen name img 1 strcpy name name img We need to read in an image from a particular file void NPSimage read from const char filename IMAGE image a ptr to an SGI image structure int X y Z Loop temps unsigned int ptr Ptr to the image longs open an sgi image image 1open filename r if image NULL 146 lt lt NPSimage read from can t open input file lt lt filename lt lt endl return j NPSimage is previously defined delete it NPSimage NPSimage We have the image open and the old image deleted Create an empty image of the right size Copy the size size 0 image gt xsize size 1 image gt ysize size 2 image gt zsize Allocate an image of the appropriate size imagedata new unsigned int size 0 size 1 Copy the filename into the image name new char strlen filename 1 strcpy name filename get a pointer to the NPSimage longs ptr imagedata for each row of the image for y 0 y lt size 1 1 for z 0 z lt size 2 z z 1 i Read each row in reds greens blues alpha order getrow image buf z y z
61. OSITION XtSetArg wargs n XmNrightAttachment XmATTACH FORM XtSetArg wargs n XmNleftPosition 15 n XtSetArg wargs n XmNbottomPosition 30 Widget Backgroundform2 XmCreateForm parent Backgroundform2 wargs n XtManageChild Backgroundform2 This the rowcolumn that holds Background widgets under it 0 XtSetArg wargs n XmNtopAttachment XnATTACH FORM XtSetArg wargs n XmNleftAttachment XmATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH FORM XtSetArg wargs n XmNorientation XMHORIZONTAL XtSetArg wargs n XmNnumColumns 1 XtSetArg wargs n XmNpacking XmPACK TIGHT Widget BackgroundRC3 XmCreateRowColumn Backgroundform2 BackgroundRC3 wargs n This is the Wind Speed label gadget XtVaCreateManagedWidget Wind Speed xmLabelGadgetClass BackgroundRC3 XmNorientation XmHORIZONTAL NULL This is the label widget which holds the wind speed and it is modified when the wind speed is changed WindSpeedLabel XtVaCreateManaged Widget WindSpeedLabel xmLabelGadgetClass BackgroundRC3 XtVaTypedArg XmNlabelString XmRString 0 3 XmNuserData amp wind NULL Here we create an arrow to increment the wind velocity Widget UpArrow XtVaCreateManagedWidget UpArrow xmArrowButtonGadgetClass BackgroundRC3 XmNarrowDirection XmARROW_UP NULL Add the callback for Up Arrow XtAddCallback UpArrow XmNarmCallb
62. READ ONES 0 DISPLAY ENABLED 0 We use it to control displaye screen functions SEARCHED ONES 0 BackGround 35 Globally set background foR default value which is SOIL Target 29 Set default target value which is TANK HOUR 0 Used in positioning the sun function MODE 202 Default scale is temperature scale GLint FOG FLAG 161 koh ke ke ke ke ake o oe oe oe oe afe ke ok ke ke oe ke ke i VARIABLES FOR INPUT SCREEN static float Firing Distance 400 0 Default distance Firing Angle 10 0 Apply a default value in degrees measured from axis towards x plane Target Area Target Heading 0 Heading from North in degrees Target Speed Relative Aperture Aperture Dram Magnification Optical Transmittance Eln Band Width Sensor Height Detectivity Wind Speed Wind Direction Latitude Lat and Long values would better be Longitude defined in a class so degrees and minutes values could be stored seperately ok oe ke ke ok ke ok ok ae ok ok ae oe ale ke ke afe ale joke VARIABLES FOR TARGETS T AES looo ak ak ak ak Globals for targets status int ENGINE ON 1 For Tank Targets FIRED diddo HEAT ISOLATED 1
63. TargetRowColumn3 n XtSetArg wargs n XmNleftAttachment XnATTACH FORM n XtSetArg wargs n XmNrightAttachment XmATTACH FORM XtSetArg wargs n XmNorientation XmHORIZONTAL n XtSetArg wargs n XmNnumColumns 1 n XtSetArg wargs n XmNpacking XmPACK TIGHT n TargetRowColumn4 XmCreateRowColumn parent TargetRowColumn4 wargs n 66 This is the Target speed gadget XtVaCreateManagedWidget Target Speed km hr xmLabelGadgetClass TargetRowColumn4 XmNorientation XmHORIZONTAL NULL Create the text widget for the Target Speed Widget TextWidget3 XtVaCreateManagedWidget TextWidget3 xmTextWidgetClass TargetRowColumn4 NULL Add Callbacks to the TextWidget3 widget XtAddCallback TextWidget3 XmNmodifyVerifyCallback TargetSpeedCB NULL Now manage the parent RowColumn Widget XtManageChild TargetRowColumn4 Create the bulletin board widget n 0 XtSetArg wargs n XmNtopAttachment XmATTACH WIDGET XtSetArg wargs n XmNtop Widget TargetRowColumn4 XtSetArg wargs n XmNleftAttachment XmATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH FORM n TargetBB5 XmCreateBulletinBoard parent TargetBB5 wargs n XtManageChild TargetBB5 Create a Frame widget to make it so we can resize the window n 0 XtSetArg wargs n XmNshadowThickness 2 n XtSetArg wargs n XmNshadowType XmSHADOW OUT Widget TargetFrame5 XmCreateFra
64. XnATTACH FORM XtSetArg wargs n XmNrightAttachment XnATTACH FORM XtSetArg wargs n XmNtopAttachment XmATTACH FORM XtSetArg wargs n XmNbottomAttachment XmATTACH POSITION XtSetArg wargs n XmNbottomPosition 27 n DisplayWindow XmCreateForm MainWindow Display Window wargs n Create a frame that holds the display window n 0 XtSetArg wargs n XmNshadowThickness 2 n XtSetArg wargs n XmNshadowType XmSHADOW IN MainDisplayFrame XmCreateFrame DisplayWindow MainDisplayFrame wargs n XtManageChild MainDisplayFrame Create Form widget This is the container widget for rowcolumn widgets Do NOT manage this widget either Manage it when Display button is pressed 0 XtSetArg wargs n XmNtopAttachment XmATTACH POSITION n4 XtSetArg wargs n XmNtopPosition 27 XtSetArg wargs n XmNrightAttachment XnATTACH FORM XtSetArg wargs n XmNbottomAttachment XmATTACH FORM XtSetArg wargs n XmNleftAttachment XnATTACH FORM ControlWindow XmCreateForm MainWindow ControIWindow wargs Create rowcolumn widget to display information n 0 XtSetArg wargs n XmNtopAttachment XmATTACH FORM n XtSetArg wargs n XmNrightAttachment XmATTACH FORM XtSetArg wargs n XmNbottomAttachment XnATTACH FORM n XtSetArg wargs n XmNleftAttachment XmATTACH FORM XtSetArg wargs n XmNorientation XmHORIZONTAL
65. ack ChangeWindSpeedCB XtPointer 1 80 Here we create an arrow to decrement the wind velocity Widget DownArrow XtVaCreateManagedWidget DownArrow xmArrowButtonGadgetClass BackgroundRC3 XmNarrowDirection XmARROW DOWN NULL Add the callback for Down Arrow XtAddCallback DownArrow XmNarmCallback ChangeWindSpeedCB XtPointer 1 Here manage the widget XtManageChild BackgroundRC3 Here define a rowcolumn widget for wind direction 0 XtSetArg wargs n XmNtopAttachment XmATTACH WIDGET XtSetArg wargs n XmNleftAttachment XmATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH FORM XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNtopWidget BackgroundRC3 XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNentryVerticalAlignment XmALIGNMENT_CONTENTS_TOP n XtSetArg wargs n XmNpacking XmPACK TIGHT n Widget BackgroundRC4 XmCreateRowColumn Backgroundform2 BackgroundRC4 wargs n This is the Wind Direction gadget XtVaCreateManagedWidget Wind Dir xmLabelGadgetClass BackgroundRC4 XmNorientation XmHORIZONTAL NULL Create the text widget for the WindDirection Widget WindDirection XtVaCreateManagedWidget WindDirection xmTextWidgetClass BackgroundRC4 NULL Add Callbacks to the WindDirection widget XtAddCallback WindDirection XmNmodify VerifyCallback WindDirectio
66. age into an electrical signal These tubes are used to generate a train of electrical pulses which represent light intensities present in an optical image focused on the tube These inten sities correspond to the luminance or gray levels on the screen Each picture element pixel on the screen has a luminance value These tubes use an electron beam to scan a photoconductive target which is the light sensor A transparent conductive layer applied to the front side of the photocon ductor serves as the signal target electrode When a light pattern is focused on the photoconductor its conductivity increases in the illuminated areas and the back side of the target charges to more positive values The electron beam then reads the signal by depositing electrons on the positively charged areas thereby providing a capacitively coupled signal at the signal electrode Ref 7 The scene radiance is represented on the screen with different gray levels The reflection of the scene on the screen will be represented by the pixels which have dif ferent brightness luminosity values So there is going to be a pattern of contrast on the screen as shown in Figure 4 The contrast among the pixels is related with their gray levels i e with their luminosity As a result of this there will be a distribution of contrast on the screen among the pixels This contrast can be expressed in several ways We define it as the difference of the maximum brightness and the minimu
67. alues at low tempera tures the corresponding color value on the screen is going to have a smaller R value at high temperatures the corresponding color value is going to have a high R value This idea helps us when scanning the screen colors for detection The screen scan pattern was inspired from the contrast box method which was invented by Texas Instruments and the scanning method which is used in the program is as seen in Figure 17 Ref 9 The scanning box on the screen covers an area of 200x200 pixels on the screen This box moves on the screen from left to right like a scanner At the end of each move the red color values within the pixel area which is covered by the box are read and the average value of the red values for the pixels in the box is found These values 28 are stored in an array and they are compared with each other in order to be able to find the hottest the reddest area on the screen The criteria for lock on is the detection of the same point twice Detection oc curs when the biggest averaged red color value of a box exceeds the pre accepted R value 2 Television Sensor TV sensors are designed to respond to a band of electromagnetic energy The incoming radiation creates different level of illumination on the screen This illumina tion is called the gray level and the relation of the gray levels of the pixels gives the contrast Gray level for a TV system means the summation of the R G and B values di
68. anklInitialFile dat XtManageChild TargetRowColumn3 XtManageChild TargetRowColumn4 XtManageChild TargetBB5 XtManageChild TargetBB6 XtUnmanageChild TargetBB7 BACKGROUND Index 3 glCallList BACK GROUND break case TRUCK This is not yet implemented FillInInitialTargetA rrays TruckInitialFile dat XtManageChild TargetRowColumn3 XtManageChild TargetRowColumn4 XtManageChild TargetBB5 XtManageChild TargetBB6 XtUnmanageChild TargetBB7 BACKGROUND Index 3 glCallList BACK GROUND break case SHIP FillInInitialTargetA rrays ShiplInitialFile dat XtManageChild TargetRowColumn3 XtManageChild TargetRowColumn4 XtManageChild TargetBB5 XtManageChild TargetBB6 XtUnmanageChild TargetBB7 BACKGROUND Index giCallLis BACKGROUND break case HELO This target is also not yet implemented FillInInitialTargetArrays HeloInitialFile dat XtManageChild TargetRowColumn3 XtManageChild TargetRowColumn4 XtManageChild TargetBB5 XtManageChild TargetBB6 XtUnmanageChild TargetBB7 BACKGROUND Index 3 glCallList BACK GROUND break case HOUSE FillInInitialTargetArrays BuildingInitialFile dat XtUnmanageChild TargetRowColumn3 XtUnmanageChild TargetRowColumn4 XtUnmanageChild TargetBB5 9 XtUnmanageChild TargetBB6 XtManageChild TargetBB7 BACKGROUND Index 3 glCallList BACK GROUND break case PLANE FillInInitialTarget
69. ards Widget void concatenate accumulative matrices float refx float refy float refz void unit GLfloat m void set initial viewing values void compute new viewing values void make the window for the controls void create toggle widget Widget parent void load the viewpoint int FillInInitialTargetArrays char InputFileName void make pulldown entry Widget menupane menupane of the menubar char entrytext Display text for the pulldown entry XtCallbackProc callback Name of procedure to call when this menu entry is selected XtPointer user data Data to be sent the callback void Read Screen void Read TV Screen float Calculate Extinction int Fill Up Color Table int Vertice no int Color Mode 157 void Modify Color Array With A Given Mode int Vertice no int SELECTED MODE double red value float Find Total Radiance float kt float Temp At Sensor float total radiance float mu int LoadModifiedGroundColor float Range float mu int Find Index For Max Value void Update ROW COLOMN int int void Print Lock On int MAX X int MAX Y void Call IR Functions void Call TV Functions void Print Numbers On Color Scale 158 ak ake ake ak e This is eotda mains h file Here all necessary global widgets and constants are defined which are used in eotda main C
70. args n XmNrightAttachment FORM XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNnumColumns 1 n XtSetArg wargs n XmNpacking XmPACK TIGHT Widget SensorRowColumn4 XmCreateRowColumn parent SensorRowColumn4 wargs n This is the Relative Aperture gadget XtVaCreateManagedWidget Magnification xmLabelGadgetClass SensorRowColumn4 XmNorientation XmHORIZONT AL NULL Create the text widget for the Magnification Widget TextWidget3 XtVaCreateManagedWidget TextWidget3 xmTextWidgetClass SensorRowColumn4 NULL Add Callbacks to the TextWidget3 widget XtAddCallback TextWidget3 XmNmodify VerifyCallback MagnificationCB NULL Now manage the parent RowColumn Widget XtManageChild SensorRowColumn4 This the rowcolumn that holds Optical Transmittance widget under it n 0 XtSetArg wargs n XmNtopAttachment XmATTACH WIDGET XtSetArg wargs n XmNtop Widget SensorRowColumn4 n 73 XtSetArg wargs n XmNleftAttachment XnATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH FORM XtSetArg wargs n XmNorientation XnHORIZONTAL XtSetArg wargs n XmNnumColumns 1 n XtSetArg wargs n XmNpacking XmPACK TIGHT Widget SensorRowColumn5 XmCreateRowColumn parent SensorRowColumn5 wargs n This is the Relative Aperture gadget XtVaCreateManagedWidget Optical Transmittance
71. at perform these calculations have not been completed in the program On the interface the basic options for the user at the beginning are to choose the type of the target the type of the sensor and background The default values are a tank for the target and the IR for the sensor with the background of soil After select ing these initial data the display button displays the initial appearance of the target at the range of 4 km We designed this user interface to give different options to the user and make the control of the program easier 20 Another part of the user interface is on the display screen There are three slid ers on this screen These sliders have been designed to control the input data of the program and the position of the program interactively and rapidly One of these slid ers controls the distance of the target to the sensor the other slider controls the ap proach angle of the missile to the target The last slider controls the viewing angle of the target temperature distribution These sliders are not only used for controlling the appearance of target but also as an input source to the program We selected sliders as an input and control mechanism because they are easy to use fast and interactive 21 V THE PROGRAM A LOGICAL STRUCTURE The problem of visualizing the output of EOTDA software consists of two parts These sections are the IR part and the TV part Therefore we se
72. ate the bulletin board widget n 0 XtSetArg wargs n XmNbottomAttachment XmATTACH FORM XtSetArg wargs n XmNleftAttachment XmATTACH FORM XtSetArg wargs n XmNbottomOffset 2 n bulletin boardi XmCreateBulletinBoard parent bulletinl wargs XtManageChild bulletin_board1 Create a Frame widget to make it so we can see the size of the window n 0 XtSetArg wargs n XmNshadowThickness 2 n XtSetArg wargs n XmNshadowType XmSHADOW IN Widget framel XmCreateFrame bulletin boardl 1 wargs XtManageChild frame Set up arglist and create the scalel n 0 XtSetArg wargs n XmNfontList fontlist ntt XtSetArg wargs n XmNshowValue True ntt 98 XtSetArg wargs n XmNtitleString titleString1 XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNmaximum 360 XtSetArg wargs n XmNprocessingDirection XmMAX ON RIGHT scale XmCreateScale framel scalel wargs XtManageChild scale Add the callbacks XtAddCallback scalel XmNvalueChangedCallback rotateyCB XtPointer NULL XtAddCallback scalel XmNdragCallback rotateyCB XtPointer NULL Add a separator n 0 XtSetArg wargs n XmNorientation XmVERTICAL sep XmCreateSeparator parent separator wargs n XtManageChild sep Create the bulletin board2 widget n 0 XtSetArg wargs n XmNleftAttachment XmATTACH
73. ation between the temperature and the color values of the computer The detection in the IR part of the program depends on this reading the color value of each pixel on the screen The detection is determined by the hottest point or area on the screen The hottest point on the screen is the point which has the highest averaged R value ie the point which has the highest temperature The relation between the temperature and the color holds because in the color table presented in Chapter V the R values of all colors were sorted in order A color which has a small R value corresponds to a low temperature value 2 Infrared Data Structure In the program we have four main arrays One of them is used for storing the vertex data one for storing the temperature of each vertex one for storing the initial temperature of the vertex and the last is used for storing the current instantaneous temperature of the vertices Data is read into these arrays at the beginning of the pro gram and then they are processed in these arrays Vertex and initial temperature arrays are used once by the program at the beginning of the program The current tempera ture and color arrays are used repeatedly during the program Also the color values of the ground are stored in a global one dimensional array and updated with the target calculation procedures The data transfer among these arrays is as seen in Figure 16 19 3 TV Sensor Design As we mentioned before
74. ctral curves were explained by Plank at the turn of this century Ref 13 Equation 1 gives the power radiated per unit surface area per unit wavelength as a function of A 2nc h Watts cm 1 7 In this equation is Plank s constant is the speed of the light k is the Boltz man constant and is the wavelength at which the blackbody radiates energy Equa tion 1 can be integrated to give the total radiation in a given wavelength range when integrated over all we obtain 2 2 Ref This is Stefan Boltzman Law obtained empirically by Stefan in 1879 The peak wavelength of the radiated energy is dependent of the temperature and is given by Wien s displacement law Au 3 Ref 5 In the above Equations W Radiant Power emitted per unit area Emissivity 0 Stephan Boltzman constant T Absolute temperature of the target K m Wavelength of maximum radiation b Wien s displacement constant 2897 K The sensor design we implemented responds to 8 12 um bandpass The proper approach would be to integrate Equation 1 over the range Because the integration process slows the program down substantially we assumed that the majority of the en ergy was 8 12 band and simply used the Stefan Boltzman Low to calculate the to tal radiance of the targets Note that for terrestial temperature ranges the radiation in any IR ba
75. de The structure we used in the program was a simple multi dimensional array structure to store and process the data 2 Hardware Computer graphics utilizes special hardware In addition to rapid graphics processing we utilized texturing for the TV sensor Texturing requires fast computing and runs slowly on IRIS Indigo Workstations Texturing is implemented in hardware on the IRIS Reality engines and runs much more quickly So our hardware working environment is the IRIS Reality engines These workstation are very powerful and the 17 data process rate of these machines are very high The explanatory data about these machines are seen in Table 2 IRIS POWER SERIES 4D 340 VGX Number of the Microprocessors 4 33 Mhz IP7 FPU CPU MIPS R2010 R3010 Floating Point Chip Table 2 Specifications of IRIS Reality Engine B SENSOR DESIGN AND STRUCTURE 1 Infrared Sensor Design The IR sensor is designed to mimic a threshold measurement technique in the 8 12 atmospheric window Objects are modeled using temperature distribution as described below Only emitted radiation is modeled so the sensor might best be con sidered a night time model The threshold level for sensors were chosen arbitrarily because of lack of real sensor characteristics The unit for the threshold level is pixel intensity value within the range of 0 255 The main idea for the IR part of the program depends on the representation of the te
76. dify VerifyCallback RelativeApertureCB NULL Now manage the parent RowColumn Widget XtManageChild SensorRowColumn2 This the rowcolumn that holds Aperture Dram widget under it 0 XtSetArg wargs n XmNtopAttachment XmATTACH WIDGET XtSetArg wargs n XmNtopWidget SensorRowColumn2 72 XtSetArg wargs n XmNleftAttachment XmATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH FORM XtSetArg wargs n XmNorientation XnHORIZONTAL XtSetArg wargs n XmNnumColumns 1 n XtSetArg wargs n XmNpacking XmPACK TIGHT Widget SensorRowColumn3 XmCreateRowColumn parent SensorRowColumn3 wargs n This is the Relative Aperture gadget XtVaCreateManagedWidget Aperture Dram xmLabelGadgetClass SensorRowColumn3 XmNorientation XnHORIZONTAL NULL Create the text widget for the Relative Aperture Widget TextWidget2 XtVaCreateManagedWidget TextWidget2 xmTextWidgetClass SensorRowColumn3 NULL Add Callbacks to the TextWidget2 widget XtAddCallback TextWidget2 XmNmodify VerifyCallback ApertureDramCB NULL Now manage the parent RowColumn Widget XtManageChild SensorRowColumn3 This the rowcolumn that holds Magnification widget under it n 0 XtSetArg wargs n XmNtopAttachment XmATTACH WIDGET XtSetArg wargs n XmNtopWidget SensorRowColumn3 n XtSetArg wargs n XmNleftAttachment FORM XtSetArg w
77. e done on the program is that the program can be in tegrated to EOTDA software This requires a small change in the output files of the EOTDA software 36 LIST OF REFERENCES Hughes Company Electro optical Tactical Decision Aid EOTDA User s Manual Version 3 0 1983 2 Donald Hearn Pauline Baker Computer Graphics Mc Graw Hill 1990 3 Foley Van Dam Hughes Computer Graphics Addison amp Wesley 1994 4 Donald Mc Minds Mastering OSF MOTIF Widgets Addison amp Wesley 1993 5 DCS Corporation Infrared Imaging Systems Analysis DCS 1988 6 John C Russ The Image Processing Handbook Osborne 1992 7 RCA Electro optics Handbook 1974 8 AFGL TR 88 0177 U S Air Force Geophysics Lab Lowtran 6 Code Manual 1990 9 Texas Instruments Infrared Detection and Sensors IEEE 1991 10 Silicon Graphics OpenGL Programming Manual San Jose 1994 11 James A Ratches Static Performance Model for Thermal Imaging Systems 1976 12 Alexander Berk Lawrence Berstein and David C Robertson Modtran A moderate resolution model for Lowtran 7 USAF Technical Report GL TR 89 0122 1989 13 Richtmyer amp Cooper Introduction to Modern Physics Mc Graw Hill 1969 14 Arya Fundamentals of Atomic Physics Allyn amp Bacon Inc 1971 15 Silicon Graphics Inc Iris Universe Magazine Summer 92 16 Elachi Charles Introduction to the physics and the techniques of remote sensing John Wiley amp Sona New York 1987
78. e each integer of the NPSimage format into the 16 bit shorts sgi requires for x 0 x lt size 0 x x 1 Get the colors from the longs Reversed for OpenGL buf 0 x unsigned short ptr amp Oxff000000 gt gt 24 buf 1 x unsigned short ptr amp Ox00ff0000 gt gt 16 buf 2 x unsigned short ptr amp 0x0000ff00 gt gt 8 148 buf 3 x unsigned short ptr amp 0x000000ff step the ptr to the next long j Write out the rows of the image for z 0 z lt size 2 z z 1 Write each row in reds greens blues alpha order putrow image buf z y z j we must close the output sgi image file iclose image We need to display the image void NPSimage display i Here is the OpenGL call to send the image to the open window glDrawPixels size 0 size 1 GL UNSIGNED BYTE imagedata The purpose of the operator is for copying an NPSimage NPSimage amp NPSimage operator NPSimage amp img i int i Loop temp Delete the old image if any NPSimage NPSimage Copy the size size 0 img size 0 149 size 1 img size 1 size 2 img size 2 Allocate an image of the appropriate size imagedata new unsigned int size 0 size 1 Copy the image data from img to this for i 0 i lt size 0 size 1 i i 1 imagedata i img imagedata i Copy t
79. e haven t read the screen previously i Read TV Screen if Max Contrast Of Scene gt 55 0 i draw a rectangle Max Contrast X Max Contrast 50 End of Max Contrast Of Scene gt 55 0 READ ONES 1 else if Max_Contrast_Of_Scene gt 55 0 Print_Lock_On 400 150 draw a rectangle Max Contrast X Max Contrast Y 50 y End of Max Contrast Of Scene gt 55 0 of else of else End of Call IR Functions 129 This function modifies the color array with respect to the color mode sellected ke oko ale ake void Modify Color Array With A Given Mode int Vertice no int SELECTED MODE double red value switch SELECTED MODE case GRAY_SCALE Color Vertice_no 0 red value Color Vertice 1 red value Color Vertice no 2 red value Color Vertice_no 3 1 0 break case TEMPERATURE SCALE Color Vertice 0 red value Color Vertice_no 1 0 0 Color Vertice_no 2 1 red value Color Vertice_no 3 1 0 break default break End of switch End of Modify_Color_Table_With 130 ake ake ake ake ake 3e 3k This is materialsupport C Main body of this C file is taken from CS4202 course notes and some material definitions a
80. ed we never find the correct min and max values max contrast 0 123 x min contrast 255 index index l End of for x End of for y End of Read TV Screen ke ae ake oc ok ok ok ok ok afe a ok oe ale afe a ahe afe kc ke ok ke ke ok oe ok ke ake ok ke ke ke oe sje oj jc oj oj oj oj oe jejejeje ake ake ake afe ae ae a ak 2e This is a convenience routine for finding the index value of global red datas array which has the max red value in it int Find Index For Max Value int index for int i 0 i lt 110 1 red datas i 0 gt MAX RED i MAX RED avarage red datas i 0 index i j j return index End of Find Max Valuc 124 IG IO GIR AGRIC III a This function prints LOCK_ON to the screen with big fonts void Print Lock On int xpos int ypos i Since we are going to write on a 2D screen we must use the Orthographic projection glMatrixMode GL_PROJECTION glPushMatrix glLoadlIdentity gluOrtho2D 0 0 1400 0 0 0 800 0 glMatrixMode GL_MODELVIEW glPushMatrix glLoadldentity glPushAttrib GL COLOR BUFFER glColor3f 0 1 1 0 0 5 Do a setpoint for the lower lefthand coordinate of the text string glRasterPos3f xpos ypos 0 0 drawCharstring fontHandlel LOCKED
81. ehe ke de oe ok ke ode ke ake ake ode afe ok ake ke ke afe ke ode ke ke ke ak This callback is used to return back to input screen from the display screen This callback manages the InputScreen widget and Unmanage the DisplayScreen and ControlScreen widgets static void BackToInputScreenCB Widget XtPointer XtPointer i Remove the DisplayWindow widget XtUnmanageChild DisplayWindow Remove the ControlWindow widget XtUnmanageChild ControIWindow Manage MainWindow Widget XtManageChild InputWindow 114 Here set the global DISPLAY ENABLED variable to zero so when draw the scene is called no function is executed DISPLAY ENABLED 0 j ak ake ae This function reads in the target data files and loads the vertex temperature and color arrays Function return type is integer for error checking purposes afe ake a ake ake ake af fe ake ake ake ae ake ake ake afe ake 3k ake ake 3K aie afe ake afe ake 3 afk 3k k int FillInInitialTargetArrays char InputFile int Vertice_no float Vertex Vertex 2 Temp kt mu total radiance 0 0 const intsize 100 char buffer size Used to store unnecassary characters ifstream from InputFile Input Data File if
82. ent redplastic diffuse redplastic specular redplastic shininess break case GREENPLASTIC i Here are the greenplastic material values GLfloat greenplastic ambient 4 0 1 0 3 0 1 1 0 3 GLfloat greenplastic_diffuse 0 1 0 5 0 1 1 0 3 GLfloat greenplastic specular 0 45 0 45 0 45 1 0 3 GLfloat greenplastic shininess 30 0 3 Make the greenplastic material calls makeGLMaterialCalls whichFace greenplastic ambient greenplastic diffuse greenplastic specular greenplastic shininess break case BLUEPLASTIC Here are the blueplastic material values GLfloat blueplastic ambient 0 1 0 1 0 3 1 0 GLfloat blueplastic diffuse 0 1 0 1 0 5 1 0 136 GLfloat blueplastic specular 0 45 0 45 0 45 1 0 GLfloat blueplastic shininess 30 0 3 Make the blueplastic material calls makeGLMaterialCalls whichFace blueplastic_ambient blueplastic_diffuse blueplastic_specular blueplastic_shininess j break case RED i Here are the red material values GLfloat red ambient 0 2 0 0 0 0 1 0 3 GLfloat red diffuse 1 0 0 0 0 0 1 0 GLfloat red specular 1 0 0 0 0 0 1 0 3 GLfloat red shininess 1 0 3 Make the red material calls makeGLMaterialCalls whichFace red_ambient red_diffuse red_specular red_shininess break case WHITE Here are the white material values GLfloat wh
83. ent t72mat2_ diffuse t72mat2 specular t72mat2_shininess break case t72mat3 GLfloat t72mat3 ambient 0 039216 0 070588 0 039216 GLfloat t72mat3 diffuse 0 196078 0 352941 0 196078 GLfloat t72mat3 specular 0 000000 0 000000 0 000000 GLfloat t72mat3 shininess 0 000000 Make the brass material calls makeGLMaterialCalls whichFace t72mat3 ambient t72mat3 diffuse t72mat3 specular t72mat3_shininess break case t72mat4 i GLfloat t72mat4 ambient 0 039216 0 062745 0 039216 t72mat4 diffuse 0 196078 0 313725 0 196078 GLfloat t72mat4 0 000000 0 000000 0 000000 GLfloat t72mat4 shininess 0 000000 Make the brass material calls makeGLMaterialCalls whichFace t72mat4 ambient t72mat4 diffuse t72mat4 specular t72mat4_shininess break case t72mat5 i GLfloat t72mat5 ambient 0 047059 0 047059 0 047059 GLfloat t72mat5 diffuse 0 235294 0 235294 0 235294 GLfloat t72mat5 specular 0 000000 0 000000 0 000000 GLfloat t72mat5 shininess 0 000000 3 Make the brass material calls makeGLMaterialCalls whichFace t72mat5 ambient t72mat5 diffuse t72mat5 specular 138 t72mat5_shininess j break case t72mat6 i GLfloat t72mat6 ambient 0 039216 0 094118 0 039216 GLfloat t72mat6 diffuse 0 196078 0 470588 0 196078 GLfloat t72mat6 specular 0 000000
84. er unsigned int y unsigned int z IMAGE iopen const char file char mode 166 IMAGE icreate unsigned short ibufalloc define IMAGEDEF for backwards compatibility fifdef _ cplusplus endif endif GL IMAGE _ 167 952 INITIAL DISTRIBUTION LIST Defense Technical Information Center Cameron Station Alexandria VA Library Code 52 Naval Postgraduate School Monterey CA Prof W R Colson Code PH CW Department of Physics Naval Postgraduate School Monterey CA Pro Richard Chris Olsen Code PH 05 Department of Physics Naval Postgraduate School Prof David Pratt Code CS PR Computer Science Naval Postgradute School Deniz Kuvvetleri Komutanligi Turkish Naval Headquarters Personel Daire Baskanligi Bakanliklar Ankara TURKEY Golcuk Tersanesi Komutanligi Golcuk Shipyard Golcuk Kocaeli TURKEY Deniz Harp Okulu Komutanligi Naval Academy 81704 Tuzla ISTANBUL TURKEY 22304 6145 93943 5002 93943 5100 93943 5100 93943 5100 168
85. er it label string XmStringCreateSimple TARGET 7 n 0 XtSetArg wargs n XmNlabelString label string n XtSetArg wargs n XmNsubMenuld pulldown option XmCreateOptionMenu TargetRowColumnl optionMenu wargs n Manage the label widget XtManageChild option Free the string XmStringFree label_ string 64 This the rowcolumn that holds Material puldown widgets under it n 0 XtSetArg wargs n XmNtopAttachment XmATTACH WIDGET XtSetArg wargs n XmNtop Widget TargetRowColumn n XtSetArg wargs n XmNleftAttachment XmATTACH_FORM XtSetArg wargs n XmNrightAttachment XmATTACH_FORM XtSetArg wargs n XmNorientation XnHORIZONTAL XtSetArg wargs n XmNnumColumns 1 n XtSetArg wargs n XmNpacking XmPACK TIGHT n Widget TargetRowColumn11 XmCreateRowColumn parent TargetRowColumnl 1 wargs n XtManageChild TargetRowColumnl11 Add a pulldown to the RowColumn 0 XtSetArg wargs n XmNleftAttachment _ n XtSetArg wargs n XmNrightAttachment XmATTACH FORM Widget pulldown2 XmCreatePulldownMenu TargetRowColumnl 1 pulldown2 wargs Add the entries to the pulldown When material is included into the computations material names are to defined in global targets h file and used here as user data pased into the callback make pulldown entry pulldown2 STEEL materialCB XtPointer
86. ermine the detection and lock on range for the IR and the TV system In the program the user was given the full control for changing the distance from the sensor to the target As the distance changes the calculations are done again depending on the changing distance If the signal coming from either the background or the target exceeds the threshold level the program gives detection The above implementation resulted in a computer program that can measure and visualize the performance of a generic IR or TV missile system depending on the input data The measure of performance for a missile system is detection distance The reliability of the result is completely dependent on the input data The missile sys tem gets the input and then tries to distinguish the target from the background and whenever there is detection this is presented on the screen The IR sensor part of the program we have gives an idea of the temperature distribution on the target and the background The user can see the temperature distribution on the target from differ ent angles The calculation method and the detection algorithm of the program rely on physical algorithms B THEORY 1 Heat And Temperature Heat can be defined as thermal energy in transition It flows from one place to another as a result of temperature difference The flow of heat changes the energy lev els in the objects Temperature is a property of the object and not a complete measure
87. ertice 1 0 0 Color Vertice no 2 0 0 Color Vertice_no 3 1 0 return 1 return 1 End of function Fill Up Color Table ok ke ok ke akk eje ke ok oj ke ok ke oe This function reads the display screen pixels from the frame buffer with 100 by 100 square and finds the avarage red value of square and finally after reading the last square ofthe screen it finds the maximum red value of the screen ke afe ae ake ake ee ke sfe void Read_Screen float sum_of_red 0 0 avr_red 0 0 int index 0 deb 0 for int y 900 y gt 0 y y 100 for int x 0 x lt 1000 x x 100 glReadPixels x y 100 100 GL RED GL UNSIGNED BYTE buffer1 for int counter O counter lt 10000 counter We defined the bufferl array as character to make it occupy less memory space sum of red sum of red int bufferl counter End of for counter avr red sum of red 10000 red datas index 0 avr avarage red datas index 1 7x avarage red datas index 2 y index indext 1 sum_of red 0 0 V End of for x End of for y End of Read Buffer 122 This function reads the display screen pixels fro
88. es in the table above contains 3 D information about the coordinates of the targets and also information about the temperature of each node on the facets The format of the input files is presented in Figure 15 D OPERATION Our modeling and implementation of the program is summarized as follows The targets in the figures consist of facets The more complex the target is the more facets it has The number of the facets and vertices belonging to each target has been presented in Table 1 Each facet on the target has vertices These vertices are used to store information The temperature value and the corresponding color val ues are stored 1n these vertices 26 1 Infra Red Sensor At the beginning of the program we stored the temperature information of the targets in the vertices of the targets We took each vertice on the target separately and calculated the energy ra diated by this vertex at the stored temperature This gave the energy of the vertex at zero range from the target The energy value we found from this vertex travels in the atmosphere Dur ing its travel it attenuates This attenuation is caused by atmospheric ex tinction So we multiplied this energy value with e This multiplication gives varying values depending on the extinction coefficient and the distance between the sensor and the target The result of this multiplication gives the energy value at the sensor Sensors work by converti
89. etArg wargs n XmNtopAttachment XmATTACH_WIDGET XtSetArg wargs n XmNtopWidget TargetBB6 XtSetArg wargs n XmNleftAttachment XmATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH FORM TargetBB7 XmCreateBulletinBoard parent TargetBB7 wargs n Don t manage it here Manage with respect to Target selected XtManageChild TargetBB7 Create a Frame widget 0 XtSetArg wargs n XmNshadowThickness 2 XtSetArg wargs n XmNshadowType XmSHADOW OUT Widget TargetFrame7 XmCreateFrame TargetBB7 TargetFrame 7 Wargs n XtManageChild This the rowcolumn that holds Target Status widgets under it n 0 XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNradioBehavior TRUE n Widget TargetRowColumn7 XmCreateRowColumn TargetFrame7 TargetRowColumn7 wargs n Create the label for Fire Status n 0 Widget Label3 XtVaCreateManagedWidget Heat Isolated xmLabelGadgetClass TargetRowColumn7 NULL Here we create a Radio Button Gadget for Isolation Status Widget Isolated XtVaCreateManagedWidget Yes xmToggleButtonGadgetClass TargetRowColumn7 NULL Add Callbacks to the Isolated gadget XtAddCallback Isolated XmNvalueChangedCallback IsolationStatusCB XtPointer 1 69 Here we create a Radio Button Gadget fot Targut Status Widget NotIsolated XtVaCreateManagedWid
90. ex number x coordinate of the vertex y coordinate of the vertex z coordinate of the vertex and the tempera ture value of the vertex This data is in one line and the temperature in this line is the initial and the basic temperature of the target during the flight or cruise of the sensor This temperature is the main temperature value for the rest of the extinction calculations After the vertex coordinates are read into the vertex array the index of the ar ray is accepted as the corresponding vertex number the last value which is read in is the temperature value of that vertex This is the temperature value of the vertex at zero range These values which are in the initial temperature array are subjected to ex tinction calculations for each vertex and then the newly found values are put into the current temperature array After the calculation of the new temperatures the corresponding color values are stored into the color matrix and then the draw routine in the program is invoked This provides an active color temperature calculation depending on the input parame ters The temperature related color values are applied to the vertices and appears on the screen representing the temperature of each point on the target The color values which are applied to the screen are the real values corre sponding to the real estimated color values of the vertices i e the target Because the color values have been sorted increasingly according to their R v
91. f polygons and the data about the target facets and vertex counts are presented in Table 1 11 TARGET TYPE VERTEX COUNT FACET COUNT F 16 AIRCRAFT 1 068 Table 1 Target Geometric Information The target models used in our work were developed by other students for pre vious projects either by Multigen modeling software or by hand sketching Multigen has a database which contains pre drawn target files and different models This data base can be used to visualize different targets but these models can not be used di rectly with OpenGL library functions Therefore we converted them to a standard form which can be understood by OpenGL library routines 2 Texturing Lighting Shading and Fog a Texturing Texturing 15 mapping a scanned image onto the surface of an object This makes the image look more realistic The techniques we apply texturing to a poly gon are Ref 3 The underlying color can be modulated with the texture image to get shaded textured models The textured images can be mapped onto polygons as a decal obscuring the underlying polygon color We used this method in our program So when light and texturing on we do not see the underlying color When the lights are off we do not see the color but the texture A textured image can be blended with a single color By specifying the s amp t texture mapping coordinates Ref 10 we can cover the polygon with the desired image In
92. f the target h is the height of the target 3 Visual Wavelength Signals In daylight reflected solar energy in the visible wavelength can be used by TV sensors to detect the targets Our implementation of TV detector depends on a con trast model In this sense contrast means the difference between the gray level of a target and the background There is a sudden change of gray levels in transition from the environment to the target The energy coming from the target and the environment produces different illu mination on the TV sensor screen The energy striking the sensor plate induces differ ent voltage levels for target and background An electron beam scans this plate and creates different illumination values on the screen for each pixel as shown in Figure 3 Atmospheric factors affect this type of detection more than it does to other types of detections We simulated this by applying fog in our program using an extinction model described below The software we used OpenGL provides us three types of fog functions fog function can be linear quadratic or exponential Since the atmospheric extinction occures exponentially we chose the exponential fog function In this equation d is the fog density coefficient which corresponds to the atmospheric extinction coeffi cient in the IR part and R is the distance in eye coordinates from origin to the object TV tubes are a kind of electron device which converts an optical im
93. fine LASER 41 define GRAY SCALE 200 define SYCLIC_SCALE 201 define TEMPERATURE SCALE 202 static IR IR static int TV static int LASER LASER static int GRAY SCALE GRAY SCALE static int SYCLIC SCALE SYCLIC SCALE static int TEMPERATURE SCALE TEMPERATURE SCALE 163 This is global targets h header file Here are the global definitions for targets and environment textures ifndef_ GLOBAL TARGETS define GLOBAL TARGETS define TANK 29 define TRUCK 30 define SHIP 100 define HELO 32 define HOUSE 33 define PLANE 34 define SOIL 35 define GRASS 36 define SEA 37 define ASPHALT 38 static int TANK TANK static int_TRUCK TRUCK static int SHIP SHIP static int HELO HELO static int HOUSE HOUSE static int PLANE PLANE static int SOIL SOIL static int GRASS GRASS static int SEA SEA static int ASPHALT ASPHALT endif 164 ske ak ake ake ake ake he see ok ok ok ke de Below is the original image file definitions written by Haeberli ifndef _ IMAGE H _ IMAGE _ ifdef _ cplusplus extern C endif Defines for image fi
94. g OSF Motif The main program was implemented in C on Silicon Graphics Reality Engines H M Jn A r m _ 15 NUMBER OF PAGES 16 PRICE COD SECURITY 20 LIMITATION CLASSIFICATION OF ABSTRACT ABSTRACT UL 14 SUBJECT TERMS Infrared TV detection lock on target SECURITY 19 CLASSIFICATION OF THIS PAGE 17 SECURITY 18 CLASSIFICATION OF REPORT Unclassified Unclassified Unciassified NSN 7540 01 280 5500 1 Standard Form 298 Rev 2 89 Prescribed by ANSI Std 239 18 Approved for public release distribution 15 unlimited Three Dimensional Computer Graphics Visualization of Target Detection by Mehmet Gorgulu B S Turkish Naval Academy 1988 Mustafa Yilmaz B S Turkish Naval Academy 1988 Submitted in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE IN APPLIED PHYSICS from the NAVAL POSTGRADUATE SCHOOL December 1994 Authors Mustafa Yilmaz Approved by Richard Chris Olsen Thesis Advisor David Pratt Co Advisor airman Department of Physics 4 OR William R Colson DEIC a bsbnasusecca 1 J i 2 4 0 2 2 l C RIMIS 2 1 ex ryt 2
95. get No xmToggleButtonGadgetClass TargetRowColumn7 NULL Add Callbacks to the NotIsolated gadget XtAddCallback NotIsolated XmNvalueChangedCallback IsolationStatusCB XtPointer 0 Now manage the parent RowColumn Widget XtManageChild TargetRowColumn7 End of create target screen widgets 70 ak ak ak ake 34e ake ake ake ake aK ske ak ake ak This function creates the necessary widgets for the sensor part i of the input screen ae ake afe ake ke ke ok ok ok oke ok oe ae afe ae ake 24e 34e ake void create sensor screen widgets Widget parent Arg wargs 10 Same old args stuff This the rowcolumn that holds Sensor puldown widgets under it n 0 XtSetArg wargs n XmNtopAttachment XmATTACH_ FORM XtSetArg wargs n XmNleftAttachment XmATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH FORM n XtSetArg wargs n XmNorientation XnHORIZONTAL XtSetArg wargs n XmNnumColumns 1 n XtSetArg wargs n XmNpacking XmPACK TIGHT Widget SensorRowColumn1 XmCreateRowColumn parent SensorRowColumn1 wargs XtManageChild SensorRowColumnl1 Add a pulldown to the RowColumn n 0 Widget pulldown XmCreatePulldownMenu SensorRowColumn1 pulldown wargs Add the entr
96. get1 xmTextWidgetClass TargetRowColumn2 NULL Add Callbacks to the TextWidgetl widget XtAddCallback TextWidgetl XmNmodify VerifyCallback TargetAreaCB NULL Now manage the parent RowColumn Widget XtManageChild TargetRowColumn2 This the rowcolumn that holds TargetHeading widget under it 0 XtSetArg wargs n XmNtopAttachment XmATTACH WIDGET XtSetArg wargs n XmNtop Widget TargetRowColumn2 n XtSetArg wargs n XmNleftAttachment XmATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH FORM n XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNnumColumns 1 XtSetArg wargs n XmNpacking XmPACK TIGHT TargetRowColumn3 XmCreateRowColumn parent TargetRowColumn3 wargs n This is the Target heading gadget XtVaCreateManagedWidget Target Heading xmLabelGadgetClass TargetRowColumn3 XmNorientation XmHORIZONTAL NULL Create the text widget for the TargetHeading Widget TextWidget2 XtVaCreateManagedWidget TextWidget2 xmTextWidgetClass TargetRowColumn3 NULL Add Callbacks to the TextWidget2 widget XtAddCallback TextWidget2 XmNmodify VerifyCallback TargetHeadingCB NULL Now manage the parent RowColumn Widget XtManageChild TargetRowColumn3 This the rowcolumn that holds Target Speed widget under it 0 XtSetArg wargs n XmNtopAttachment XmATTACH WIDGET n XtSetArg wargs n XmNtopWidget
97. gma return Temp j ke she ake a ake ake afe ae ake ake ae afe afe ake afe ale ae This function modifies the position of the box that we draw to simulate the scanning function of the sensor ak sk ok oe ke afe ae ke a ae afe oj ae a ok ok oj ake ake ke oe ke ke oe oj ake ahe afe oj ale ahe ahe oe ale ke ke ok ahe ale afe afe oe ke ake afe koe ale ke ale ke afe ke joke ahe afe ale ale ak void Update ROW COLOMN int Row int Colomn if Row gt 1000 ROW 0 COLOMN COLOMN 100 if Colomn lt 0 COLOMN 900 SEARCHED ONES 1 End of if Colomn Y End of if Row else ROW ROW 100 End of Update ROW COLOMN 127 This function is called draw the scene function if the sensor is IR type E E E E void Call IR Functions i if SEARCHED ONES Then the box we are drawing to simulate the scanning doesn t completly scanned the whole display screen So go ahead and update the position of the box for the next frame draw a rectangleeROW COLOMN Update ROW COLOMN ROW COLOMN End of 5 else Yes we completed scanning the sceene ifTREAD ONES Then we haven t read the screen previously Read Screen INDEX FOR MAX RED Find Index For Max Value
98. gram for the TV and the IR part is as seen in Figure 13 and 14 For the TV part of the program what we see is close to the world as perceived by human eye The detection is determined depending on the contrast difference be tween the target and the background So what we did was we used a multi dimensional array to store the contrast values of the screen and then by finding the highest contrast box we decided that there was a detection or a lock on The criteria for detection is if the signal value of the screen pixel is above the chosen threshold level then the program gives detection If there is detection at the same screen location for a second time then it is accepted as lock on 24 B COMPONENTS OF THE PROGRAM Table 3 contains a brief overview of the files in our program The source code listings are contained in Appendix B FILE NAME DESCRIPTION EXPLANATION Ext inction Coef dat The calculated Lowtran output for atmospheric extinction coefficient NPSimage C h Image handling routines rgb files Scanned images of real objects which are used for textur ing to cover the models display list h Special OpenGL file which includes the drawing routines for the models draw support C h The functions and their declarations which handle the drawing duty of the objects eotdamain C h Main flow of the program including the interface and the physical calculations of the program eotda globals
99. he filename into the image name new char strlen img name 1 strcpy name img name Return a ptr to the new image return this The purpose of the is equal function is for comparing 2 NPSimages We return 1 if the images are equal otherwise 0 int NPSimage is_equal NPSimage amp img int i Loop temp Compare the sizes if size 0 img size 0 j size 1 img size 1 size 2 img size 2 The sizes are not equal return 0 return 0 j Compare the image data for i 0 i lt size 0 size 1 1 1 1 i if imagedata i img imagedata i There is a difference between the images return 0 we get here the images are equal Note we don t check to see if the names are equal return 1 150 The purpose of the color replace function is for changing all occurrences of the old color to the new color void NPSimage color replace unsigned int oldclr unsigned int newclr i inti Loop temp Compare the image data for i 0 i lt size 0 size 1 1 1 1 if imagedata i oldclr We have the old color replace it imagedata i newclr j j 151 This is TextureDisplayList C with necessary rgb file Authors Ltjg Mustafa YILMAZ Ltjg Mehmet GORGULU sk je e oj ke oj ak a he ke ole ok oc ok oc
100. he user control the program and which also provide information to the program Since the purpose of the program is to find the detection and the lock on range depending on the sensor parameters the user can play with the distance and the viewing angle of the target Each distance and angle provides different input to 31 the program because these parameters affect the atmospheric extinction coefficient for the program In Figure 20 the tank target is seen on the IR screen On this screen the exit button lets the user to get out of the program the input button lets the user go back to the input interface and provide new data or chance information The viewing distance slider lets the user control the distance between the sensor and the target We can visualize the target in different color scales The cyclic scale in the dis play gives detailed information about the temperature distribution on the temperature In Figures 21 22 and 23 you can see the IR screen outputs of other targets 2 Television Scene The TV scene works as does in the IR screen It is a reflection of the real world The sliders available on the screen function the same as it is in the IR screen The TV screen outputs for the implemented targets are as shown in Figure 24 25 26 and Figure 27 H PROBLEMS IN THE PROGRAMMING During our work we experienced some compile errors which are machine de pendent In some machines we had z buffer problem By adding the
101. hment XmATTACH FORM n TargetBB6 XmCreateBulletinBoard parent TargetBB6 wargs n XtManageChild TargetBB6 Create a Frame widget 0 XtSetArg wargs n XmNshadowThickness 2 n XtSetArg wargs n XmNshadowType XmSHADOW Widget TargetFrame6 XmCreateFrame TargetBB6 TargetFrame6 wargs n XtManageChild TargetFrame6 This the rowcolumn that holds Target Status widgets under it n 0 XtSetArg wargs n XmNorientation XmHORIZONTAL n XtSetArg wargs n XmNradioBehavior TRUE Widget TargetRowColumn6 XmCreateRowColumn TargetFrame6 TargetRowColumn6 wargs n Create the label for Fire Status n 0 Widget Label2 XtVaCreateManagedWidget Fire Status xmLabelGadgetClass TargetRowColumn6 NULL Here we create a Radio Button Gadget fot Fire Status Widget Fired XtVaCreateManagedWidget Fired xmToggleButtonGadgetClass TargetRowColumn6 NULL Add Callbacks to the ON gadget XtAddCallback Fired XmNvalueChangedCaliback FireStatusCB XtPointer 1 Here we create a Radio Button Gadget fot Targut Status 68 Widget NotFired XtVaCreateManagedWidget NotFired xmToggleButtonGadgetClass TargetRowColumn6 NULL Add Callbacks to the OFF gadget XtAddCallback NotFired XmNvalueChangedCallback FireStatusCB XtPointer 0 Now manage the parent RowColumn Widget XtManageChild TargetRowColumn6 Create the bulletin board widget n 0 XtS
102. ient 0 4 0 2 0 0 1 0 GLfloat gold diffuse 0 9 0 5 0 0 1 0 3 GLfloat gold specular 0 7 0 7 0 0 1 0 GLfloat gold shininess 10 0 Make the gold material calls makeGLMaterialCalls whichFace gold ambient gold diffuse gold specular gold shininess j break case SHADOW Here are the shadow values GLfloat Ambient 0 0 0 0 0 0 0 4 3 GLfloat Diffuse 0 0 0 0 0 0 0 4 3 GLfloat Specular 0 0 0 0 0 0 0 4 GLfloat Shininess 0 0 Make the shinygold material calls makeGLMaterialCalls whichFace Ambient Diffuse Specular Shininess j break case PLASTER 135 j Here are the plaster material values GLfloat plaster ambient 0 2 0 2 0 2 1 0 3 GLfloat plaster diffuse 0 95 0 95 0 95 1 0 GLfloat plaster specular 0 0 0 0 0 0 1 0 GLfloat plaster shininess 1 0 3 Make the plaster material calls makeGLMaterialCalls whichFace plaster ambient plaster diffuse plaster specular plaster shininess break case REDPLASTIC j Here are the redplastic material values GLfloat redplastic ambient 0 3 0 1 0 1 1 0 GLfloat redplastic diffuse 0 5 0 1 0 1 1 0 3 GLfloat redplastic specular 0 45 0 45 0 45 1 0 Y GLfloat redplastic shininess 30 0 3 Make the redplastic material calls makeGLMaterialCalls whichFace redplastic ambi
103. ies to the pulldown make pulldown entry pulldown IR SensorCB XtPointer amp IR make pulldown entry pulldown TV SensorCB XtPointer amp make pulldown entry pulldown LASER SensorCB XtPointer amp LASER Create the option menu that has the pulldown under it 0 XmString label string XmStringCreateSimple SENSOR XtSetArg wargs n XmNlabelString label string n XtSetArg wargs n XmNsubMenuld pulldown Widget option XmCreateOptionMenu SensorRowColumnl optionMenu3 wargs XtManageChild option XmStringFree label_ string This the rowcolumn that holds Sensor puldown widgets under it n 0 XtSetArg wargs n XmNtopAttachment FORM XtSetArg wargs n XmNleftAttachment XnATTACH WIDGET XtSetArg wargs n XmNrightAttachment XmATTACH FORM XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNleftWidget SensorRowColumn XtSetArg wargs n XmNnumColumns 1 XtSetArg wargs n XmNpacking XmPACK TIGHT n SensorRC11 XmCreateRowColumn parent SensorRC1 1 wargs XtManageChild SensorRC1 1 71 Add a pulldown to the RowColumn 0 Widget pulldown XmCreatePulldownMenu SensorRC11 1 wargs Add the entries to the pulldownl make pulldown entry pulldownl1 TEMP IR ScaleCB XtPointer amp TEMPERATURE SCALE pulldown entr
104. incr if Wind gt value lt 0 Wind gt value 0 sprintf buf d Wind gt value XtVaSet Values WindSpeedLabel XtVaTypedArg XmNlabelString XmRString buf strlen buf NULL PERFOR II This is the Change Change Time Hour Callback c ke ke ek ke ok ok oj oj oc ak ak a ke ole ole ole ak oj oc oc ke lee ae a a ak ake ok static void ChangeTimeHourCB Widget XtPointer user data XtPointer int incr int user data timedata TIME 95 char buf 8 XtVaGetValues TimeLabelHour XmNuserData amp TIME NULL TIME gt hour incr gt lt 1 TIME gt hour 1 if TIME gt hour gt 24 TIME gt hour 24 sprintf buf od TIME gt hour XtVaSet Values TimeLabelHour XtVaTypedArg XmNlabelString XmRString buf 2 NULL HOUR TIME gt hour j OA IGG Ia aI a ik This 15 the Change Time Month Callback oe fe 34e ake ae ae a afe afe afe ake joke fe afe ake 34e ake static void ChangeTimeMonthCB Widget XtPointer user data XtPointer int incr int user data timedata TIME char buf 8 XtVaGetValues TimeLabelMonth X mNuserData amp TIME NULL TIME gt month if TIME month lt 1 TIME
105. iringDistanceCB Widget XtPointer user data XtPointer static void ChangeWindSpeedCB Widget XtPointer user data XtPointer static void WindDirectionCB Widget XtPointer user data XtPointer static void AeresolCB Widget XtPointer user data XtPointer static void ChangeTimeHourCB Widget XtPointer user data XtPointer static void ChangeTimeMonthCB Widget XtPointer user data XtPointer static void ChangeTimeYearCB Widget XtPointer user data XtPointer static void LongitudeCB Widget XtPointer user data XtPointer static void LatitudeCB Widget XtPointer user data XtPointer static void CloudinessCB Widget XtPointer user data XtPointer static void FogCB Widget XtPointer XtPointer static void FogDensityCB Widget XtPointer XtPointer static void IR_ScaleCB Widget XtPointer XtPointer 156 ke joe ke EE FUNCTIONS ke eoe ok oj ke ke je ahe afe afe afe ake afe ake ale afe ake GLboolean void draw the scene void Create The Scales Widget Parent void BuildInputScreenDialog void create target screen widgets Widget Parent void create sensor screen widgets Widget Parent void create background screen widgets Widget Parent void create others screen widgets Widget Parent void create bulletin bo
106. is scale since it is different than minvalue of this scale XmScaleSetValue scale3 400 Get rid of the fontlists XmFontListFree fontlist Get rid of the Stringlists XmStringFree titleStringl XmStringFree titleString2 XmStringFree titleString3 100 Create widget to hold the push buttons n 0 XtSetArg wargs n XmNleftAttachment XmATTACH WIDGET XtSetArg wargs n XmNleftWidget bulletin board3 XtSetArg wargs n XmNnumColumns 1 nt XtSetArg wargs n XmNorientation XmVERTICAL n rc2 XmCreateRowColumn parent degree wargs n XtManageChild rc2 Create the bulletin board widget for INPUTWINDOW push button n 0 BboardForInput XmCreateBulletinBoard rc2 BboardForInput wargs n XtManageChild BboardForInput Now add an Input PushButton label string XmStringCreateLtoR INPUTWINDOW charset 0 XtSetArg wargs n XmNalignment XnALIGNMENT CENTER XtSetArg wargs n XmNlabelString label string n button XmCreatePushButton BboardForInput InputScreen wargs n XtManageChild button XmsStringFree label string Now add an Exit callback for the PushButton XtAddCallback button XmNarmCallback BackToInputScreenCB XtPointer NULL Create widget to hold the push buttons 0 XtSetArg wargs n XmNleftAttachment XmATTACH WIDGET XtSetArg wargs n XmNleftWidget rc2 XtSetArg wargs n XmNnumColumns 1
107. ite ambient 0 2 0 2 0 2 1 0 GLfloat white diffuse 1 0 1 0 1 0 1 0 3 GLfloat white specular 1 0 1 0 1 0 1 0 3 GLfloat white shininess 1 0 Make the red material calls makeGLMaterialCalls whichFace white_ambient white diffuse white_specular white shininess j break case t72mat0 i GLfloat t72mat0 ambient 0 039216 0 054902 0 039216 GLfloat t72mat0_diffuse 0 196078 0 274510 0 196078 GLfloat 72 0 000000 0 000000 0 000000 GLfloat t72mat0 shininess 0 000000 3 Make the brass material calls makeGLMaterialCalls whichFace t72mat0 ambient t72mat0 diffuse t72mat0_specular t72mat0 shininess 137 j break case 172 1 i GLfloat t72matl ambient 0 039216 0 078431 0 039216 GLfloat 72 diffuse 0 196078 0 392157 0 196078 GLfloat t72mat1 0 000000 0 000000 0 000000 GLfloat t72mat1 shininess 0 000000 3 Make the brass material calls makeGLMaterialCalls whichFace t72matl ambient 172 diffuse t72matl specular t72mat1_shininess j break case t72mat2 GLfloat t72mat2_ambient 0 039216 0 039216 0 039216 GLfloat t72mat2 diffuse 0 196078 0 196078 0 196078 GLfloat t72mat2_specular 0 000000 0 000000 0 000000 GLfloat t72mat2 shininess 0 000000 Make the brass material calls makeGLMaterialCalls whichFace t72mat2_ambi
108. ix systems if that system has the appropriate operating system and C and correct version of OpenGL libraries Computer programs similar to our project have been written by private compa nies and their work took seven years to develop This shows that there is a lot more to do on this computer program The program we wrote can be used for two purposes The first usage might be the visualization of EOTDA software output which would require that the output files of the EOTDA software be converted to the used format by the visualization program The second usage might be a generic performance tester for different sensors and en vironment conditions The user interface provided at the beginning of the program provides input to the program But some of the routines related with this input have not been developed in the program because of time constraints So these routines can be developed or im proved and the whole program can be used as a performance tester of sensors which have different construction parameters The output file of the EOTDA file contains the facet number of each facet and the corresponding temperature to this facet But the input file of our visualization pro gram includes the vertex number x y and z coordinates and temperature of this facet Since we were unable to obtain EOTDA data at the beginning of our project we cre ated our input file format and data for our own program 35 The first thing that can b
109. k ok ok ake ake ke oe ak ak ok e ke I I ei ake ake ake ake This is file eotda funcs h It is the header file for functions defined in eotda_main C file Authors Ltjg Mustafa YILMAZ Ltjg Mehmet GORGULU ke kc ok ae ke ke le kk oe oj oj le oe ke e ae oj ok fee ok ale ae ale afe ae eae ae ae ake ake a ak ake je ok ke de e ke ok ok ke ke ke CALBACKS x ak kc ake ake a ode ake oj oj ake oc ake ae je ae oe fe ok ke ke afe ake ale afe afe afe afe ake sfe afe afe ake static void rotatexCB Widget XtPointer user data XtPointer static void rotateyCB Widget XtPointer user data XtPointer static void rotatezCB Widget XtPointer user data XtPointer static void translatezCB Widget XtPointer user data XtPointer static void targetCB Widget XtPointer user data XtPointer static void Background1CB Widget XtPointer user data XtPointer static void Background2CB Widget XtPointer user data XtPointer static void Background3CB Widget XtPointer user data XtPointer static void Background4CB Widget XtPointer user data XtPointer static void SensorCB Widget XtPointer user data XtPointer static void initCB Widget w XtPointer XtPointer static void exposeCB Widget w XtPointer XtPointer static void resizeCB Widget w XtP
110. ke the brass material calls makeGLMaterialCalls whichFace t72 3mat3 ambient 172 3mat3 diffuse 72 3mat3 specular 472 3mat3 shininess break case t72 3mat4 GLfloat t72 3mat4 ambient 0 039216 0 039216 0 039216 GLfloat t72 3mat4 diffuse 0 196078 0 196078 0 196078 GLfloat 172 3mat4 specular 0 000000 0 000000 0 000000 GLfloat 172 3mat4 shininess 0 000000 Make the brass material calls makeGLMaterialCalls whichFace t72 3mat4 ambient 172 3mat4 diffuse t72 3mat4 specular U2 3mat4 shininess break case SUN Here are the pewter material values GLfloat SUN ambient 1 0 1 0 1 0 1 0 GLfloat SUN diffuse 1 0 1 0 1 0 1 0 3 140 GLfloat SUN specular 1 0 1 0 1 0 1 0 3 GLfloat SUN shininess 500 0 GLfloat SUN emission 1 0 1 0 1 0 1 0 3 Make the pewter material calls makeGLSunMaterialCalls whichFace SUN ambient SUN diffuse SUN specular SUN shininess SUN emission j break default break end switch statement Here is the function called from turnOnMaterial void makeGLMaterialCalls GLenum whichFace GLfloat ambient GLfloat diffuse GLfloat specular GLfloat shininess Make the material calls glMaterialfv whichFace GL AMBIENT ambient glMaterialfv whichFace DIFFUSE diffuse glMaterialfv whichFace GL SPECULAR specular glMaterialfv whichFace GL SHINI
111. les T Paul Haeberli 1984 in usr people 4D gifts iristools imgtools for example code include lt stdio h gt define IMAGIC 0732 colormap of images define CM NORMAL 0 file contains rows of values which are either RGB values zsize 3 or greyramp values zsize 1 define CM DITHERED define CM SCREEN 2 file contains data which is a screen image getrow returns buffer which can be displayed directly with writepixels define CM COLORMAP 3 a colormap file define TYPEMASK Oxff00 define BPPMASK OxOOff ITYPE VERBATIM 0x0000 define ITYPE RLE 0x0100 ISRLE type type amp Oxff00 ITYPE RLE define ISVERBATIM type type amp Oxff00 ITYPE VERBATIM define BPP type type amp BPPMASK define RLE bpp ITYPE RLE define VERBATIM bpp ITYPE VERBATIM bpp define IBUFSIZE pixels pixels pixels gt gt 6 lt lt 2 define 0 00 define ierror p p flags amp 0 ifileno p p gt file define getpix p p gt cnt gt 0 p gt ptr ifilbuf p define putpix p x p gt cnt gt 0 7 Cint p gt ptr unsigned x iflsbuf p unsigned x typedef struct 4 unsigned short imagic _ stuff saved on disk 165 unsigned short type unsigned short dim unsigned short XSiZe unsigned sh
112. lete it NPSimage NPSimage We haven t been given an image size Create a default image size 0 size 1 8 size 2 Pt the image data at a simple 8 x 8 x 4 image imagedata new unsigned int size 0 size 1 No name for the image yet name new char 8 144 strcpy name default Here is the destructor for an NPSimage NPSimage NPSimage Call the del function del Delete the image void NPSimage del i Delete the image data if it exists if imagedata 0 i delete imagedata j Delete the image s name if it exists if name 0 delete name j Create an empty image of a particular size We pass in the name and size of the image to create NPSimage NPSimage char name img int size img i If an NPSimage is previously defined delete it NPSimage NPSimage Create an image Copy the size size 0 size_img 0 size 1 size_img 1 size 2 size img 2 145 Allocate an image of the appropriate size imagedata new unsigned int size 0 size 1 No name for the image yet name new char strlen name img 1 strcpy name name img Create an empty image of a particular size We pass in the name and size of the image to create NPSimage NPSimage char name img int xsize int ysize int zsize i If an NPSimage is previously defined delete it NPSimage
113. line XtSetArg wargs n GLwNdepthSize 1 n in the main program we got rid of this problem This line initializes the z buffer to a depth of 1 pixel We also observed that some of the scanned rgb files could not be read in some machines because of the difference in the graphics file We saw that using dis play lists in OpenGL programming boosts the program So all texturing and hypertext fonts are encapsulated of display lists We observed that as the size of the program ex pands the program becomes more increasingly error prone To write error free programs we applied the following useful software engi neering techniques Modulation Encapsulation to bottom design Testing by control loops 32 Well documentation Testing of each unit separately 33 34 VI SUMMARY AND CONCLUSIONS The work which has been presented in this thesis is a visualization of IR and TV detection systems This work was started with the intention of writing a visualiza tion part of the EOTDA software Due to the lack of real data the project turned out to be a generic program for IR and TV sensors The program was written in C with OpenGL programming techniques and OpenGL graphics library functions The interface part of the program was written in and with OSF Motif library function The whole program was implemented un der Unix operating system and the program can be transferred to other Un
114. lists for use in drawing fonts Y je ede je oe oj ake ae de oe e ke ke ke je oj af oe hehe je ole sje sje be be ode ke ke oe oe ale ae afe ke a ae afe ae he GLuint makeRasterFont Widget w char fontname i XFontStruct fontInfo ptr to an X font Font id Font id unsigned int first last first and last char of the font GLuint base The base of the display lists See if we can load the X font fontInfo XLoadQueryFont XtDisplay w fontname Did we get a font if fontinfo NULL i cerr lt lt makeRasterFont font not found lt lt fontname lt lt endl exit 0 j Get the font id id fontInfo gt fid Get some ptr info for the font first fontInfo min char or byte2 last fontInfo max char or byte2 Compute the display lists for the font base glGenLists last 1 142 if base 0 t cerr lt lt makeRasterFont out of display list lt lt endl exit 0 Create bitmap display lists from an X font gIXUseXFont id first last first 1 base first Return base return base end of makeRasterFont IOI oo drawCharstring GLuint base char s draw the char string with the specified set of display lists baseis the value returned from makeRasterFont essentially the base of a set of display lists
115. ll value gt value Firing Distance tz 1f the sensor is IR then we must modify the color table if SENSOR First Find the mu value mu Calculate Extinction Now modify the color table with previous Firing Distance for int index 0 index lt VERTICE NUM index i Temp Original Temp index 0 total radiance Find Total Radiance Temp Temp Temp At Sensor total radiance mu Temperature index 0 Temp Fill Up Color Table index MODE Y End of for loop End of if clause Modify the state control variables SEARCHED ONES 0 READ ONES 0 ROW 0 COLOMN 900 OLD X MAX X OLD MAX Y MAX MAX RED 0 0 Max Contrast Of Scene 0 Y End of translatezCB kc afe ake fe a alc ope ae afe sje afc ae ole sje af of e ale oe oe sje ale ok afe afe afe afe ok afe afe fe oe ode oe ae afe ae afe ok ok ode afe ac afe ooo drawWP This function is called by the work procedure It is called repeatedly whenever there are no events to process This function returns FALSE so that the work procedure does NOT stop calling it abe ke ok oe sk oj be ak ae oj oj o e e e oj oj je je ke je oe ok afe ale afe ae ke a ke he be ke oe oe afe ale ke ke ake ake ale ake ale ale ke ke ae ea ake 108 GLboolean drawWP ifDISPLAY ENABLED draw the scene
116. m brightness C GL where is the maximum gray level 15 the mini mum gray level Ref 6 More information about the detection algorithm of TV sen sors can be found in Chapter V 4 Extinction Coefficient The performance of military systems for imaging target detection tracking target designation and warning is strongly dependent on the transmission of the me dium The important atmospheric effects to be dealt with are refraction absorption and scattering by the molecular constituents of the atmosphere Ref 5 The transmission characteristics of the medium in the measurement path be tween the target and the detector need to be considered in making noncontact meas urements No loss of energy is encountered when measuring through a vacuum The atmosphere however does not allow transmission in every band As seen in the Figure 8 5 there are two spectral intervals which have high transmission These are located in the 3 5 um and 8 12 um wavelength range The IR sensors are built to scan in one of these atmospheric windows The effect of the atmosphere on the signal is represented by the extinction coef ficient which is the sum of the coefficients for total absorption and total scattering k k and w o o 6 Ref 7 where k molecular absorption coefficient k aerosol coefficient molecular scattering coefficient aerosol scattering coefficient In real world conditions there are many
117. m the frame buffer with 100 by 100 square and finds the maximum and minimum illuminated pixel in that square and finds a contrast value for that square by subtructing the max from min illumination value After finding the contrast values for all squares it picks up the max contrast of the screen ROR IO I I a I o ak ak ok fc le ak ok oe ok oj e af ak ake a ak ak ae void Read_TV_Screen int max_contrast 0 min_contrast 255 int max_contrast_x max_contrast_y min_contrast_x min_contrast_y float Contrast 110 int index 0 for int y 800 gt 100 y y 100 for int x 100 x lt 900 x x 100 glReadPixels x y 100 100 GL LUMINANCE GL UNSIGNED BYTE buffer2 for int counter 0 counter lt 10000 counter i if int buffer2 counter gt max contrast i max contrast int buffer2 counter max contrast max contrast if int buffer2 counter lt min contrast min contrast int buffer2 counter min contrast x X min contrast End of for counter Contrast index max contrast min contrast if Contrast index gt Max Contrast Of Max Contrast Of Scene Contrast index Max Contrast X max contrast x Max Contrast Y max contrast of if Initialize the values for comparison purposes If they are not initializ
118. me TargetBB5 5 wargs n XtManageChild TargetFrame5 This the rowcolumn that holds Target Status widgets under it 0 XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNpacking XmPACK TIGHT XtSetArg wargs n XmNradioBehavior TRUE Widget TargetRowColumn5 XmCreateRowColumn TargetFrame5 TargetRowColumn5 wargs n Create the label for Engine Status 0 Widget Label XtVaCreateManagedWidget Engine Status xmLabelGadgetClass TargetRowColumn5 NULL Here we create a Radio Button Gadget for Engine Status Widget EngineOn XtVaCreateManagedWidget EngineOn xmToggleButtonGadgetClass TargetRowColumn5 NULL Add Callbacks to the ON gadget XtAddCallback EngineOn XmNvalueChangedCallback EngineStatusCB XtPointer 1 67 Here we create a Radio Button Gadget fot Targut Status Widget EngineOff XtVaCreateManagedWidget EngineOff xmToggleButtonGadgetClass TargetRowColumn5 NULL Add Callbacks to the OFF gadget XtAddCallback EngineOff XmNvalueChangedCallback EngineStatusCB XtPointer 0 Now manage the parent RowColumn Widget XtManageChild TargetRowColumn5 Create the bulletin board widget n 0 XtSetArg wargs n XmNtopAttachment XmATTACH WIDGET XtSetArg wargs n XmNtopWidget TargetBB5 XtSetArg wargs n XmNleftAttachment XmATTACH FORM XtSetArg wargs n XmNrightAttac
119. mperature with colors For this there is a temperature scale on the screen and the colors correspond to different temperature values of the pixels To implement the IR part of the program we intended to write a program that simulates a generic IR sensor We created some 3 D targets and applied color values to each vertex of these targets This color on the target was interpolated from vertex to vertex and for each pixel on the screen between two points the temperature was ex trapolated by the OpenGL software according to Gouraud shading as seen in Figure 18 12 This automatically provides an interpolated temperature distribution on the sur faces of the targets Since the radiated target temperature changes depending on the distance and angle between the target and the sensor the color on each surface of the target changes as we increase or decrease the distance The reason for this change is the at mospheric extinction The program reads in the initial data file Prior to drawing the object the temperature value of each vertex 1s converted to a power value and extinc tion is applied to this power to calculate the power at sensor The power at the sensor is converted back to temperature values These temperature values are used as input parameters to figure out the color values from a look up table These color values are applied to the related vertices and the color of the whole target is changed The IR model depends on the rel
120. must modify the color table if SENSOR First Find the Extinction coeficient value mu Calculate Extinction Now modify the color table with previous Firing Distance for int index 0 index VERTICE NUM index 93 Temp Original Temp index 0 total radiance Find Total Radiance Temp Temp Temp At Sensor total radiance mu Temperature index 0 Temp Fill Up Color Table index MODE Y End of for loop End of if clause Here reset the state control variables DISPLAY ENABLED 1 SEARCHED ONES 0 READ ONES 0 OLD MAX X 1 OLD MAX Y 1 X 0 MAX Y 0 MAX RED 0 0 ROW 0 COLOMN 900 Max Contrast Of Scene 0 End of Display CallBack 94 ak kkk ak ak k ak 3k These following callbacks not used in the program but since the interface has already been designed the necessary callbacs are defined but no action has been taken They kept for future use static void materialCB Widget XtPointer XtPointer static void TargetAreaCB Widget XtPointer XtPointer static void TargetHeadingCB Widget XtPointer XtPointer static void TargetSpeedCB Widget XtPointer XtPointer static void EngineStatusCB Widget XtPointer XtPointer static void FireStatusCB Widget XtPointer XtPointe
121. n XtManageChild sep Create the bulletin board3 widget n 0 XtSetArg wargs n XmNleftAttachment XnATTACH WIDGET XtSetArg wargs n XmNleftWidget bulletin board2 XtSetArg wargs n XmNbottomAttachment XmATTACH FORM XtSetArg wargs n XmNbottomOffset 2 n bulletin_board3 XmCreateBulletinBoard parent bulletin3 wargs n XtManageChild bulletin board3 Create a Frame widget to make it so we can resize the window 0 XtSetArg wargs n XmNshadowThickness 2 XtSetArg wargs n XmNshadowType XmSHADOW IN Widget frame3 XmCreateFrame bulletin board3 frame3 wargs n XtManageChild frame3 Set up arglist and create the scale3 n 0 XtSetArg wargs n XmNfontList fontlist ntt XtSetArg wargs n XmNshow Value True ntt XtSetArg wargs n XmNtitleString titleString3 XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNminimum 0 n XtSetArg wargs n XmNvalue 400 n XtSetArg wargs n XmNmaximum 400 n XtSetArg wargs n XmNdecimalPoints 2 XtSetArg wargs n XmNprocessingDirection XnMAX ON RIGHT scale3 XmCreateScale frame3 scale3 wargs n XtManageChild scale3 Add the callbacks XtAddCallback scale3 XmNvalueChangedCallback translatezCB XtPointer NULL XtAddCallback scale3 XmNdragCallback translatezCB XtPointer NULL Here we set the initial value of th
122. n make pulldown entry pulldown SOIL Background1CB XtPointer amp SOIL make pulldown entry pulldown GRASS Background2CB XtPointer amp 55 make pulldown entry pulldown SEA Background3CB XtPointer amp SEA make pulldown entry pulldown ASPHALT Background4CB XtPointer amp ASPHALT Create the option menu that has the pulldown under it n 0 78 String string BACKGROUND label string XmStringCreate stringl XtSetArg wargs n XmNlabelString label string n XtSetArg wargs n XmNsubMenuld pulldown n Widget option XmCreateOptionMenu BackgroundRowColumnl optionMenu2 wargs n XtManageChild option Free the label string XmStringFree label string Here manage the widget XtManageChild BackgroundRowColumn1 This the form that holds Display widget under it n 0 XtSetArg wargs n XmNfractionBase 16 n XtSetArg wargs n XmNbottomAttachment XmATTACH FORM XtSetArg wargs n XmNtopAttachment XmATTACH_ POSITION XtSetArg wargs n XmNleftAttachment XnATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH FORM XtSetArg wargs n XmNtopPosition 30 Widget Backgroundform3 XmCreateForm parent Backgroundform3 wargs XtManageChild Backgroundform3 Here define a rowcolumn widget for display 0 XtSetArg wargs n XmNtopAttachment XmATTACH POSITION XtSetArg wargs n
123. n first when the program is executed When the Display button is pressed on this screen the InputWindow widget is unmanaged and DisplayWindow widget is managed so we will see the graphical display 3e ake ake 3k 3 void BuildInputScreenDialog i Widge Locally defined container widget All other child widgets IC2 IC 124 Arg wargs 15 Args used with XtSetArg below Here is the global form that holds four different forms under it n Q XtSetArg wargs n XmNfractionBase 40 n InputWindow XmCreateForm MainWindow InputWindow wargs n XtManageChild Input Window This the form that holds target related widgets under it n 0 XtSetArg wargs n XmNfractionBase 20 XtSetArg wargs n XmNtopAttachment XmATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH POSITION XtSetArg wargs n XmNrightPosition 20 n XtSetArg wargs n XmNbottomAttachment XmATTACH POSITION n XtSetArg wargs n XmNbottomPosition 20 XtSetArg wargs n XmNleftAttachment XmATTACH FORM Widget TargetForm XmCreateForm InputWindow TargetForm wargs n XtManageChild TargetForm Create the target related widgets here create target screen widgets TargetForm This the form that holds sensor related widgets under it 0 XtSetArg wargs n XmNfractionBase 20 n XtSetArg wa
124. n of information is estimated to average 1 hour per response including the time for reviewing instruction searching existing data sources gathering and maintaining the data needed and completing and reviewing the collection of information Send comments regarding this burden estimate or any other aspect of this collection of information including suggestions for reducing this burden to Washington headquarters Services Directorate for Information Operations and Reports 1215 Jefferson Davis Highway Suite 1204 Arlington VA 22202 4302 and to the Office of Management and Budget Paperwork Reduction Project 0704 0188 Washington DC 20503 1 AGENCY USE ONLY Leave blank 3 REPORT TYPE AND DATES COVERED Master s Thesis 2 REPORT DATE December 1994 4 TITLE AND SUBTITLE Three Dimensional Computer Graphics Visualization Of 5 FUNDING NUMBERS Target Detection UNCLASSIFIED 6 AUTHOR S Mehmet Gorg l Mustafa Yilmaz 7 PERFORMING ORGANIZATION NAME S AND ADDRESS ES Naval Postgraduate School Monterey CA 93943 5000 9 SPONSORING MONITORING AGENCY NAME S AND ADDRESS ES 8 PERFORMING ORGANIZATION REPORT NUMBER 10 SPONSORING MONITORING AGENCY REPORT NUMBER 11 SUPPLEMENTARY NOTES The views expressed in this thesis are those of the author and do not reflect the official policy or position of the Department of Defense or the U S Government 12b DISTRIBUTION
125. nCB NULL This is the Aeresol gadget XtVaCreateManagedWidget Aeresol xmLabelGadgetClass BackgroundRC4 XmNorientation XmHORIZONTAL NULL Create the text widget for the Aeresol Widget Aeresol XtVaCreateManagedWidget Aeresol xmTextWidgetClass BackgroundRC4 NULL Add Callbacks to the Aeresol widget XtAddCallback Aeresol XmNmodify VerifyCallback AeresolCB NULL Now manage the parent RowColumn Widget XtManageChild BackgroundRC4 Here define a rowcolumn widget for wind direction 1 n 0 XtSetArg wargs n XmNtopAttachment XnATTACH WIDGET XtSetArg wargs n XmNleftAttachment XmATTACH FORM n XtSetArg wargs n XmNrightAttachment XmATTACH FORM n XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNtopWidget BackgroundRC4 XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNentry VerticalAlignment XmALIGNMENT_CONTENTS_TOP n Widget BackgroundRC41 XmCreateRowColumn Backgroundform2 BackgroundRC41 wargs n This is the Lat Long gadget XtVaCreateManaged Widget Latitude xmLabelGadgetClass BackgroundRC41 XmNorientation XmHORIZONTAL NULL Create the text widget for the Latitude Widget Latitude XtVaCreateManagedWidget Latitude xmTextWidgetClass BackgroundRC41 NULL Add Callbacks to the Latitude widget XtAddCallback Latitude XmNmodify VerifyCallback LatitudeCB NULL This i
126. nctions finclude drawsupport funcs h Get the drawing functions include texturesupport funcs h Get the texture support functions include TextureDisplayList h include eotda funcs h Get this program s function declarations include eotda main h Get the variables and others for main program finclude global targets h Get the globals for this program include makeRasterFont h Get the font support routines include NPSimage h Get the NPS image class definition define COMMON _ include eotda globals h winddata wind Create an object for winddata class timedata Time of Create an object for timedata class static GLuint fontHandlel fontHandle2 Base of font display lists char buffer1 10000 Buffer for pixel red color values 100x100 buffer2 10000 Buffer for pixel luminance values 100x100 58 void main int argc char argv i XmString message string Compound strings Arg wargs 15 Args used with XtSetArg below message string XmStringCreateLtoR Please Wait Initializing the Display Lists charset Fallback resources for the application static GLbyte fallback resources form background SGISlateBlue usr lib rgb txt frame shadowType SHADOW IN elwidget width 1400 elwidget height 900 olwidget rgba TRUE elwidget doublebuffer TRUE slwidget allocateBackground TRUE eotda_main geometr
127. nd varies linearly with temperature Figure 1 and also Ref 13 page 121 The result of Equation 2 gives the radiation at zero range The radiance we can use is the radiance normal to the surface of the target and this is found by dividing total radiant energy by t So N W n being the irradiance of the surface Then the irradiance of the surface at a given range R from the object is _ WAo _NAo 2 RP W m 4 Ref 5 In this equation R is the distance between the target and the sensor and A is the projectional area of the target on the sensor The energy at the sensor is calculated by multiplying the energy at the target by the atmospheric transmission fac tor In our program we did not assume that the effect of atmospheric extinction was simply inversely quadratic We found the atmospheric extinction by using the Lowtran 6 code described below This software gave us the atmospheric extinction coefficient The energy which is sensed by the sensor is also dependent on the projection area of the target on the sensor The reason for target area dependency and how to calculate the projection area can be understood from Figure 2 The equation to calcu late the projection area of the target is as in Equation 5 A l h cos0 coso w h cosO sino 1 w sinO 5 Ref 5 In this equation A is the projected area of the target is the elevation angle is the azimuth angle is the length of the target w is the width o
128. ndList glNewList Index 5 GL COMPILE makeGL TextureFromImagefile clouds2 rgb glEndL ist glNewList Index 6 61 COMPILE makeGL TextureFromImagefile rocks rgb glEndList glNewList Index 7 GL_COMPILE makeGLTextureFromImagefile window rgb glEndList glNewList Index 8 GL_COMPILE makeGLTextureFromImagefile roof rgb glEndList glNewList Index 9 GL_COMPILE makeGL TextureFromImagefile wood rgb glEndList glNewList Index 10 GL COMPILE makeGLTextureFromImagefile city rgb glEndListQ 153 ke oj ke oe ok oe ke oe oj je oe kc IO IO IOI je je oj dee je le le je le oj ole oj ookko kk This is drawsupport funcs h header file This header file is included only in drawsupport C file AI IATA void drawTarget int Target no float x float y 2 void drawGround float x float y float z int Terrain int Mode void DrawTheSun int TIME void DrawTheColorScale int MODE void DrawTheSyclicColorScale void drawSphere float x float y float 2 float radius int nslices int nstacks void draw a rectangle int x int y vid DrawTheMoutains int Mode void drawCube float x float y float z float sidelength void drawTargetShadow int Target_no float x float y float z void update_green_blue double RGB_ARRAY int MODE 154 ose khe ke ke kk ak a e ok ke ke oe ook o
129. ng the energy value to temperature value Hence we converted this energy value to the corresponding temperature value This corresponding temperature value is loaded into the current temperature array and the corresponding color is loaded into the color matrix Then this color value is applied to this point for the next drawing cycle The same cycle is applied to all of the vertices on the target successively This procedure is the same for all the IR targets After this procedure is done the next step is to scan the screen for detection and lock on At the beginning of the program when we run the program the program loads the arrays by reading data from the initial target files The flow of data during the ini tialization phase of the program as shown in Figure 16 In Figure 16 we can see what happens in the program when it is run The first thing which is done in the program is to read the related target initialization data file The data stored in these files are required for the initial visualization of the target If the program is connected to another program like EOTDA software and the output of the EOTDA software is provided in the same format then would work as the initial target data The target initialization files contain data according to the sorted vertex num bers Each of the targets in the program is formed of a lot of vertices and data is 27 stored in these vertices In this file data is in the order of vert
130. ng with computers With the help of rapidly improving technology we can put highly detailed graphics on our computer screens instead of only text char acters It has been shown that human perception is very high to visually presented data result computer graphics and visualization of data have been gaining an in creasing importance in representing data visually Ref 3 Military platforms need sensors to perform their functions These sensors are expensive to build and their performance is highly dependent on the environmental conditions and sensor characteristics Any change in these characteristics changes the performance of sensors and the ability of a sensor to perform its targeting function Our work simulates this process and allows the study of the sensor performance at low cost while varying environmental conditions For our work we chose generic targets and backgrounds We began with the physics problem of calculating the atmospheric absorption depending on the range an gle and wavelength and target projection area We calculated the radiation for each node of the target and then found the power radiated by the target By applying at mospheric extinction to this signal we computed the signal level at the sensor The temperature level at the sensor determined the temperature distribution on the target The contrast value between the target and the background established the detection criteria for the target There are differe
131. nt detection algorithms for the detection of the targets These detection algorithms were examined and cross box technique was ap plied in the program Different computer graphics techniques were used in the gram to be able to visualize the IR and TV scene and to be as close to reality as possible B CHAPTER LAYOUT Chapter II discusses the background and previous work in this area It talks about the theory behind the modeling different computer graphics and target visualiza tion methods and the atmospheric extinction coefficient The calculation of the atmos pheric extinction coefficient and the use of Lowtran 6 including the reasons are described in this part Chapter III defines the problem and presents our assumptions Chapter IV is an examination of the design decisions and the tools It also covers the data structures for IR and TV sensors Chapter V talks about the logical flow of the program and the components of the program some of the problems and results Chapter VI outlines the achievements in the program and makes suggestions on the future work of the pro gram Supplementary and detailed information about the program is presented in the Appendices II PREVIOUS AND RELATED WORK A INTRODUCTION A basic military problem in warfare is determining engagement ranges for weapon systems Engagement is dependent on detection and recognition The factors which affect the engagement range are e
132. nvironmental conditions sensor characteris tics and the platforms which the sensor is on One tool which is used to prepare for engagement is the EOTDA Electro Optical Tactical Decision Aid Software This software has three sensor elements Infra red TV and laser There is a user interface to the program and data 1s provided to the program by this interface This data includes the sensor type environmental data and target type and target information The program calculates the sensor lock on range The calculated data is displayed on the screen The advantage of this pro gram is it gives a good estimate of the detection and the lock on range The disadvan tage is it was implemented on a PC Hughes Aircraft Corporation implemented this program in Unix environment but our brief Experience showed the program was not transportable We planned to work with the EOTDA software and design a 3 D visualization of the EOTDA output Unfortunately the software is not allowed to be released to non U S officers allies In line with our original intention we decided to build some generic targets and backgrounds and then work on detection ranges with generic IR and TV sensors We modeled a tank an aircraft a ship and a building target with four possible backgrounds soil grass concrete and sea We designed the program so that the user could choose the initial conditions for the program and then set the environment The purpose of the user is to det
133. of the SGI Gouraud shading capability to establish the temperature distribution for IR targets a second was use of the hardware screen projection to map from 3 D to 2 D For further work this program can be integrated to the EOTDA Electro optical Tactical Decision Aid software The graphics part of the program was written by using OpenGL graphics library and the user interface was implemented by using OSF Motif The main program was implemented in C on Silicon Graphics Reality Engines TABLE OF CONTENTS INTRODUCTION scqcccsurencoadiicdsezoreseisierege Bits 1 A BRIEF DESCRIPTION OF OUR WORK 1 By CHAPTER LAYOUT dU ORDRES UC wart 2 PREVIOUS AND RELATED WORK 3 A INTRODUCTION eR ram x SG 3 THEORY maa dA ns ita 4 1 Heat And Temperature 4 2 Infrared FRadialiOl oon ipea re tr da ________ era 5 3 Visual Wavelength Signals 7 4 GOCTICIONY deb 8 2 EOW aN seeria as 9 6 The Detectors And The Detection Algorithms 10 COMPUTER GRAPHICS 11 1 Visualizing 3 D Target 11 2 Texturing Lighting Shading And Fog 12 a
134. of the internal energy of the matter Heat always flows from the object which is at the higher temperature to the object which is at the lower temperature This is the princi ple governing the heat transfer between a target heat source and a sensor Ref 14 There are three models of heat transfer conduction convection and radiation All heat transfer processes occur by one or more of these three modes Infrared meas urement is based on the radiative heat flow and is most closely related to the radiation mode of heat transfer Ref 14 Radiative heat transfer can take place across a vacuum and it occurs by electro magnetic emission and absorption It occurs at the speed of light and the energy transferred is proportional to the difference of the fourth power of the temperature The bulk of the transport takes place in the infrared portion of the spectrum from 0 75 to 100 Ref 14 2 Infrared Radiation The measurement of thermal infrared radiation is the basis for non contact tem perature measurement and thermography The thermal infrared radiation leaving a sur face is called exitance radiosity Every object in nature emits wavelengths corresponding to its temperature It is easy to get a temperature signature of an emitting object The IR sensors are less susceptible to atmospheric conditions and the frequency which the terrestial objects emit generally falls into IR frequency range These are some of the fundamental rea
135. ointer XtPointer call data static void inputCB Widget XtPointer XtPointer call data static void quitCB Widget w XtPointer XtPointer static void newviewCB Widget XtPointer XtPointer static void DisplayCB Widget XtPointer XtPointer static void BackToInputScreenCB Widget XtPointer XtPointer static void materialCB Widget XtPointer user data XtPointer static void TargetAreaCB Widget XtPointer user data XtPointer 155 static void TargetHeadingCB Widget XtPointer user data XtPointer static void TargetSpeedCB Widget XtPointer user data XtPointer static void FireStatusCB Widget XtPointer user data XtPointer static void EngineStatusCB Widget XtPointer user data XtPointer static void IsolationStatusCB Widget XtPointer user data static void RelativeApertureCB Widget XtPointer user data XtPointer static void ApertureDramCB Widget XtPointer user data XtPointer static void MagnificationCB Widget XtPointer user data XtPointer static void OpticalTransmittanceCB Widget XtPointer user data XtPointer static void ElectronicBandwidthCB Widget XtPointer user data XtPointer static void SensorHeightCB Widget XtPointer user data XtPointer static void DetectivityCB Widget XtPointer user data XtPointer static void DetectorElementsCB Widget XtPointer user data XtPointer static void FiringAngleCB Widget XtPointer user data XtPointer static void F
136. olor Vertice no 2 1 0 Color Vertice 3 1 0 return 1 j if Temperature Vertice_no 0 gt 10 amp amp Temperature Vertice no 0 lt 15 Dirty Green i red 1 0 16 0 COLOR MODE SYCLIC SCALE Modify Color Array With A Given Mode Vertice no COLOR MODE red j else Color Vertice no 0 0 0625 Color Vertice no 1 0 3137 Color Vertice 2 0 0 Color Vertice no 3 1 0 j return 1 if Temperature Vertice no 0 gt 15 amp amp Temperature Vertice no 0 lt 20y Light Green i red 2 0 16 0 if COLOR MODE SYCLIC SCALE Modify Color Array With A Given Mode Vertice no COLOR MODE red else 4 Color Vertice no 0 0 1250 117 Color Vertice no 1 0 8784 Color Vertice no 2 0 0 Color Vertice no 3 1 0 return 1 if Temperature Vertice no 0 gt 20 amp amp Temperature Vertice no 0 lt 25 Blue red 3 0 16 0 if COLOR MODE SYCLIC SCALE Modify Color Array With A Given Mode Vertice no COLOR red else 14 Color Vertice no 0 0 1875 Color Vertice 1 1 0 Color Vertice no 2 1 0 Color Vertice 3 1 0 return 1 if Temperature Vertice no 0 gt 25 amp amp Temperature Vertice no 0 lt 30 Brown red 4 0 16 0 if COLOR MODE SYCLIC SCALE Modify Color Array With A Given Mode Vertice no COLOR red else 4 Color Vertice no 0 0 25 Color Vertice no 1
137. orithm 42 Figure 10 The Super Slice Algorithm THE RADIATION MEDIUM X Sensor b Atmospheric Conditions Figure 11 The Radiation Medium Figure 12 Automatic application of the Gouraud Shading by hardware 43 MAKE SELECTION FROM INTERFACE FILL UP ARRAYS CALCULATE EXTINCTION AND NEW TEMPERATURE DISPLAY TARGET READ THE WHOLE SCREEN NO DISPLAY R VALUE ABOVE THRESHOLD NO CHECK THE SLIDERS YES DETECTION LOCK ON Figure 13 Infrared Sensor Logic Flow Chart 44 MAKE SELECTION START FROM INTERFACE READ SCREEN BOX AND FIND LUMINANCE CALCULATE EXTINCTION AND NEW CONTRAST FILL THE ARRAY YES FIND THE HIGHEST CONTRAST PLOT THE YES Figure 14 TV sensor Logic Flow Diagram 45 vertex no x coord y coord 2 coord Initial Temp Figure 15 Input File Format VERTEX INITIALTARGETFILE DAT VERTEX X COORD YCOORD ZCOORD INITIAL_TEMPERATURE VERTEX TEMPERATURE Display N is the number of vertices in a target file Figure 16 Process of Data in the Program 46 200 y 200 Total Number of Scan Boxes is 28 Figure 17 Scanning Box on the Screen Figure 18 Storage of Contrast Values from the Screen 47 73 7 e Nt NEAN NAI SLE v 2 NS Ly RRR CIE EN Do 2 2 572255575752
138. ort unsigned short 75172 unsigned long min unsigned long max unsigned long wastebytes char 80 unsigned long colormap long file stuff used in core only unsigned short flags short dorev short X short y short 7 short cnt unsigned short ptr unsigned short base unsigned short tmpbuf unsigned long offset unsigned long rleend for rle images unsigned long rowstart for rle images long rOWsize for rle images IMAGE IMAGE icreate M iopen char file char mode unsigned int type unsigned int dim unsigned int xsize unsigned int ysize unsigned int zsize fiopen int f char mode unsigned int type unsigned int dim unsigned int xsize unsigned int ysize unsigned int zsize while iopen and fiopen can take extended set of parameters the last five are optional so a more correct prototype would be IMAGE iopen char file char mode IMAGE fiopen int f char mode unsigned short ibufalloc IMAGE image int ifilbuf IMAGE int iflush IMAGE image unsigned int iflsbuf IMAGE image unsibned int C void isetname IMAGE image char name void isetcolormap IMAGE image int colormap int iclose IMAGE image int putrow IMAGE image unsigned short buffer unsigned int y unsigned int z int getrow IMAGE image unsigned short buff
139. our program we used texturing in the TV part to be able to get a real reflection of the world In this part of the program we used dif ferent textures to cover the environment and the objects Ref 3 12 b Lighting As in nature in computer graphics everything reflects light and color For the reflection of light there must be a light source In nature the light source is the sun In computer graphics the light source is created by the programmer Lighting is required to give the objects a three dimensional and real effect To use a shading model for 3 D objects there must be a lighting model Ambient diffuse and specular illumination models are used in developed systems In the real world the perception of the eye depends on the distribution of photon energies that arrive and trigger the cone cells in the eye The photons come from a light source and these are either reflected or transmitted This forms the basic idea of lighting in OpenGL Ref 10 c Shading Shading is a result of lighting There are two types of shading constant and Gouraud In constant shading a single color is computed for an entire polygon based on the position of the light source and the normal vector of the polygon Gouraud shading implies evaluating the illumination at each pixel level The applica tion of the shading to the objects gives them a realistic appearance The shading model is used to calculate the intensity of the light at each pixel
140. owColumn Widget XtManageChild SensorRowColumn6 74 This the rowcolumn that holds Sensor Height widget under it 0 XtSetArg wargs n XmNtopAttachment XmATTACH WIDGET XtSetArg wargs n XmNtopWidget SensorRowColumn6 XtSetArg wargs n XmNleftAttachment XnATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH FORM XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNnumColumns 1 n XtSetArg wargs n XmNpacking XmPACK TIGHT Widget SensorRowColumn XmCreateRowColumn parent SensorRowColumn7 wargs n This is the Relative Aperture gadget XtVaCreateManagedWidget Sensor Height xmLabelGadgetClass SensorRowColumn7 XmNorientation XmHORIZONTAL NULL Create the text widget for the Relative Aperture Widget TextWidget6 XtVaCreateManaged Widget Text Widget6 xmTextWidgetClass SensorRowColumn7 NULL Add Callbacks to the TextWidget6 widget XtAddCallback TextWidget6 XmNmodify Verify Callback SensorHeightCB NULL Now manage the parent RowColumn Widget XtManageChild SensorRowColumn7 This the rowcolumn that holds Detectivity widget under it 0 XtSetArg wargs n XmNtopAttachment XmATTACH WIDGET XtSetArg wargs n XmNtopWidget SensorRowColumn7 n XtSetArg wargs n XmNleftAttachment XmATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH FORM XtSetArg wargs n XmNorientation
141. parated the problem into two general subsections at the beginning For the IR part of the program the main hardship was first to be able to calcu late the energy for the target model second to represent of the temperature with the corresponding color value To be able to solve these we accepted a temperature range which can be expressed by the color Table 3 R VALUE G VALUE o Diny Green 09 demens EN Dako 99 a 075 Diny Pink om _ Cmdm oss 1 75 __ p ooa 0 80 lt lt 85 NEN Table 3 Temperature Color Values for the IR Part of the Program 38 0 5 1 4 1 1 oa erem 537 The colors in this table were loaded into array according to the temperature distribution on the target Then the problem was to decide detection and lock on precisely 23 Since there is a one to one correspondence between the pixel colors on the screen and the temperature of the target we can determine detection by using the R values of the pixels In Table 3 it can be seen that the color values are sorted accord ing to their increasing R values After working on the general theory of the problem we made a design decision depending on the flow of the events in the main program The main flow of the pro
142. r static void IsolationStatusCB Widget XtPointer XtPointer static void RelativeApertureCB Widget XtPointer XtPointer static void ApertureDramCB Widget XtPointer XtPointer static void MagnificationCB Widget XtPointer XtPointer static void OpticalTransmittanceCB Widget XtPointer XtPointer static void ElectronicBandwidthCB Widget XtPointer XtPointer static void SensorHeightCB Widget XtPointer XtPointer static void DetectivityCB Widget XtPointer XtPointer t j static void DetectorElementsCB Widget XtPointer XtPointer t j static void FiringAngleCB Widget XtPointer XtPointer static void FiringDistanceCB Widget XtPointer XtPointer static void WindDirectionCB Widget XtPointer XtPointer static void AeresolCB Widget XtPointer XtPointer static void LongitudeCB Widget XtPointer XtPointer static void LatitudeCB Widget XtPointer XtPointer static void CloudinessCB Widget XtPointer XtPointer PRR IIR oo o AIC This is the Change Wind Speed Callback kc ake ake afe ke ke ok ae ke ke kc oe e he oj ae ake 3e ake afe ale static void ChangeWindSpeedCB Widget XtPointer user data XtPointer call data int incr int user_data winddata Wind char buf 8 XtVaGet Values WindSpeedLabel XmNuserData amp Wind NULL Wind gt value
143. re added For example originally in this file emission type was not included in definitions of the properties of the materials Since sun has it s own emission We seperatly defined a function call for SUN material A function to enable and disable the fog is also defined for convience These functions are self contained and be used by you in your applications include lt Xm Xm h gt Get the Motif stuff include GL GLwMDrawA h We are going to use an OpenGL Motif Draw widget include lt GL gl h gt Get the OpenGL required includes include lt GL glu h gt include lt GL glx h gt include lt iostream h gt C subsystem include lt math h gt include lt stdlib h gt Get exit function include materialsupport h Get the names of the available materials include materialsupport funcs h Get material support function names kk ECO The following function turns on the Light Model xk a ae ske ok ke ok deje ake ak ake void turnOnTheLightModel i dim white for the lighting model ambient color GLfloat Imodel ambient 0 2 0 2 0 2 1 0 Set the global ambient light intensity glLightModelfv GL LIGHT MODEL AMBIENT ambient Set whether the viewpoint position is local to the
144. rgs n XmNtopAttachment XnATTACH FORM XtSetArg wargs n XmNleftAttachment XmATTACH POSITION XtSetArg wargs n XmNleftPosition 22 XtSetArg wargs n XmNbottomAttachment XmATTACH POSITION XtSetArg wargs n XmNbottomPosition 20 XtSetArg wargs n XmNrightAttachment XmATTACH FORM Widget SensorForm XmCreateForm InputWindow SensorForm wargs n XtManageChild SensorForm Create the sensor related widgets here create sensor screen widgets SensorForm 62 This the form that holds Background related widgets under it n 0 XtSetArg wargs n XmNfractionBase 40 XtSetArg wargs n XmNbottomAttachment XmATTACH FORM XtSetArg wargs n XmNleftAttachment XmnATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH FORM XtSetArg wargs n XmNtopAttachment XmATTACH POSITION XtSetArg wargs n XmNtopPosition 20 Widget BackgroundForm XmCreateForm InputWindow BackgroundForm wargs XtManageChild BackgroundForm Create the background related widgets create background screen widgets BackgroundForm End of BuildInputScreenDialog 63 This function creates the necessary widgets for the target part ofthe input screen ake 3k
145. rialCalls whichFace brass_ambient brass diffuse brass specular brass shininess break case SHINYBRASS Here are the shinybrass material values GLfloat shinybrass_ambient 0 25 0 15 0 0 1 0 GLfloat shinybrass diffuse 0 65 0 5 0 35 1 0 GLfloat shinybrass specular 0 9 0 6 0 0 1 0 shinybrass shininess 10 0 j Make the shinybrass material calls makeGLMaterialCalls whichFace shinybrass_ambient shinybrass diffuse shinybrass specular shinybrass shininess break case PEWTER Here are the pewter material values GLfloat pewter ambient 0 0 0 0 0 0 1 0 GLfloat pewter_diffuse 0 6 0 55 0 65 1 0 GLfloat pewter specular 0 9 0 9 0 95 1 0 j GLfloat pewter_shininess 10 0 Make the pewter material calls makeGLMaterialCalls whichFace pewter_ambient pewter_diffuse pewter_specular pewter_shininess break 134 case SILVER Here are the silver material values GLfloat silver ambient 0 4 0 4 0 4 1 0 5 GLfloat silver diffuse 0 3 0 3 0 3 1 0 3 GLfloat silver specular 0 9 0 9 0 95 1 0 3 GLfloat silver shininess 30 0 3 Make the silver material calls makeGLMaterialCalls whichFace silver_ambient silver_diffuse silver_specular silver_shininess j break case GOLD Here are the gold material values GLfloat gold amb
146. rstream h gt include lt iomanip h gt include lt Xm MainW h gt include lt Xm Xm h gt include lt Xm Form h gt include lt Xm Frame h gt include lt Xm RowColumn h gt include lt Xm CascadeB h gt include lt Xm PushB h gt include lt Xm PushBG h gt include lt Xm Dialogs h gt include lt Xm Label h gt include lt Xm LabelG h gt include lt Xm Separator h gt include lt Xm Scale h gt include lt Xm MessageB h gt include lt Xm Text h gt include Xm TextF h include lt Xm ToggleBG h gt include lt Xm ArrowBG h gt include lt GL GLwMDrawA h gt include lt X11 StringDefs h gt include lt X11 keysym h gt include GL gl h include lt GL glu h gt include lt GL glx h gt C I O subsystem Get the exit functiion definition Get the Motif library We are going to use a Form container widget Get the Frame widget Get the RowColumn widget Get the CascadeButton widget Get the PushButton widget DialogShell widgets Label widgets Label Gadets Separator widgets Get the Scale widget Get the MessageBox Get the Text Widget Get the Text Widget Get the ToggleBG Widget Get the ArrowBG Widget We are going to use an OpenGL Motif Draw widget Get the OpenGL required includes 57 include materialsupport h Get material names include materialsupport funcs h Get the material support fu
147. s the locally complex gradient phase angles and gradient magnitudes The Superslice algorithm employs multiple gray shade thresholding and edge matching to generate and segment possible target regions In this al gorithm scanning is directional as shown in Figure 10 The detection algorithm we used is similar to the contrast box model The pro gram reads the red value in the screen pixels averages them and decides on the detec tion of the target While IR detectors work with temperature TV detectors work with luminos ity Luminance is often called brightness L dI dA cos0 This is the luminous inten sity per projected area normal to the line of observation For TV systems the radiation is at the visible part of the electromagnetic spectrum Sources of light 10 enlightens the targets and targets reflect the incoming light which is picked up by the sensors Ref 7 C COMPUTER GRAPHICS Computer Graphics started with the display of data on hardcopy plotters and cathode ray tube screens Today it has reached an amazing point with the help of so phisticated hardware and improved software and rendering techniques It has grown to include the creation storage and manipulation of models and images of objects These models may come from diverse and expanding set of fields and include physical mathematical engineering architectural and natural phenomena Computer graphics today is becoming largely interactive with the adven
148. s the Lat Long gadget XtVaCreateManaged Widget Longitude xmLabelGadgetClass BackgroundRC4 1 XmNorientation XmHORIZONTAL NULL Create the text widget for the Longitude Widget Longitude XtVaCreateManagedWidget Longitude xmTextWidgetClass BackgroundRC41 NULL Add Callbacks to the Latitude widget XtAddCallback Longitude XmNmodify VerifyCallback LongitudeCB NULL Here manage the widget XtManageChild BackgroundRC41 Create the bulletin boardi widget n 0 XtSetArg wargs n XmNtopAttachment XmATTACH WIDGET XtSetArg wargs n XmNleftAttachment XmATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH FORM n XtSetArg wargs n XmNtopWidget BackgroundRC41 Widget BB XmCreateBulletinBoard Backgroundform2 BB wargs n XtManageChild BB 82 Create a Frame widget 0 XtSetArg wargs n XmNshadowThickness 2 nt XtSetArg wargs n XmNshadowType XmSHADOW OUT Widget BackgroundRC6frame XmCreateFrame BB BackgroundRC frame wargs n XtManageChild BackgroundRC 6frame This the rowcolumn that holds Background widgets under it 0 XtSetArg wargs n XmNorientation XmHORIZONTAL XtSetArg wargs n XmNpacking XmPACK TIGHT Widget BackgroundRC6 XmCreateRowColumn BackgroundRC frame BackgroundRC6 wargs This is the Time Of The Day label gadget XtVaCreateManagedWidget Time Of The Day xmLabelGadgetClass
149. s was assumed to be a blackbody The environmental conditions for the targets were assumed to be mid latitude summer conditions Extinction coefficient calculations were made according to this assumption The temperature range for the targets was assumed to be between 10 90 C The angle of approach of the missile was assumed to increase or decrease as multiples of 5 degrees within the range of 0 90 degrees It is assumed that each target is a Lambertian surface i e a surface which radiates in all directions It is assumed that the energy which the sensor sees is proportional to the projection area of the target on the sensor It is assumed that in the atmospheric conditions in which the energy travels there are no aerosol In the program the delta t time interval is assumed to be very short for the events happening There is no change in the temperature of the target dur ing the flight of the sensor and all of the extinction calculations are done de pending on the initial temperature of the target Making this kind of an assumption is not illogical because the flight time of a missile is very short and the temperature change which may occur at the target during this period is negligible It is assumed that the detection of an IR target occurs when the intensity of the signal apparent temperature exceeds the threshold level It is assumed that detection of a TV target occurs when the contrast range in a small subset of pi
150. t BACK GROUND j void Background2CB Widget XtPointer XtPointer Call the display list for grass texturing BACKGROUND Index 1 glCallList BACK GROUND void Background3CB Widget XtPointer XtPointer Call the display list for sea texturing BACKGROUND Index glCallList BACKGROUND void Background4CB Widget XtPointer user_data XtPointer i Call the display list for asphalt texturing BACKGROUND Index 2 glCallList BACK GROUND 88 void SensorCB Widget XtPointer user data XtPointer i float Temp mu total radiance First Load the Sensor ID to SENSOR variable int SENSOR NO int user SENSOR SENSOR lf the sensor is IR then we must modify the color table if SENSOR Manage scale widget so color sellection button will be visible XtManageChild SensorRC1 1 First Find the extinction cooficient value mu Calculate Extinction Now modify the color table with current Firing Distance for int index 0 index lt VERTICE NUM index Temp Original Temp index 0 total_ radiance Find_Total_Radiance Temp Temp Temp At Sensor total radiance Temperature index 0 Temp Fill Up Color Table index Y End of for loop End of if clause if SENSOR TV i Manage IR scale widget so it will be not displayed anymore XtUnmanageChild SensorRC11 Modify the environmen
151. t color to dark gray for int 0 j lt 2500 j Color j 0 0 7 Color i 1 0 7 Color j 2 0 7 Color j 3 1 0 End of for loop End of if TV i SENSOR LASER If color scale was displayed make it unvisible XtUnmanageChild SensorRC11 End of SensorCB 89 This callback is called when the target option menu is called void targetCB Widget XtPointer user data XtPointer float Temp mu total radiance Load the target ID int TARGET NO int user data Target TARGET NO If the current sensor is IR then we must modify the color table iffSENSOR First Find the mu value mu Calculate Extinction Now modify the color table with previous Firing Distance for int index 0 index lt VERTICE NUM index i Temp Original Temp index 0 total radiance Find Total Radiance Temp Temp Temp At Sensor total radiance mu Temperature index 0 Temp Fill Up Color Table index MODE End of for loop End of if clause ifSENSOR TV i for int j 0 j lt 2500 j Color j 0 0 7 Color j 1 0 7 Color j 2 0 7 Color j 3 1 0 End of for loop j 90 Here we are going to open the related target file with according to the target selected by the user and call the initilization function switch Target case TANK FillInInitialTargetArrays T
152. t of virtual reality Ref 2 In the early 1980s computer graphics was a small specialized field because of the expensive hardware and software Then personal computers with built in raster graphics displays popularized computer bitmap graphics In time different techniques were developed and real objects were started to be drawn by polygons on computer graphics screens The greater the number of the polygons the more realistic was the picture of the object Today 80 million polygons per picture is accepted as the thresh old for mimicing reality Ref 3 1 Visualizing a 3 D Target As we mentioned above for the visualization of targets or objects polygons are used as the simplest element component of the drawings These polygons have verti ces and the information about the polygons is stored in them Generally these poly gons are in triangular shape A user who wants to create an object must calculate the vertices of each polygon and then store these as data or must use special software to create the object All of the polygons come together and they form the model We can do lighting shading and texturing on these models Ref 3 Every object drawn on the screen is approximated by polygons and then these polygons can be rendered and with the help of lightning texturing and special graphics techniques objects look real and 3 D Each polygon in the object is called a facet Facets have vertices Our targets in the program are formed o
153. ta i Get us GLwDrawingAreaCallbackStruct ptr to the call data GLwDrawingAreaCallbackStruct glptr GLwDrawingAreaCallbackStruct call data Arg wargs 1 Arg temp XVisualInfo vi Pointer to X VisualInfo GLint gdtmp Used in the get capability stuff below Get the visual info XtSetArg wargs 0 GLwNvisualInfo amp vi XtGetValues w wargs 1 Create a new GLX rendering context GL TRUE gt Specify direct connection to graphics system if possible glx context gIXCreateContext XtDisplay w vi 0 GL TRUE Set the global window and display global display XtDisplay w global window XtWindow w Make this drawing area the current one GLwDrawingAreaMakeCurrent w glx context Test to see if this machine has a z buffer if glGetIntegerv GL DEPTH BITS amp gdtmp gdtmp 0 cerr lt lt This machine does not have a hardware zbuffer lt lt endl exit 0 j Turn on z buffering glEnable GL DEPTH TEST Turn on Gouraud shading glShadeModel GL SMOOTH Get a font we can use to display our messages We usebthe first font to display LOCK ON and the second one to display numbers on the color scale fontHandlel makeRasterFont w times medium r normal 100 p 84 iso8859 1 102 fontHandle2 makeRasterFont w times medium r normal 14 p 84 iso8859 1 Set the Viewport for the first draw of the window gl Viewport 0
154. three different coloring scales These scales are bi level scale gray level scale and the cyclic scale We designed the cyclic scale to present more accurate data on the screen The user can decide the temperature of a point on the target by comparing the color values on the scale and on the target Also in the sensor section of the interface we have parameters which can change the detection possibility of the sensor These parameters were put in the interface for the future development of the program The third part of the interface is the environment section In this section we provide information about the environmental conditions The first information we pro vide is the background We have a four background options in the program These are soil grass cement and asphalt The targets can be matched to one of these backgrounds The other parts of the environment adjusts the day of the year hour of the day dependent on the sun s position and the percentage of fog in the environment The display option displays the chosen target with the chosen sensor Depend ing on the option which is chosen from the target and the sensor parts of the interface the program switches to that output screen G HOW DOES THE MAIN PART OF THE PROGRAM WORK 1 Infrared Scene All of the implemented targets can be displayed in the IR screen The IR screen shows the temperature distribution on the target In the display screen we have three sliders which let t
155. tice 1 0 0 Color Vertice no 2 0 3960 Color Vertice 3 1 0 120 return 1 if Temperature Vertice no 0 gt 70 amp amp Temperature Vertice no 0 lt 75 Dirty Pink i red 13 0 16 0 COLOR MODE SYCLIC SCALE Modify Color Array With A Given Mode Vertice no COLOR MODE red j else Color Vertice 0 0 8125 Color Vertice_no 1 0 3725 Color Vertice 2 1 0 Color Vertice no 3 1 0 return if Temperature Vertice_no 0 gt 75 amp amp Temperature Vertice no 0 lt 80 Pinkish t red 14 0 16 0 if COLOR MODE SYCLIC SCALE Modify Color Array With A Given Mode Vertice no COLOR red j else Color Vertice 0 0 8750 Color Vertice no 1 0 0 Color Vertice_no 2 1 0 Color Vertice no 3 1 0 return 1 if Temperature Vertice no 0 gt 80 amp amp Temperature Vertice 0 lt 85 Gold i red 15 0 16 0 if COLOR MODE SYCLIC SCALE Modify Color Array With A Given Mode Vertice no COLOR red else Color Vertice 0 0 9375 Color Vertice 1 0 9490 Color Vertice nol 2 0 0 Color Vertice no 3 1 0 return 1 if Temperature Vertice no 0 gt 85 85 lt DegreesDark Red i red 16 0 16 0 if COLOR MODE SYCLIC SCALE Modify Color Array With A Given Mode Vertice no COLOR MODE red j 121 Color Vertice no 0 1 0 Color V
156. tion and lock on ranges The energy radiated by the objects travels through the atmosphere toward the sensor During this travel due to the gaseous and particle material which are available in the atmosphere the energy is attenuated and only a portion of it reaches to the sen sor Some portion of this energy is transmitted to the detector depending on the sen sor parameters This is the basic story of what is happening in our computer program Our work is a visualization of a real physical phenomenon In summary our problem can be defined as the integration of a user interface design the visualization of IR and TV targets under real physical conditions and creating a tool which can be easily modified to measure the performance of different sensors B ASSUMPTIONS We made a number of assumptions to make the implementation easier in the short time period available These assumptions do not divert the real output of the data from real calculations so much but they do affect the precision These assump tions can be taken as different aspects of the project and can be implemented to expand the project The assumptions which are used in our work are as follows 15 The background of the target has a constant temperature So a fixed color value corresponding to this was applied to the background The targets were assumed to be formed of nodes connecting facets to each other Each of these nodes radiates energy Each of the target
157. us Firing Angle for int index 0 index lt VERTICE NUM index i Temp Original Temp index 0 total radiance Find Total Radiance Temp Temp Temp At Sensor total radiance mu Temperature index 0 Temp Fill Up Color Table index MODE End of for loop End of if clause Modify the statre control variables SEARCHED ONES 0 READ ONES 0 ROW 0 COLOMN 900 OLD MAX X MAX X OLD MAX Y MAX MAX RED 0 0 Max Contrast Of Scene 0 End of rotatexCB ok oe oe ae he ke hee hehe ok oh ale ode beoe xe rotateyCB This function is called whenever the Side view scale is moved ak ak afe ae afe ake ake ake ake 34e afe ake afe ok joke oko ke ke ake akk afe ale ale ake ale ale ae ake ake afe ake ale ak ake static void rotateyCB Widget XtPointer XtPointer call data i XmScaleCallbackStruct call value XmScaleCalibackStruct call data pitch call value gt value 107 ke kc je ok ke ke ke ok ke kc ok ok ok ok ke ok ke ke ok a ke a ae k a translatezCB This function is called whenever the Distance scale is moved static void translatezCB Widget XtPointer XtPointer call data i float Temp mu kt total_radiance XmScaleCallbackStruct call_ value XmScaleCallbackStruct call_ data tz ca
158. vv AAP NO A CSV ONAL ODEON 3 yer AAI SLO 4 e tA 55 s 5 S SLY STORRS S 2 7 Vene 255 2522 e gt gt NAN N 4 7 4 E K Ne 2 lt lt A 2 4 lt M x 3 3 2 gt OF Qe WES Lio A n UU ents CMM OS QV RASA NN gt 2 gt lt 5 2 aS Y v lt a5 OCIS Ye RIA EAS 555 URIS 25052506255 4 gt 5 QUT 6 OO S 57656 2 S 5 5 52 lt 59 NS A M 2522 A Y 5 MOSSES 2 DA 2 222 Figure 25 The TV Screen Output Of The Ship Target T A 5 x k AR 2 1275 PARLA It 22 Veron 5257 Xu AS AA do Ni PAPAS lt Mr Na ae PN NP FIN INI ve 55 VEN AP NADA iit ARN TN CMAN IAS tegi NISL 5 PEN is 7779 MOK 2 RMS EEN SPY 5520 M SOP OS 2 Looe 2 2 552552552 lt lt x deae ANIN S 225 2 22 5 Se X23 2 4 Figure 26 The TV Screen Output Of The Aircraft Target
159. we are doing double buffering glXSwapBuffers global display global window end of draw the scene 112 kakka kk ak k The following routine actually does the matrix multiplication to compute the following formula P P T to origin S acc R x R z T to acc loc T back to specified center lookat perspective The input coordinate is the point about which operations should be done Think of that point as the point translated to the origin ke kc ke ok ke ke ke ke ke je ke void concatenate_accumulative_matrices float refx float refy float refz Since the operation is done by multiplying the matrices the order of operation is important We are going to use the Model View stack giMatrixMode GL MODELVIEW translate center of object back to original location glTranslatef refx refy refz glRotatef pitch 1 0 1 0 0 0 0 0 Rotate to look from the top glRotatef heading 0 0 1 0 0 0 Rotate to lok from each side translate center of object to the origin glTranslatef refx refy refz The following routine loads a unit matrix into the input array kc jc kc oe ok ae a fe a ok ke ok oe ok void unit GLfloat m i
160. xels exceeds the threshold level Lock on is accepted to occur if there are two separate detections on the same area on the screen 16 IV DESIGN SELECTION OF WORKING ENVIRONMENT 1 Software The program consists of three main components The first part is the imple mentation of the user interface design the second part is the sensor detection physics involved and the third part is the implementation of the computer graphics visualization For the user interface part of the program we adopted OSF Motif since this is as close to a graphics standard as is available We used OSF Motif for the user inter face and to control the program input and output For the visualization aspect of the program there were two tools we could choose IRIS Motif GL or OpenGL We used OpenGL because it is the most devel oped computer graphics library at hand This software provides an interface to the graphics hardware and its implementation is easy There are various commands and functions in the OpenGL library It uses primitives and different algorithms for pro gramming It is more developed than the IRIS Graphics Library for developing vis ual simulation program For the sensor physics element of the computer program we used the programming language The main flow of the program was designed by using the programming techniques The rest of the code which uses special programming func tions was embedded into the main C co
161. xmArrowButtonGadgetClass BackgroundRC6 XmNarrowDirection XmARROW_ DOWN NULL Add the callback for Down Arrow XtAddCallback YearDownArrow XmNarmCallback ChangeTimeYearCB XtPointer 1 Here manage the widget XtManageChild BackgroundRC6 This the rowcolumn that holds Pull down Menu widget under it 0 XtSetArg wargs n XmNtopAttachment XmATTACH WIDGET XtSetArg wargs n XmNleftAttachment XmATTACH FORM 84 XtSetArg wargs n XmNrightAttachment XnATTACH FORM XtSetArg wargs n XmNtopWidget BackgroundRC6 XtSetArg wargs n XmNorientation XmHORIZONTAL n XtSetArg wargs n XmNnumColumns 1 n XtSetArg wargs n XmNpacking XmPACK TIGHT Widget BackgroundRC7 XmCreateRowColumn Backgroundform2 BackgroundRC7 wargs n Add another pulldown to the RowColumn cloudiness sellection button 0 Widget pulldown10 XmCreatePulldownMenu BackgroundRC7 10 wargs n Add the entries to the 10 make pulldown entry pulldown10 OVERCAST CloudinessCB XtPointer amp SOIL make pulldown entry pulldown10 CLOUDY CloudinessCB XtPointer amp GRASS make pulldown entry pulldownl0O CLEAR CloudinessCB XtPointer amp SEA Create the option menu that has the pulldown under it 0 label string XmStringCreateSimple CLOUDINESS XtSetArg wargs n XmNlabelString label string XtSetArg
162. y 1400x1000 0 0 width height xoff yoff InputWindow geometry 1400x1000 0 0 info geometry 10x10 800 800 NULL Create the top level widget toplevel XtApplnitialize amp app context Application context eotda main Application class NULL 0 Command line option list amp argc argv Command line args fallback resources NULL Argument list 0 Number of arguments Create a up display window to inform the user during the initialization proccess of the program n 0 XtSetArg wargs n XmNmessageString message string n info XmCreateInformationDialog toplevel Please Wait Initializing the Display Lists wargs n XtManageChild info Position the pop up display in the center of the screen n 0 XtSetArg wargs n XmNx 200 XtSetArg wargs n XmNy 200 n XtSetValues XtParent info wargs n Get rid of compound strings XmStringFree message string Create Form widget This is the top level container for below widgets 59 0 XtSetArg wargs n XmNfractionBase 30 n MainWindow XmCreateForm toplevel MainWindow wargs n XtManageChild MainWindow Call the initializing function This the first window we see when the program starts execution BuildInputScreenDialog Create widget for display But do NOT manage till Display button is pushed n 0 XtSetArg wargs n XmNleftAttachment
163. y Event structure We look at the type of event to see if we should pay attention In this example we only pay attention to key release events switch glptr gt event gt type case KeyRelease We must convert the keycode to a KeySym before it is possible to check if it is an escape We also dump the Ascii into the array ascii The return value from XLookupString is the number of characters dumped into array ascii ptr XKeyEvent glptr gt event nchars XLookupString ptr ascii 1 amp keysym NULL if nchars 1 amp amp keysym KeySym XK_Escape We have an escape Time to exit exit 0 break This part of the program kept in the program forseeing that in the future some functions will be assigned to mouse buttons case ButtonPress We have a button press from the mouse Which mouse button was it switch glptr gt event gt xbutton button case Button2 The middle button was pressed 105 break case Buttoni The left button was pressed break case Button3 The right button was pressed break default break end switch on which mouse button it was break case ButtonRelease We have a button release from the mouse Which mouse button was it switch glptr gt event gt xbutton button case Button2 The middle button was pressed break case Buttonl The left button was pressed break case Button3
164. y pulldown1 GRAY ScaleCB XtPointer amp GRAY SCALE make pulldown entry pulldownl SYCL ScaleCB XtPointer amp SYCLIC SCALE Create the option menu that has the pulldown under it 0 label string XmStringCreateSimple IR SCALE XtSetArg wargs n XmNlabelString label string n XtSetArg wargs n XmNsubMenuld pulidownl Widget optionMenul XmCreateOptionMenu SensorRC11 optionMenul wargs n XtManageChild optionMenul XmStringFree label string This the rowcolumn that holds Relative Aperture widget under it 0 XtSetArg wargs n XmNtopAttachment XnATTACH WIDGET XtSetArg wargs n XmNtopWidget SensorRowColumn1 XtSetArg wargs n XmNleftAttachment XmATTACH FORM XtSetArg wargs n XmNrightAttachment XmATTACH FORM XtSetArg wargs n XmNorientation XMHORIZONTAL XtSetArg wargs n XmNnumColumns 1 n XtSetArg wargs n XmNpacking XmPACK TIGHT Widget SensorRowColumn2 XmCreateRowColumn parent SensorRowColumn2 wargs n This is the Relative Aperture gadget XtVaCreateManagedWidget Relative Aperture xmLabelGadgetClass SensorRowColumn2 XmNorientation XmHORIZONTAL NULL Create the text widget for the Relative Aperture Widget TextWidgetl XtVaCreateManaged Widget TextWidget1 xmTextWidgetClass SensorRowColumn2 NULL Add Callbacks to the TextWidgetl widget XtAddCallback TextWidget1 XmNmo
165. zeCB Widget w XtPointer XtPointer call data i Get us a GiwDrawingAreaCallbackStruct ptr to the call data GLwDrawingAreaCallbackStruct glptr GLwDrawingAreaCallbackStruct call data Set the window into which GL drawing should be done GLwDrawingAreaMakeCurrent w glx context Set the viewport using the window size currently set gl Viewport 0 0 GLsizei glptr gt width GLsizei glptr gt height if DISPLAY ENABLED draw the scene otherwise we are the input screen so don t spent time by calling display window 104 ke ak ok ok ke e ok oe ok e oe be a deo oe ke o dee de leo o ke ok je leo de oe oe b je oe This routine handles all types of input from the GL widget Jn this particular example the KeyRelease handles the Escape Key so that its release exits the program sk sk ok kk ak ak oj oj sje ake ae static void inputCB Widget XtPointer XtPointer call data Get us GLwDrawingAreaCallbackStruct ptr to the call data GLwDrawingAreaCallbackStruct glptr GLwDrawingAreaCallbackStruct call data char ascii 1 Hold for the ascii chars returned from XLookupString int nchars Number of characters returned from XLookupString KeySym keysym The X version of the returned character XKeyEvent ptr ptr to the Ke

Download Pdf Manuals

image

Related Search

Related Contents

hanging skimmer skimmer de mochila skimmer hors  programme de professionnalisation des missions - Synami-CFDT  CastoTIG 1501  Manual do Proprietário Sintetizador  443 CINTA ADHESIVA ANTIDESLIZANTE - kleer  JVC GZ-MG130E/EK Camcorder User Manual  Zanzariera Insect killer Tueur d`insectes Insektenkiller    Enjoy it. - BLAUPUNKT  Réalisation collective d`une séquence animée  

Copyright © All rights reserved.
Failed to retrieve file