home *** CD-ROM | disk | FTP | other *** search
Wrap
@DATABASE "graphics3D.h" @MASTER "Ram Disk:graphics3D.h" @REMARK This file was created by ADtoHT 2.1 on 21-Apr-98 20:16:26 @REMARK Do not edit @REMARK ADtoHT is © 1993-1995 Christian Stieber @NODE MAIN "graphics3D.h" @{"graphics3D.h" LINK File} @{b}Structures@{ub} @{"ambient3d" LINK "graphics3D.h/File" 211} @{"dir3d" LINK "graphics3D.h/File" 135} @{"grafica" LINK "graphics3D.h/File" 276} @{"line" LINK "graphics3D.h/File" 128} @{"matrix1x4" LINK "graphics3D.h/File" 100} @{"matrix4x4" LINK "graphics3D.h/File" 78} @{"objectnode" LINK "graphics3D.h/File" 159} @{"pixel" LINK "graphics3D.h/File" 120} @{"polygon" LINK "graphics3D.h/File" 143} @{"polytemp" LINK "graphics3D.h/File" 186} @{"rgbtype" LINK "graphics3D.h/File" 52} @{"tag3d" LINK "graphics3D.h/File" 61} @{"vector" LINK "graphics3D.h/File" 110} @{"vertex" LINK "graphics3D.h/File" 44} @{b}Typedefs@{ub} @{"Sambient3d" LINK "graphics3D.h/File" 272} @{"SAreaInfo" LINK "graphics3D.h/File" 263} @{"Sdir3d" LINK "graphics3D.h/File" 270} @{"Sgrafica" LINK "graphics3D.h/File" 262} @{"Smatrix4x4" LINK "graphics3D.h/File" 271} @{"Sobjectnode" LINK "graphics3D.h/File" 265} @{"Spolygon" LINK "graphics3D.h/File" 267} @{"Spolytemp" LINK "graphics3D.h/File" 269} @{"STmpRas" LINK "graphics3D.h/File" 264} @{"Svector" LINK "graphics3D.h/File" 268} @{"Svertex" LINK "graphics3D.h/File" 266} @{b}#defines@{ub} @{"COMPLEMENT" LINK "graphics3D.h/File" 15} @{"CS_GCOLOR" LINK "graphics3D.h/File" 37} @{"CS_NPX0" LINK "graphics3D.h/File" 39} @{"CS_NPY0" LINK "graphics3D.h/File" 40} @{"CS_PROJET" LINK "graphics3D.h/File" 35} @{"CS_SBUFF" LINK "graphics3D.h/File" 36} @{"CS_VDIST" LINK "graphics3D.h/File" 38} @{"END_T" LINK "graphics3D.h/File" 29} @{"FIXV" LINK "graphics3D.h/File" 25} @{"FIXVM" LINK "graphics3D.h/File" 26} @{"FLAT" LINK "graphics3D.h/File" 21} @{"FRUSTUM" LINK "graphics3D.h/File" 23} @{"INVERSVID" LINK "graphics3D.h/File" 16} @{"JAM1" LINK "graphics3D.h/File" 13} @{"JAM2" LINK "graphics3D.h/File" 14} @{"MAXOBJECT" LINK "graphics3D.h/File" 72} @{"MAXPLFRAM" LINK "graphics3D.h/File" 73} @{"MAXPOINT" LINK "graphics3D.h/File" 71} @{"MAXVER()" LINK "graphics3D.h/File" 257} @{"MAXVERT" LINK "graphics3D.h/File" 74} @{"MFRAC" LINK "graphics3D.h/File" 27} @{"MINT" LINK "graphics3D.h/File" 28} @{"PARAL_P" LINK "graphics3D.h/File" 18} @{"PROSP_P" LINK "graphics3D.h/File" 17} @{"SFIXV" LINK "graphics3D.h/File" 24} @{"SOLID" LINK "graphics3D.h/File" 20} @{"WIREF" LINK "graphics3D.h/File" 19} @{"ZPLANE" LINK "graphics3D.h/File" 22} @ENDNODE @NODE File "graphics3D.h" /* ** $VER: graphics3d.h 10.02 (02.03.98) ** ** main include file for @{"graphics3d.library" LINK "graphics3d_I/MAIN"} ** ** (C) Copyright 1997 Patrizio Biancalani ** All Rights Reserved. */ #ifndef GRAPHICS3D_GRAPHICS3D_H #define GRAPHICS3D_GRAPHICS3D_H #define JAM1 0 #define JAM2 1 #define COMPLEMENT 2 #define INVERSVID 4 #define PROSP_P 0 /* tipo proiezione prospettica */ #define PARAL_P 1 /* tipo proiezione parallela */ #define WIREF 0 /* modo visualizzazione in wire frame */ #define SOLID 2 /* modo visualizzazione in solid */ #define FLAT 1 /* modo visualizzazione i flat shading */ #define ZPLANE 0 /* #1 modo clippaggio oggetti */ #define FRUSTUM 1 /* #2 modo clippaggio oggetti */ #define SFIXV 8 /* n# di shift per cal. num. virgola fissa */ #define FIXV 256 /* fattore moltipl. per num. virgola fissa */ #define FIXVM 128 /* meta' di @{"FIXV" LINK File 25} , per effettuare appros. */ #define MFRAC @{"FIXV" LINK File 25} /* maschera per estrarre parte frazionaria */ #define MINT 0xFFFFFFFF /* maschera per estrarre parte intera */ #define END_T 0 /* fine array tag3d di dati */ /* tipi dati per tag3d.tipo riconosciuti attualmente per funzione cascene() */ #define CS_PROJET 1 /* tipo di proiezione */ #define CS_SBUFF 2 /* attivazione o meno single buffering */ #define CS_GCOLOR 3 /* nuovo colore sfondo box di visualizzazione */ #define CS_VDIST 4 /* nuovo valore distanza da piano di proiezione */ #define CS_NPX0 5 /* nuova posizione X per box di visualizzazione */ #define CS_NPY0 6 /* nuova posizione Y per box di visualizzazione */ /** STRUTTURE DATI DI USO ESTERNO ED INTERNO **/ /* vertice, usa formato float a virgola fissa ,(val*@{"FIXV" LINK File 25}) */ struct vertex { long int x; long int y; long int z; }; /* struttura per definizione colore */ struct rgbtype { short int r; short int g; short int b; }; /* struttura tag3d per definire un array di valori estendibile */ /* analogo alla struttura TagItem dell' Amiga O.S. */ struct tag3d { short unsigned int tipo; /* flag che identifica valore (se=0 fine array) */ long int val; /* valore effettivo */ }; /* !!! STRUTTURE E DEFINIZIONI GLOBALI DI USO ESCLUSIVAMENTE INTERNO !!! */ /** COSTANTI DI USO SOLO INTERNO **/ #define MAXPOINT 4 /* massimo numero di punti per poligono */ #define MAXOBJECT 100 /* massimo numero oggetti per mondo 3D (max. 65535)*/ #define MAXPLFRAM 10000 /* massimo numero poligoni in una frame (16*12) */ #define MAXVERT 1000 /* massimo numero vertici in un poligono */ /* matrice di trasformazione (4x4) */ /* usa formato float a virgola fissa ,(val*@{"FIXV" LINK File 25}) */ struct matrix4x4 { long int r0c0; long int r0c1; long int r0c2; long int r0c3; long int r1c0; long int r1c1; long int r1c2; long int r1c3; long int r2c0; long int r2c1; long int r2c2; long int r2c3; long int r3c0; long int r3c1; long int r3c2; long int r3c3; }; /* matrice di trasformazione (1x4) */ /* usa formato float a virgola fissa ,(val*@{"FIXV" LINK File 25}) */ struct matrix1x4 { long int r0c0; long int r0c1; long int r0c2; long int r0c3; }; /* vettore */ /* usa formato float a virgola fissa ,(val*@{"FIXV" LINK File 25}) */ struct vector { long int x; long int y; long int z; long int w; }; /* pixel */ /* usa formato intero a 2 bytes */ struct pixel { short int x; short int y; }; /* struttura per definire una linea */ /* usa due riferimenti a strutture vertice */ struct line { @{"struct vertex" LINK File 44} *a; /* puntatore a st. vertex di partenza */ @{"struct vertex" LINK File 44} *b; /* puntatore a st. vertex d'arrivo */ }; /* struttura per definire direzione in spazio 3d */ struct dir3d { long int angx; long int angy; long int angz; }; /* struttura per definizione di un poligono */ struct polygon { char numpoints; short int color; short int shade; char twosided; char visible; char clipped; char active; long int vertexlist0; /* puntatore a #1 indice vertici */ long int vertexlist1; /* puntatore a #2 indice vertici */ long int vertexlist2; /* puntatore a #3 indice vertici */ long int vertexlist3; /* puntatore a #4 indice vertici */ }; /* struttura di descrizione di un oggetto */ struct objectnode { long int id; /* identificativo univoco per oggetto */ long int dummy; /* pad per poter usare name con StringF */ char name[22]; long int numverts; @{"struct vertex" LINK File 44} *vorig; /* puntatore a elenco vertici loc. orig. */ @{"struct vertex" LINK File 44} *vlocal; /* puntatore a elenco vertici locali */ @{"struct vertex" LINK File 44} *vcamera; /* puntatore a elenco vertici camera */ long int numpolys; @{"struct polygon" LINK File 143} *polys; /* puntatore a elenco poligoni */ char shade; /* metodo di visualiz. (WIRE,@{"SOLID" LINK File 20},@{"FLAT" LINK File 21}) */ char state; /* segnala se oggetto da visualizzare */ char clipped; /* segnala se oggetto clippato interamente*/ char trasf; /* flag per segnalare eventuale trasf. avv.*/ long int worldposx; /* coord. x punto d'inserzione oggetto */ long int worldposy; /* coord. y " " " */ long int worldposz; /* coord. z " " " */ long int xmax; /* vertici bounding box oggetto */ long int ymax; /* " */ long int zmax; /* " */ long int xmin; /* " */ long int ymin; /* " */ long int zmin; /* " */ }; /* struttura per definizione di un poligono da visualizzare */ struct polytemp { short int x1; short int y1; short int x2; short int y2; short int x3; short int y3; short int x4; short int y4; short int x5; short int y5; short int numpoints; short int shade; short int obj; long int npol; long int svalue; char vmode; }; /** struttura di descrizione generale ambiente, il puntatore ad essa va dato come primo parametro al richiamo di ogni funzione dall'esterno **/ struct ambient3d { @{"struct grafica" LINK File 276} *graf; /* valore ritornato da PE_ini_g */ struct Window *win; /* punt. a finestra usata */ long int half_screen_width; long int half_screen_height; long int viewing_distance; short int gl_triangle_color; short int minx; short int miny; short int maxx; short int maxy; short int maxintensity; long int near_z; long int far_z; long int aspect_ratio; /* num. reale a virgola fissa (val*@{"FIXV" LINK File 25}) */ long int ambient_light; /* num. reale a virgola fissa (val*@{"FIXV" LINK File 25}) */ long int inv_aspect_ratio; /* num. reale a virgola fissa (val*@{"FIXV" LINK File 25}) */ long int bord_col; /* colore bordo poligoni (se <0 no bordo)*/ long int gcolor; /* colore sfondo scena */ char projection_type; /* tipo di proiezione (0=pros. 1=paral.) */ char view_mode; /* modo vis. (1=flat 0=wire 2=solid) */ char clip_mode; char agg_all; /* flag per forzare aggiornamento scena */ long int dummy; @{"struct vector" LINK File 110} light_source; /* puntatore a struttura vector */ long int dummy1; @{"struct vector" LINK File 110} view_point; /* puntatore a struttura vector */ @{"struct dir3d" LINK File 135} view_angle; /* puntatore a struttura dir3d */ @{"struct matrix4x4" LINK File 78} global_view; /* puntatore a struttura matrix4x4 */ char *temp; /* puntatore ad area per uso temporaneo */ long int *iobjects; /* punt. ad array con indici su objects */ @{"struct objectnode" LINK File 159} *objects; /* punt. ad array di strutture objectnode */ long int *iwpolys; /* punt. ad array puntatori su worldpolys */ @{"struct polytemp" LINK File 186} *worldpolys; /* punt. ad array di strutture polytemp */ long int *sintable; /* punt. ad array di reali a virg. fissa */ long int *costable; /* punt. ad array di reali a virg. fissa */ long int total_polys; /* n# totale poligoni da tracciare */ short int total_objects; /* n# totale oggetti presenti */ long int attuale; /* oggetto attualmente selezionato */ long int numero; /* numero inc. alla creazione di un oggetto*/ long int iterazioni; /* n# iterazioni per sorting */ }; /* !!! STRUTTURE E DEFINIZIONI GLOBALI DI USO ESCLUSIVAMENTE INTERNO !!! */ #define MAXVER(vert) (vert*5+30) /**** dichiarazioni per poter usare sizeof con queste strutture ****/ /**** probabilmente utile solo se si usa VBCC v0.5 ****/ typedef @{"struct grafica" LINK File 276} Sgrafica; typedef struct AreaInfo SAreaInfo; typedef struct TmpRas STmpRas; typedef @{"struct objectnode" LINK File 159} Sobjectnode; typedef @{"struct vertex" LINK File 44} Svertex; typedef @{"struct polygon" LINK File 143} Spolygon; typedef @{"struct vector" LINK File 110} Svector; typedef @{"struct polytemp" LINK File 186} Spolytemp; typedef @{"struct dir3d" LINK File 135} Sdir3d; typedef @{"struct matrix4x4" LINK File 78} Smatrix4x4; typedef @{"struct ambient3d" LINK File 211} Sambient3d; /********************************************************************/ struct grafica { struct AreaInfo *o_ai; /* valore originale puntatore ad areainfo */ struct TmpRas *o_tr; /* valore originale puntatore ad tmprast */ struct AreaInfo n_ai; /* nuova areainfo */ struct TmpRas n_tr; /* nuova tmpras */ char *pras; /* puntatore a area di memoria grafica */ char *b_af; /* puntatore a buffer vettori per areafill */ long int lb_af; /* dimensioni area precedente */ struct ViewPort *vpor; /* puntatore a viewport dello schermo della fin.*/ struct RastPort *rast; /* puntatore a rastport usato dalle routin */ struct Window *wind; /* puntatore a finestra su cui agire */ long int larg; /* larghezza box in cui lavorera' areafill */ long int alte; /* altezza box in cui lavorera' areafill */ long int clipx; /* origine x clip box */ long int clipy; /* origine y clip box */ long int clipdx; /* larghezza clip box */ long int clipdy; /* altezza clip box */ /** estensioni per double buffering **/ char fdouble; /* flag per attivare double buffer (0=off 1=on)*/ struct RastPort *rast1;/* puntatore a rastport della finestra*/ struct RastPort *rast2;/* puntatore a rastport nascosto */ struct RasInfo *NB_rinfo; struct BitMap *NB_bmap; struct Layer_Info *NB_layerinfo; struct Layer *NB_layer; }; #endif /* GRAPHICS3D_GRAPHICS3D_H */ @ENDNODE