
Figure F horizontal color slice and contour slice of the pressure together with the map of the HIRLAM domain Figure F iso surface of the wind at knots together with the orography of the HIRLAM domain APPENDIX F EXAMPLE IMAGES Figure F contour surface of a D eld without handle and a D eld with handle Figure F legenda of the temp erature App endix F Example Images Figure F vertical color surface of the temp erature together with the orography of the HIRLAM domain APPENDIX E VOGL IMPLEMENTATION DETAILS Note This routine do esnt yet work in the VISD distribution of VOGL It is prob ably obsolete as the line style is not device dep endent any more The linestyle must b e used when scan converting lines For full details the reader is referred to the X driver The le Xc contains the complete sp ecication of a VOGL device driver E VOGL DEVICE DRIVER STRUCTURE Note This routine is not available in the original VOGL distribution It is the resp onsibility of the device to approximate bit color when a frame buer of only bits is available DEV mapcolorint LUTindex int r int g int b Changes a colormap index to a given RGB value DEV fontchar fontfile Sets up a hardware font This should also set vdevicehwidth and vdevicehheight which are the width and height of the current hardware font in pixels VOGL assumes that hardware text is of a xed width DEV charchar c Prints a character of hardware text This routine must do any neccessary moving to make sure the current drawing p osition on the device is correct and it must leave the device in graphics mo de stringchar s DEV Prints a string of hardware text This routine must do any neccessary moving to make sure the current drawing p osition on the device is correct and it must leave the device in graphics mo de DEV fillint n int x int y Draws lled p olygons devices which do not supp ort this should just do an outline Note This routine is obsolete in the VISD distribution of VOGL It is never called but included to retain backward compatibility backbuf DEV Initializes double buering by selecting the back drawing buer and p erforming any other initializations If no double buering is supp orted then should b e returned Note The double buering used is in fact pseudodouble buering Drawing is done is a backbuer which is copied into the front buer when requested DEV swapbuf Swaps the front and back buer What it really do es in most device drivers is copy the back buer into the front buer frontbuf DEV Switches drawing into the front drawing buer DEV setlwint w Sets the line width Note This routine do esnt yet work in the VISD distribution of VOGL It is prob ably obsolete as the line width is not device dep endent any more The linewidth must b e used when scan converting lines DEV setlsint lss Sets the line style of line drawings APPENDIX E VOGL IMPLEMENTATION DETAILS There must also b e a function in the device driver to copy the device driver structure in the global used device entry This function must b e called conditionally from driversc as should the device name print statement the device are printed if VOGL is used but no device is set The nineteen functions required for a complete device driver are DEV init Device initialization routine A routine which enables graphics on the device sets the default color map and sets vdevicemaxSxy and vdeviceminSxy to the window size in pixels Note In the VISD distribution of VOGL this routine also initializes the palette to colors distributed in the RGB space when the frame buer is only bits exit DEV Do es the necessary cleaning up to allow VOGL to exit leaving the device in a usable form DEV drawint x int y Draws a line from the current device p osition to a p oint x y in vogle device co ords note these assume that is the b ottom left hand corner This routine must up date the current device p osition Note This routine is obsolete in the VISD distribution of VOGL It is never called but included to retain backward compatability DEV pointint x int y Draws a single pixel in the current device color Note This function is not available in the original VOGL distribution DEV getkey Gets a single character of input from a device capable of providing it DEV locatorint wx int wy Returns the mouse p osition for the device in VOGL device co ordinates returned in the arguments and returns a bit pattern giving which buttons were down at the time of the call DEV clear Clears the current viewp ort to the current background color DEV colorint LUTindex Changes the current device color to the sp ecied LUT index DEV RGBcolorint r int g int b Changes the current device color to the sp ecied RGB value E VOGL DEVICE DRIVER STRUCTURE void lmbindshort target short index lmbind binds one of the eleven light controlling resource of the GL to a resource dened by lmdef target can b e one of MATERIAL BACKMATERIAL LIGHT or LMODEL void shademodellong model Sets the shading mo del Two shading mo dels are supp orted FLAT and GOURAUD long getsmvoid Returns the current shading mo del The value returned can b e either FLAT or GOURAUD E Depthcueing functions Private functions void calc depthcueVertex v Calculates the color of the given vertex v using the Screen Zco ordinate of v and the current RGB and Zrange Public functions void depthcueint onoff Turns depthcueing on or o If onoff is zero depthcueing is turned o Otherwise it is turned on void lRGBrangeshort rmingminbminrmaxgmaxbmaxlong znearzfar Sp ecied the RGB color and Z range to b e used for depthcueing The values rmax gmax and bmax are mapp ed to znear E VOGL device driver structure VOGL device drivers contain the following information Three character p ointers giving The name of the device The name for the small hardware font The name for the large hardware font function p ointers giving the functionality of the device If a device is not capable of some function eg color changing a noop function should b e provided which has a return value of APPENDIX E VOGL IMPLEMENTATION DETAILS COLOR RGB color commands will set the current color If a color is the last LMC thing sent b efore a vertex the vertex is colored If a normal is the last thing sent b efore a vertex the vertex will b e lighted LMC COLOR is the default mo de LMC EMISSION RGB color commands will set the EMISSION color prop erty of the current material AMBIENT RGB color commands will set the AMBIENT color prop erty of LMC the current material LMC DIFFUSE RGB color commands will set the DIFFUSE color prop erty of the current material Alpha the fourth color comp onent sp ecied by RGB color commands will set the ALPHA prop erty of the current material LMC SPECULAR RGB color commands will set the SPECULAR color prop erty of the current material LMC AD RGB color commands will set the DIFFUSE and AMBIENT color prop erty of the current material Alpha the fourth color comp onent sp ecied by RGB color commands will set the ALPHA prop erty of the current material NULL RGB color commands will b e ignored LMC IMPORTANT lmcolor do es NOT change the data structures holding the material denitions but is provided to supp ort fast changes to the current material without changing the denition of the currently b ound material Thus lmcolor changes are lost whenever a new material is b ound only the MATERIAL prop erties can b e changed not those of the BACKMATERIAL void nlentypetype normal These functions are named identical as the color functions prexed with an n instead of an c and are used to sp ecify vertex normals len can currently only b e type can b e s short i longd double or f oat Vertex normals must b e normalized in order for the shading calculation to b e meaningful b ecause the dot pro duct of the vectors is used as a measure of the angle b etween the vectors See also the function nmode void nmodelong mode Tell the GL when normal vectors must b e normalized mode can b e NAUTO normalize vectors only when the current Mo delView matrix is not orthonor mal NNORMALIZE always normalize vectors disregarding the current Mo delView ma trix Even in hardware renormalization can have an adverse eect on the p erformance void lmdefshort deftype short index short np float props Denes or mo dies a material light source or lighting mo del deftype can b e one of DEFMATERIAL DEFLIGHT and DEFLMODEL index is the index of the resource to dene or mo dify each resource typ e has an unique array of denitions np is the numb er of entries in the props array props contains the various attributes appropriate to the typ e of resource The kinds of attributes available for each resource typ e were listed in section E VOGL ENHANCEMENTS void ccallshort r short g short b short a Generic color pro cessing functions All public RGB color functions call this function The arguments are clipp ed to a limit of Then dep ending on the color mode see section the current color is set or a sp ecic material characteristic is set Public functions void cpackunsigned long argb Sp ecify a true red green blue color using the packed ARGB format the color com p onents are packed into one unsigned long as xAARRGGBB The A comp onent is the alpha transparency comp onent and is currently not used in VOGL void RGBcolorshort r short g short b Equal to cpack only sp ecies no alpha comp onent and red green and blue separately void clentypetype colors These are various color sp ecication functions which all take a vector an array as input len determines the length of the vector exp ected and can b e array contains red green and blue values or alpha comp onent also included type determines the typ e of the array and can b e
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages117 Page
-
File Size-