Al's Programming Resource Homepage  Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

general.h File Reference

#include "shared.h"
#include "polygon.h"
#include "texture.h"
#include "camera.h"
#include "light.h"
#include "bspline.h"
#include "bsp.h"
#include "tll.h"

Go to the source code of this file.

Functions

int SphereInFrustum (VECTOR point, float radius)
bool PointInFrustum (VECTOR point)
void ExtractFrustum ()
void AddSpline (int Number, LinkedList< SPLINE > &SplineList)
void DeleteSpline (int Number, LinkedList< SPLINE > &SplineList)
int LoadSplines (char *SplineFileName, CAMERA *camera, LIGHT *light)
void SetSplines (LinkedList< SPLINE > &)
void SetGLLighting (LIGHT *)
void SetGLCamera (CAMERA *)
void SetGLVertices (VERTEX *)
void SetGLWorld (POLYGON *, TEXTURE *, VERTEX *)
void SetGLProperties ()
void SetGLProjection (int Width, int Height)
void SetGLView (int Width, int Height)
void SetGLMaterial ()
int SetGLTexture (TEXTURE *)
void DrawMyText ()
void DrawGrid ()
void DrawWorld (BSP_node *)
void DrawSphere ()
void DrawGreenSphere ()
void DrawLightSphere (LIGHT *)
void DrawCone ()
float GetTimePassed (float &, int, float *)
bool CheckClipPlanes (CAMERA Camera, VECTOR Vect)
void DrawHalo (TEXTURE *texture, LIGHT *light, CAMERA *camera)
void DrawFire (TEXTURE *texture, LIGHT *light, CAMERA *camera)
void DrawBillboards (TEXTURE *texture, LIGHT *light, CAMERA *camera)


Function Documentation

void AddSpline int    Number,
LinkedList< SPLINE > &    SplineList
 

Definition at line 162 of file general.cpp.

References SPLINE::Active, SPLINE::Blue, SPLINE::Control, SPLINE::CopyOfEndTime, SPLINE::CopyOfStartTime, SPLINE::Degree, SPLINE::EndTime, SPLINE::Green, LinkedList< T >::Insert(), SPLINE::linkPosition, SPLINE::NumControl, SPLINE::NumPoints, SPLINE::Output, SPLINE::Red, SPLINE::Repeat, SplineList, SPLINE::StartTime, VECTOR::x, VECTOR::y, and VECTOR::z.

Referenced by LoadSplines(), and SetSplines().

00163 {
00164     SPLINE* spline2 = new SPLINE;
00165     spline2->Active = 1;
00166     spline2->Repeat = 1;
00167     spline2->Degree = 3;
00168     spline2->NumControl = 7;
00169     spline2->NumPoints = 100;
00170     spline2->Control = new VECTOR[100];
00171     spline2->Output = new VECTOR[1000];
00172     spline2->StartTime = 5000;
00173     spline2->EndTime = 25000;
00174     spline2->CopyOfStartTime = spline2->StartTime;
00175     spline2->CopyOfEndTime = spline2->EndTime;
00176 
00177     spline2->Red = ((float)(rand()%226) + 30.0) / 255;
00178     spline2->Green = ((float)(rand()%226) + 30.0) / 255;
00179     spline2->Blue = ((float)(rand()%266) + 30.0) / 255;
00180 
00181     for (int loop = 0; loop < 100; loop++)
00182     {
00183         spline2->Control[loop].x = rand()%60 - 29;  spline2->Control[loop].y = rand()%60 - 29;  spline2->Control[loop].z = rand()%60 - 29;
00184     }
00185 
00186     spline2->linkPosition = Number;   //Set the link position of the spline
00187     SplineList.Insert(spline2);       //Insert spline in linked list
00188 }

bool CheckClipPlanes CAMERA    Camera,
VECTOR    Vect
 

Definition at line 1680 of file general.cpp.

References MagnitudeVector(), MultMatrix(), OBJECT::Position, VECTOR::x, VECTOR::y, and VECTOR::z.

01681 {
01682   float ProjectionMatrix[16];
01683   float ModelViewMatrix[16];
01684   float A, B, C, Distance;
01685   int Counter = 0;
01686   glGetFloatv(GL_PROJECTION_MATRIX, ProjectionMatrix);
01687   glGetFloatv(GL_MODELVIEW_MATRIX, ModelViewMatrix);
01688 
01689   MultMatrix(ProjectionMatrix, ModelViewMatrix);
01690 
01691   //right clipping plane
01692   A = ProjectionMatrix[0] - ProjectionMatrix[3];
01693   B = ProjectionMatrix[4] - ProjectionMatrix[7];
01694   C = ProjectionMatrix[8] - ProjectionMatrix[11];
01695 
01696   Distance = -1 * (A * (-Camera.Position.x + Vect.x) + B * (-Camera.Position.y + Vect.y) + C * (-Camera.Position.z + Vect.z));
01697   if (Distance > 0)
01698     Counter++;
01699 
01700   //left clipping plane
01701   A = ProjectionMatrix[0] + ProjectionMatrix[3];
01702   B = ProjectionMatrix[4] + ProjectionMatrix[7];
01703   C = ProjectionMatrix[8] + ProjectionMatrix[11];
01704 
01705   Distance = A * (-Camera.Position.x + Vect.x) + B * (-Camera.Position.y + Vect.y) + C * (-Camera.Position.z + Vect.z);
01706   if (Distance > 0)
01707     Counter++;
01708 
01709   //top clipping plane
01710   A = ProjectionMatrix[1] - ProjectionMatrix[3];
01711   B = ProjectionMatrix[5] - ProjectionMatrix[7];
01712   C = ProjectionMatrix[9] - ProjectionMatrix[11];
01713 
01714   Distance = -1 * (A * (-Camera.Position.x + Vect.x) + B * (-Camera.Position.y + Vect.y) + C * (-Camera.Position.z + Vect.z));
01715   if (Distance > 0)
01716     Counter++;
01717 
01718   //bottom clipping plane
01719   A = ProjectionMatrix[1] + ProjectionMatrix[3];
01720   B = ProjectionMatrix[5] + ProjectionMatrix[7];
01721   C = ProjectionMatrix[9] + ProjectionMatrix[11];
01722 
01723   Distance = A * (-Camera.Position.x + Vect.x) + B * (-Camera.Position.y + Vect.y) + C * (-Camera.Position.z + Vect.z);
01724   if (Distance > 0)
01725     Counter++;
01726 
01727   // near clipping plane (might not be necessary when the near frustrum plane is close, but just in case)
01728   A = ProjectionMatrix[2] - ProjectionMatrix[3];
01729   B = ProjectionMatrix[6] - ProjectionMatrix[7];
01730   C = ProjectionMatrix[10] - ProjectionMatrix[11];
01731 
01732   Distance = A * (-Camera.Position.x + Vect.x) + B * (-Camera.Position.y + Vect.y) + C * (-Camera.Position.z + Vect.z);
01733   if (Distance > 0)
01734     Counter++;
01735 
01736   // far clipping plane (the equation didn't work for the far plane, so I'll just use a distance test)
01737   VECTOR Vect2;
01738   Vect2.x = Vect.x - Camera.Position.x;
01739   Vect2.y = Vect.y - Camera.Position.y;
01740   Vect2.z = Vect.z - Camera.Position.z;
01741   if (MagnitudeVector(Vect2) < 200)
01742     Counter++;
01743 
01744   if (Counter == 6)
01745     return 1;
01746   else
01747     return 0;
01748 }

void DeleteSpline int    Number,
LinkedList< SPLINE > &    SplineList
 

Definition at line 190 of file general.cpp.

References SPLINE::Control, LinkedList< T >::Delete(), LinkedList< T >::Get(), SPLINE::Output, and SplineList.

Referenced by LoadSplines(), and WndProc().

00191 {
00192     SPLINE* temp = SplineList.Get(Number);
00193     delete[] temp->Control;
00194     delete[] temp->Output;
00195     SplineList.Delete(Number);
00196     delete temp;
00197 }

void DrawBillboards TEXTURE   texture,
LIGHT   light,
CAMERA   camera
 

Definition at line 1872 of file general.cpp.

References DrawHalo(), and texture.

01873 {
01874         DrawHalo(texture, light, camera);
01875 
01876 /*
01877 // Draw depth sorted billboards
01878     VECTOR FirePosition(3.0, -2.0, -8.0);
01879 
01880     VECTOR VectorToCone;
01881     VectorToCone.x = FirePosition.x - camera[currentCamera].Position.x;
01882     VectorToCone.y = FirePosition.y - camera[currentCamera].Position.y;
01883     VectorToCone.z = FirePosition.z - camera[currentCamera].Position.z;
01884     float FireDistance = VectorToCone.GetMagnitude();
01885 
01886     VECTOR VectorToLight;
01887     VectorToLight.x = light[currentLight].Position.x - camera[currentCamera].Position.x;
01888     VectorToLight.y = light[currentLight].Position.y - camera[currentCamera].Position.y;
01889     VectorToLight.z = light[currentLight].Position.z - camera[currentCamera].Position.z;
01890     float LightDistance = VectorToLight.GetMagnitude();
01891 
01892     if(LightDistance < FireDistance)
01893     {
01894         DrawFire();
01895         DrawHalo();
01896     }
01897     else
01898     {
01899         DrawHalo();
01900         DrawFire();
01901     }
01902 //*/
01903 }

void DrawCone  
 

Definition at line 1623 of file general.cpp.

01624 {
01625     float mat_ambient[] = { 0.1, 0.5, 1.0, 1.0 };
01626     float mat_diffuse[] = { 0.1, 0.5, 1.0, 1.0 };
01627     glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
01628     glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
01629 
01630     glDisable(GL_TEXTURE_2D);
01631     glDisable(GL_CULL_FACE);
01632     glPushMatrix();
01633     glTranslatef(3.0f,-2.0f,-8.0f);
01634     glRotatef(-90,1,0,0);
01635     GLUquadricObj * cylinder = gluNewQuadric();
01636     gluQuadricOrientation(cylinder, GLU_OUTSIDE);
01637     gluCylinder(cylinder,1.0,0.0,2.0,20,20);
01638     glPopMatrix();
01639     glEnable(GL_CULL_FACE);
01640     glEnable(GL_TEXTURE_2D);
01641 }

void DrawFire TEXTURE   texture,
LIGHT   light,
CAMERA   camera
 

Definition at line 1815 of file general.cpp.

References CrossVector(), currentCamera, VECTOR::Normalize(), texture, VECTOR::x, VECTOR::y, and VECTOR::z.

01816 {
01817     float halfwidth = 1.0;
01818     float halfheight = 2.0;
01819     VECTOR FirePosition(3.0, -2.0 + halfheight, -8.0);
01820 //  Get the vector from the billboard position to the camera
01821     VECTOR A;
01822     A.x = (camera[currentCamera].Position.x - FirePosition.x);
01823     A.y = (camera[currentCamera].Position.y - FirePosition.y);
01824     A.z = (camera[currentCamera].Position.z - FirePosition.z);
01825     A.Normalize();
01826 // Set a vector to the standard up vector
01827     VECTOR B;
01828     B.x = (0);
01829     B.y = (1);
01830     B.z = (0);
01831     B.Normalize();
01832 // Take the cross product of these vectors to find a vector perpendicular to the camera
01833     VECTOR C = CrossVector(A, B);
01834     C.Normalize();
01835 
01836 // Negate the perpendicular vector to make the billboard face the front
01837     VECTOR right;
01838     right.x = -C.x * halfwidth;
01839     right.y = -C.y * halfwidth;
01840     right.z = -C.z * halfwidth;
01841 
01842     VECTOR up;
01843     up.x = 0;
01844     up.y = 1 * halfheight;
01845     up.z = 0;
01846 
01847 // Continue as normal
01848     float mat_ambient[] = { 0.2, 0.2, 0.2, 1.0 };
01849     float mat_diffuse[] = { 0.8, 0.8, 0.8, 1.0 };
01850     glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
01851     glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
01852     glEnable(GL_BLEND);
01853     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
01854     glEnable(GL_ALPHA_TEST);
01855     glAlphaFunc(GL_GREATER, 0);
01856     glDisable(GL_LIGHTING);
01857     glColor4f(1.0, 1.0, 1.0, 1.0);
01858     glBindTexture(GL_TEXTURE_2D, texture[2].TexID);
01859     glPopMatrix();
01860         glBegin(GL_QUADS);
01861             glTexCoord2f(0.0f, 0.0f); glVertex3f(FirePosition.x + (-right.x - up.x), FirePosition.y + (-right.y - up.y), FirePosition.z + (-right.z - up.z));
01862             glTexCoord2f(1.0f, 0.0f); glVertex3f(FirePosition.x + (right.x - up.x), FirePosition.y + (right.y - up.y), FirePosition.z + (right.z - up.z));
01863             glTexCoord2f(1.0f, 1.0f); glVertex3f(FirePosition.x + (right.x + up.x), FirePosition.y + (right.y + up.y), FirePosition.z + (right.z + up.z));
01864             glTexCoord2f(0.0f, 1.0f); glVertex3f(FirePosition.x + (up.x - right.x), FirePosition.y + (up.y - right.y), FirePosition.z + (up.z - right.z));
01865         glEnd();
01866     glPopMatrix();
01867     glEnable(GL_LIGHTING);
01868     glDisable(GL_ALPHA);
01869     glDisable(GL_BLEND);
01870 }

void DrawGreenSphere  
 

Definition at line 1589 of file general.cpp.

01590 {
01591     float mat_ambient[] = { 0.2, 1.0, 0.1, 1.0 };
01592     float mat_diffuse[] = { 0.2, 1.0, 0.1, 1.0 };
01593     glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
01594     glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
01595 //    glDisable(GL_TEXTURE_2D);
01596     glPushMatrix();
01597     glLoadIdentity();
01598     glTranslatef(-2.0, -2.0, -8.0);
01599     GLUquadricObj * sphere = gluNewQuadric();
01600     gluQuadricOrientation(sphere, GLU_OUTSIDE);
01601     gluSphere(sphere,0.3,20,20);
01602     glPopMatrix();
01603 //    glEnable(GL_TEXTURE_2D);
01604 }

void DrawGrid  
 

Definition at line 1521 of file general.cpp.

01522 {
01523     glDisable(GL_TEXTURE_2D);
01524     glDisable(GL_LIGHTING);
01525     glPushMatrix();
01526     glTranslatef(0,-2.0,0);
01527     glColor3f(0.0f,1.0f,0.0f);
01528 
01529     float Line = -10;
01530     int Grid;
01531     glBegin(GL_LINES);
01532     for(Grid = 0; Grid <= 20; Grid += 1)
01533     {
01534         glVertex3f(Line + Grid, 0, -10);
01535         glVertex3f(Line + Grid, 0, 10);
01536         glVertex3f(-10, 0, Line + Grid);
01537         glVertex3f(10, 0, Line + Grid);
01538     }
01539     glEnd();
01540     glPopMatrix();
01541     glEnable(GL_TEXTURE_2D);
01542     glEnable(GL_LIGHTING);
01543 }

void DrawHalo TEXTURE   texture,
LIGHT   light,
CAMERA   camera
 

Definition at line 1751 of file general.cpp.

References currentLight, MATRIX::Element, VECTOR::Normalize(), texture, VECTOR::x, VECTOR::y, and VECTOR::z.

Referenced by DrawBillboards().

01752 {
01753     float halfwidth = 2;
01754     float halfheight = 2;
01755 
01756     MATRIX mat;
01757     glGetFloatv(GL_MODELVIEW_MATRIX, mat.Element);
01758 
01759     VECTOR right;
01760     right.x = mat.Element[0];
01761     right.y = mat.Element[4];
01762     right.z = mat.Element[8];
01763     right.Normalize();
01764     right.x *= halfwidth;
01765     right.y *= halfwidth;
01766     right.z *= halfwidth;
01767 
01768     VECTOR up;
01769     up.x = mat.Element[1];
01770     up.y = mat.Element[5];
01771     up.z = mat.Element[9];
01772     up.Normalize();
01773     up.x *= halfheight;
01774     up.y *= halfheight;
01775     up.z *= halfheight;
01776 
01777 /*
01778    If you are using a quake style camera that doesn't roll
01779    then you can use the following commented code to make a conventional
01780    billboard remain vertical. If you are using a camera with 6DOF however,
01781    then this will not work.
01782 */
01783 
01784 /*
01785     up.x = 0.0;
01786     up.z = 0.0;
01787     right.y = 0.0;
01788 //*/
01789 
01790     float mat_ambient[] = { 0.2, 0.2, 0.2, 1.0 };
01791     float mat_diffuse[] = { 0.8, 0.8, 0.8, 1.0 };
01792     glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
01793     glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
01794     glEnable(GL_BLEND);
01795     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
01796     glEnable(GL_ALPHA_TEST);
01797     glAlphaFunc(GL_GREATER, 0);
01798     glDisable(GL_LIGHTING);
01799     glColor4f(1.0, 1.0, 1.0, 1.0);
01800     glBindTexture(GL_TEXTURE_2D, texture[1].TexID);
01801     glPopMatrix();
01802         glBegin(GL_QUADS);
01803             glTexCoord2f(0.0f, 0.0f); glVertex3f(light[currentLight].Position.x + (-right.x - up.x), light[currentLight].Position.y + (-right.y - up.y), light[currentLight].Position.z + (-right.z - up.z));
01804             glTexCoord2f(1.0f, 0.0f); glVertex3f(light[currentLight].Position.x + (right.x - up.x), light[currentLight].Position.y + (right.y - up.y), light[currentLight].Position.z + (right.z - up.z));
01805             glTexCoord2f(1.0f, 1.0f); glVertex3f(light[currentLight].Position.x + (right.x + up.x), light[currentLight].Position.y + (right.y + up.y), light[currentLight].Position.z + (right.z + up.z));
01806             glTexCoord2f(0.0f, 1.0f); glVertex3f(light[currentLight].Position.x + (up.x - right.x), light[currentLight].Position.y + (up.y - right.y), light[currentLight].Position.z + (up.z - right.z));
01807         glEnd();
01808     glPopMatrix();
01809     glEnable(GL_LIGHTING);
01810     glDisable(GL_ALPHA);
01811     glDisable(GL_BLEND);
01812 }

void DrawLightSphere LIGHT  
 

void DrawMyText  
 

Definition at line 1482 of file general.cpp.

References currentleaf, fps, glFontBegin(), glFontEnd(), glFontTextOut(), numcurrentportals, and numleavesvisible.

Referenced by DrawGLScene().

01483 {
01484     glBlendFunc(GL_ONE,  GL_ONE_MINUS_SRC_ALPHA) ;
01485     glDisable(GL_LIGHTING);
01486     glColor3f(0.0, 1.0, 0.0);
01487     glEnable(GL_BLEND);
01488     glDisable(GL_DEPTH_TEST);
01489     glPushMatrix();
01490     glLoadIdentity();
01491     glFontBegin(&myFont);
01492     char text[256];
01493 
01494     glFontTextOut("Tutorial #14  (Potentially Visible Set)", -52, 40, -100);
01495 
01496     sprintf(text, "FPS = %d", fps);
01497     glFontTextOut(text, -52, 38, -100);
01498 
01499     sprintf(text, "%s", "Press M to change camera mode");
01500     glFontTextOut(text, -52, 34, -100);
01501 
01502     sprintf(text, "%s", "Press P to toggle the portal rendering");
01503     glFontTextOut(text, -52, 30, -100);
01504 
01505     sprintf(text, "Number of leaves visible = %d", numleavesvisible);
01506     glFontTextOut(text, -52, 26, -100);
01507 
01508     sprintf(text, "Current leaf = %d", currentleaf);
01509     glFontTextOut(text, -52, 22, -100);
01510 
01511     sprintf(text, "Number of portals = %d", numcurrentportals);
01512     glFontTextOut(text, -52, 18, -100);
01513 
01514     glFontEnd();
01515     glPopMatrix();
01516     glEnable(GL_DEPTH_TEST);
01517     glDisable(GL_BLEND);
01518     glEnable(GL_LIGHTING);
01519 }

void DrawSphere  
 

Definition at line 1606 of file general.cpp.

01607 {
01608     float mat_ambient[] = { 0.8, 0.5, 0.1, 1.0 };
01609     float mat_diffuse[] = { 0.8, 0.5, 0.1, 1.0 };
01610     glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
01611     glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
01612 
01613     glDisable(GL_TEXTURE_2D);
01614     glPushMatrix();
01615     glTranslatef(-3.0f,-1.0f,-8.0f);
01616     GLUquadricObj * sphere = gluNewQuadric();
01617     gluQuadricOrientation(sphere, GLU_OUTSIDE);
01618     gluSphere(sphere, 1.0, 50, 50);
01619     glPopMatrix();
01620     glEnable(GL_TEXTURE_2D);
01621 }

void DrawWorld BSP_node  
 

Definition at line 1545 of file general.cpp.

References RenderBSP().

Referenced by DrawGLScene().

01546 {
01547     float mat_ambient[] = { 0.8, 0.8, 0.8, 1.0 };
01548     float mat_diffuse[] = { 0.8, 0.8, 0.8, 1.0 };
01549     glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
01550     glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
01551 
01552     glPushMatrix();
01553 
01554     glDisable (GL_DEPTH_TEST);
01555     RenderBSP(root);
01556     glEnable (GL_DEPTH_TEST);
01557 
01558     glPopMatrix();
01559 
01560 /*
01561     //Draw polygons that are in the leaf
01562     for (int loop = 0; loop < numPolygons; loop++)
01563     {
01564         glMatrixMode(GL_TEXTURE);
01565         glPushMatrix();
01566 
01567 
01568         glScalef(polygon[loop].Scale[0], polygon[loop].Scale[1], 1.0f);
01569         glTranslatef(polygon[loop].Shift[0], polygon[loop].Shift[1], 0.0f);
01570         glRotatef(polygon[loop].Rotate, 0.0f, 0.0f, 1.0f);
01571 
01572         glBindTexture(GL_TEXTURE_2D, polygon[loop].Texture);
01573         glBegin(GL_TRIANGLES);
01574         glNormal3fv(&polygon[loop].Vertex[0].nx);
01575         glTexCoord2f(polygon[loop].Vertex[0].u, polygon[loop].Vertex[0].v);
01576         glVertex3fv(&polygon[loop].Vertex[0].x);
01577         glTexCoord2f(polygon[loop].Vertex[1].u, polygon[loop].Vertex[1].v);
01578         glVertex3fv(&polygon[loop].Vertex[1].x);
01579         glTexCoord2f(polygon[loop].Vertex[2].u, polygon[loop].Vertex[2].v);
01580         glVertex3fv(&polygon[loop].Vertex[2].x);
01581         glEnd();
01582 
01583         glPopMatrix();
01584         glMatrixMode(GL_MODELVIEW);
01585     }
01586 */
01587 }

void ExtractFrustum  
 

Definition at line 66 of file general.cpp.

References PLANE::Distance, PLANE::nx, PLANE::ny, and PLANE::nz.

Referenced by DrawGLScene().

00067 {
00068     float proj[16];
00069     float modl[16];
00070     float clip[16];
00071     float t;
00072     /* Get the current PROJECTION matrix from OpenGL */
00073     glGetFloatv( GL_PROJECTION_MATRIX, proj );
00074     /* Get the current MODELVIEW matrix from OpenGL */
00075     glGetFloatv( GL_MODELVIEW_MATRIX, modl );
00076     /* Combine the two matrices (multiply projection by modelview) */
00077     clip[ 0] = modl[ 0] * proj[ 0] + modl[ 1] * proj[ 4] + modl[ 2] * proj[ 8] + modl[ 3] * proj[12];
00078     clip[ 1] = modl[ 0] * proj[ 1] + modl[ 1] * proj[ 5] + modl[ 2] * proj[ 9] + modl[ 3] * proj[13];
00079     clip[ 2] = modl[ 0] * proj[ 2] + modl[ 1] * proj[ 6] + modl[ 2] * proj[10] + modl[ 3] * proj[14];
00080     clip[ 3] = modl[ 0] * proj[ 3] + modl[ 1] * proj[ 7] + modl[ 2] * proj[11] + modl[ 3] * proj[15];
00081     clip[ 4] = modl[ 4] * proj[ 0] + modl[ 5] * proj[ 4] + modl[ 6] * proj[ 8] + modl[ 7] * proj[12];
00082     clip[ 5] = modl[ 4] * proj[ 1] + modl[ 5] * proj[ 5] + modl[ 6] * proj[ 9] + modl[ 7] * proj[13];
00083     clip[ 6] = modl[ 4] * proj[ 2] + modl[ 5] * proj[ 6] + modl[ 6] * proj[10] + modl[ 7] * proj[14];
00084     clip[ 7] = modl[ 4] * proj[ 3] + modl[ 5] * proj[ 7] + modl[ 6] * proj[11] + modl[ 7] * proj[15];
00085     clip[ 8] = modl[ 8] * proj[ 0] + modl[ 9] * proj[ 4] + modl[10] * proj[ 8] + modl[11] * proj[12];
00086     clip[ 9] = modl[ 8] * proj[ 1] + modl[ 9] * proj[ 5] + modl[10] * proj[ 9] + modl[11] * proj[13];
00087     clip[10] = modl[ 8] * proj[ 2] + modl[ 9] * proj[ 6] + modl[10] * proj[10] + modl[11] * proj[14];
00088     clip[11] = modl[ 8] * proj[ 3] + modl[ 9] * proj[ 7] + modl[10] * proj[11] + modl[11] * proj[15];
00089     clip[12] = modl[12] * proj[ 0] + modl[13] * proj[ 4] + modl[14] * proj[ 8] + modl[15] * proj[12];
00090     clip[13] = modl[12] * proj[ 1] + modl[13] * proj[ 5] + modl[14] * proj[ 9] + modl[15] * proj[13];
00091     clip[14] = modl[12] * proj[ 2] + modl[13] * proj[ 6] + modl[14] * proj[10] + modl[15] * proj[14];
00092     clip[15] = modl[12] * proj[ 3] + modl[13] * proj[ 7] + modl[14] * proj[11] + modl[15] * proj[15];
00093 
00094     /* Extract the numbers for the RIGHT plane */
00095     frustum[0].nx = clip[ 3] - clip[ 0];
00096     frustum[0].ny = clip[ 7] - clip[ 4];
00097     frustum[0].nz = clip[11] - clip[ 8];
00098     frustum[0].Distance = clip[15] - clip[12];
00099     /* Normalize the result */
00100     t = sqrt( frustum[0].nx * frustum[0].nx + frustum[0].ny * frustum[0].ny + frustum[0].nz * frustum[0].nz);
00101     frustum[0].nx /= t;
00102     frustum[0].ny /= t;
00103     frustum[0].nz /= t;
00104     frustum[0].Distance /= t;
00105     /* Extract the numbers for the LEFT plane */
00106     frustum[1].nx = clip[ 3] + clip[ 0];
00107     frustum[1].ny = clip[ 7] + clip[ 4];
00108     frustum[1].nz = clip[11] + clip[ 8];
00109     frustum[1].Distance = clip[15] + clip[12];
00110     /* Normalize the result */
00111     t = sqrt( frustum[1].nx * frustum[1].nx + frustum[1].ny * frustum[1].ny + frustum[1].nz * frustum[1].nz);
00112     frustum[1].nx /= t;
00113     frustum[1].ny /= t;
00114     frustum[1].nz /= t;
00115     frustum[1].Distance /= t;
00116     /* Extract the BOTTOM plane */
00117     frustum[2].nx = clip[ 3] + clip[ 1];
00118     frustum[2].ny = clip[ 7] + clip[ 5];
00119     frustum[2].nz = clip[11] + clip[ 9];
00120     frustum[2].Distance = clip[15] + clip[13];
00121     /* Normalize the result */
00122     t = sqrt( frustum[2].nx * frustum[2].nx + frustum[2].ny * frustum[2].ny + frustum[2].nz * frustum[2].nz);
00123     frustum[2].nx /= t;
00124     frustum[2].ny /= t;
00125     frustum[2].nz /= t;
00126     frustum[2].Distance /= t;
00127     /* Extract the TOP plane */
00128     frustum[3].nx = clip[ 3] - clip[ 1];
00129     frustum[3].ny = clip[ 7] - clip[ 5];
00130     frustum[3].nz = clip[11] - clip[ 9];
00131     frustum[3].Distance = clip[15] - clip[13];
00132     /* Normalize the result */
00133     t = sqrt( frustum[3].nx * frustum[3].nx + frustum[3].ny * frustum[3].ny + frustum[3].nz * frustum[3].nz);
00134     frustum[3].nx /= t;
00135     frustum[3].ny /= t;
00136     frustum[3].nz /= t;
00137     frustum[3].Distance /= t;
00138     /* Extract the FAR plane */
00139     frustum[4].nx = clip[ 3] - clip[ 2];
00140     frustum[4].ny = clip[ 7] - clip[ 6];
00141     frustum[4].nz = clip[11] - clip[10];
00142     frustum[4].Distance = clip[15] - clip[14];
00143     /* Normalize the result */
00144     t = sqrt( frustum[4].nx * frustum[4].nx + frustum[4].ny * frustum[4].ny + frustum[4].nz * frustum[4].nz);
00145     frustum[4].nx /= t;
00146     frustum[4].ny /= t;
00147     frustum[4].nz /= t;
00148     frustum[4].Distance /= t;
00149     /* Extract the NEAR plane */
00150     frustum[5].nx = clip[ 3] + clip[ 2];
00151     frustum[5].ny = clip[ 7] + clip[ 6];
00152     frustum[5].nz = clip[11] + clip[10];
00153     frustum[5].Distance = clip[15] + clip[14];
00154     /* Normalize the result */
00155     t = sqrt( frustum[5].nx * frustum[5].nx + frustum[5].ny * frustum[5].ny + frustum[5].nz * frustum[5].nz);
00156     frustum[5].nx /= t;
00157     frustum[5].ny /= t;
00158     frustum[5].nz /= t;
00159     frustum[5].Distance /= t;
00160 }

float GetTimePassed float &   ,
int   ,
float *   
 

Definition at line 1643 of file general.cpp.

References average, fps, lastmultiplier, lasttime, and multiplier.

Referenced by WinMain().

01644 {
01645     float timeoffset;
01646     float currenttime;
01647 /*
01648 If the program has just started, set last tickcount to the current tickcount.
01649 This prevents the program from thinking that several hours have passed since the last frame.
01650 */
01651     if (lasttime == 0)
01652         lasttime = (float)GetTickCount();
01653         // Get the current time
01654     currenttime = (float)GetTickCount();
01655         // Calculate the offset
01656     timeoffset = currenttime - lasttime;
01657     // If timeoffset less than 1/120 of a second (in milliseconds) then set to minimum offset
01658     if (timeoffset < 8.333333)
01659     {
01660         timeoffset = 8.333333;
01661         currenttime = lasttime + timeoffset;
01662     }
01663     // Put the current time in the lasttime variable
01664         lasttime = currenttime;
01665     // return the time offset in seconds per frame
01666         multiplier = timeoffset / 1000;
01667     for (int loop = 0; loop < average - 1; loop++)
01668     {
01669         lastmultiplier[loop] = lastmultiplier[loop + 1];
01670     }
01671     lastmultiplier[average - 1] = multiplier;
01672     for (int loop = 0; loop < average - 1; loop++)
01673         multiplier += lastmultiplier[loop];
01674     multiplier /= (float)average; 
01675         if (multiplier)
01676         fps = (int)(1.0 / multiplier);
01677     return multiplier;
01678 }

int LoadSplines char *    SplineFileName,
CAMERA   camera,
LIGHT   light
 

Referenced by SetSplines().

bool PointInFrustum VECTOR    point
 

Definition at line 56 of file general.cpp.

References PLANE::Distance, PLANE::nx, PLANE::ny, PLANE::nz, VECTOR::x, VECTOR::y, and VECTOR::z.

00057 {
00058    int p;
00059 
00060    for( p = 0; p < 6; p++ )
00061       if( frustum[p].nx * point.x + frustum[p].ny * point.y + frustum[p].nz * point.z + frustum[p].Distance <= 0 )
00062          return false;
00063    return true;
00064 }

void SetGLCamera CAMERA  
 

Definition at line 311 of file general.cpp.

References numCameras.

Referenced by InitGL().

00312 {
00313     int temp;
00314     for(temp = 0; temp <= numCameras; temp++)
00315         camera[temp].Reset();
00316 }

void SetGLLighting LIGHT  
 

Definition at line 300 of file general.cpp.

References numLights.

Referenced by InitGL().

00301 {
00302     int temp;
00303     for (temp = 0; temp <= numLights; temp++)
00304     {
00305         light[temp].LightNumber = temp;
00306         light[temp].Reset();
00307     }
00308     glEnable(GL_LIGHTING);
00309 }

void SetGLMaterial  
 

Definition at line 1436 of file general.cpp.

Referenced by InitGL().

01437 {
01438     float mat_ambient[] = { 1.0, 1.0, 1.0, 1.0 };
01439     float mat_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
01440     float mat_specular[] = { 0.9, 0.9, 0.9, 1.0 };
01441     float mat_emission[] = { 0.0, 0.0, 0.0, 1.0 };
01442     float mat_shininess[] = { 80.0 };
01443 
01444     glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
01445     glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
01446     glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
01447     glMaterialfv(GL_FRONT, GL_EMISSION, mat_emission);
01448     glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
01449 }

void SetGLProjection int    Width,
int    Height
 

Definition at line 1419 of file general.cpp.

Referenced by SetGLView().

01420 {
01421     if (Height==0)
01422         Height=1;
01423     glViewport(0, 0, Width, Height);
01424     glMatrixMode(GL_PROJECTION);
01425     glLoadIdentity();
01426     gluPerspective(45.0,(float)Width/(float)Height, 0.8, 500.0);
01427 }

void SetGLProperties  
 

Definition at line 1407 of file general.cpp.

Referenced by InitGL().

01408 {
01409     glCullFace(GL_BACK);
01410     glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
01411     glClearDepth(1.0);
01412     glDepthFunc(GL_LESS);
01413     glEnable(GL_DEPTH_TEST);
01414     glShadeModel(GL_SMOOTH);
01415     glEnable(GL_NORMALIZE);
01416     glEnable(GL_CULL_FACE);
01417 }

int SetGLTexture TEXTURE  
 

Definition at line 1451 of file general.cpp.

References FALSE, TEXTURE::LoadTGA(), texture, and TRUE.

Referenced by InitGL().

01452 {
01453     glEnable(GL_TEXTURE_2D);
01454 
01455     sprintf(texture[0].TexName, "%s", "floor.tga");
01456     if (!texture[0].LoadTGA())
01457     {
01458         MessageBox(NULL,"Failed to load floor image","Error",MB_OK|MB_ICONERROR);
01459         return FALSE;
01460     }
01461     sprintf(texture[1].TexName, "%s", "roof.tga");
01462     if (!texture[1].LoadTGA())
01463     {
01464         MessageBox(NULL,"Failed to load roof image","Error",MB_OK|MB_ICONERROR);
01465         return FALSE;
01466     }
01467     sprintf(texture[2].TexName, "%s", "wall.tga");
01468     if (!texture[2].LoadTGA())
01469     {
01470         MessageBox(NULL,"Failed to load wall image","Error",MB_OK|MB_ICONERROR);
01471         return FALSE;
01472     }
01473     sprintf(texture[3].TexName, "%s", "tile.tga");
01474     if (!texture[3].LoadTGA())
01475     {
01476         MessageBox(NULL,"Failed to load tile image","Error",MB_OK|MB_ICONERROR);
01477         return FALSE;
01478     }
01479     return TRUE;
01480 }

void SetGLVertices VERTEX  
 

Definition at line 318 of file general.cpp.

References vertex, VERTEX::x, VERTEX::y, and VERTEX::z.

Referenced by SetGLWorld().

00319 {
00320     vertex[0].x = -80;
00321     vertex[0].y = -10;
00322     vertex[0].z = -60;
00323 
00324     vertex[1].x = 20;
00325     vertex[1].y = -10;
00326     vertex[1].z = -60;
00327 
00328     vertex[2].x = 20;
00329     vertex[2].y = -10;
00330     vertex[2].z = -40;
00331 
00332     vertex[3].x = 170;
00333     vertex[3].y = -10;
00334     vertex[3].z = -40;
00335 
00336     vertex[4].x = 170;
00337     vertex[4].y = -10;
00338     vertex[4].z = 40;
00339 
00340     vertex[5].x = 120;
00341     vertex[5].y = -10;
00342     vertex[5].z = 40;
00343 
00344     vertex[6].x = 120;
00345     vertex[6].y = -10;
00346     vertex[6].z = 80;
00347 
00348     vertex[7].x = 160;
00349     vertex[7].y = -10;
00350     vertex[7].z = 80;
00351 
00352     vertex[8].x = 160;
00353     vertex[8].y = -10;
00354     vertex[8].z = 160;
00355 
00356     vertex[9].x = 60;
00357     vertex[9].y = -10;
00358     vertex[9].z = 160;
00359 
00360     vertex[10].x = 60;
00361     vertex[10].y = -10;
00362     vertex[10].z = 80;
00363 
00364     vertex[11].x = 100;
00365     vertex[11].y = -10;
00366     vertex[11].z = 80;
00367 
00368     vertex[12].x = 100;
00369     vertex[12].y = -10;
00370     vertex[12].z = 40;
00371 
00372     vertex[13].x = 20;
00373     vertex[13].y = -10;
00374     vertex[13].z = 40;
00375 
00376     vertex[14].x = 20;
00377     vertex[14].y = -10;
00378     vertex[14].z = 60;
00379 
00380     vertex[15].x = -80;
00381     vertex[15].y = -10;
00382     vertex[15].z = 60;
00383 
00384     vertex[16].x = -80;
00385     vertex[16].y = 10;
00386     vertex[16].z = -60;
00387 
00388     vertex[17].x = 20;
00389     vertex[17].y = 10;
00390     vertex[17].z = -60;
00391 
00392     vertex[18].x = 20;
00393     vertex[18].y = 10;
00394     vertex[18].z = -40;
00395 
00396     vertex[19].x = 170;
00397     vertex[19].y = 10;
00398     vertex[19].z = -40;
00399 
00400     vertex[20].x = 170;
00401     vertex[20].y = 10;
00402     vertex[20].z = 40;
00403 
00404     vertex[21].x = 120;
00405     vertex[21].y = 10;
00406     vertex[21].z = 40;
00407 
00408     vertex[22].x = 120;
00409     vertex[22].y = 10;
00410     vertex[22].z = 80;
00411 
00412     vertex[23].x = 160;
00413     vertex[23].y = 10;
00414     vertex[23].z = 80;
00415 
00416     vertex[24].x = 160;
00417     vertex[24].y = 10;
00418     vertex[24].z = 160;
00419 
00420     vertex[25].x = 60;
00421     vertex[25].y = 10;
00422     vertex[25].z = 160;
00423 
00424     vertex[26].x = 60;
00425     vertex[26].y = 10;
00426     vertex[26].z = 80;
00427 
00428     vertex[27].x = 100;
00429     vertex[27].y = 10;
00430     vertex[27].z = 80;
00431 
00432     vertex[28].x = 100;
00433     vertex[28].y = 10;
00434     vertex[28].z = 40;
00435 
00436     vertex[29].x = 20;
00437     vertex[29].y = 10;
00438     vertex[29].z = 40;
00439 
00440     vertex[30].x = 20;
00441     vertex[30].y = 10;
00442     vertex[30].z = 60;
00443 
00444     vertex[31].x = -80;
00445     vertex[31].y = 10;
00446     vertex[31].z = 60;
00447 
00448     vertex[32].x = -80;
00449     vertex[32].y = 10;
00450     vertex[32].z = 40;
00451 
00452     vertex[33].x = -80;
00453     vertex[33].y = 40;
00454     vertex[33].z = 0;
00455 
00456     vertex[34].x = -80;
00457     vertex[34].y = 10;
00458     vertex[34].z = -40;
00459 
00460     vertex[35].x = 20;
00461     vertex[35].y = 40;
00462     vertex[35].z = 0;
00463 
00464     vertex[36].x = 170;
00465     vertex[36].y = 40;
00466     vertex[36].z = 0;
00467 }

void SetGLView int    Width,
int    Height
 

Definition at line 1429 of file general.cpp.

References SetGLProjection().

Referenced by ReSizeGLScene().

01430 {
01431     SetGLProjection(Width, Height);
01432     glMatrixMode(GL_MODELVIEW);
01433     glLoadIdentity();
01434 }

void SetGLWorld POLYGON  ,
TEXTURE  ,
VERTEX  
 

Definition at line 470 of file general.cpp.

References numPolygons, polygon, POLYGON::Rotate, POLYGON::Scale, SetGLVertices(), POLYGON::SetNormal(), POLYGON::Shift, TEXTURE::TexID, POLYGON::Texture, texture, VERTEX::u, VERTEX::v, POLYGON::Vertex, and vertex.

Referenced by InitGL().

00471 {
00472     SetGLVertices(vertex);
00473 
00474     polygon[0].Scale[0] = 6.0;
00475     polygon[0].Scale[1] = 1.0;
00476     polygon[0].Shift[0] = 0.0;
00477     polygon[0].Shift[1] = 0.0;
00478     polygon[0].Rotate = 0.0;
00479     polygon[0].Vertex[0] = vertex[0];
00480     polygon[0].Vertex[1] = vertex[17];
00481     polygon[0].Vertex[2] = vertex[16];
00482     polygon[0].Texture = texture[2].TexID;
00483     polygon[0].Vertex[0].u = 0.0;
00484     polygon[0].Vertex[0].v = 0.0;
00485     polygon[0].Vertex[1].u = 1.0;
00486     polygon[0].Vertex[1].v = 1.0;
00487     polygon[0].Vertex[2].u = 0.0;
00488     polygon[0].Vertex[2].v = 1.0;
00489 
00490     polygon[1].Scale[0] = 6.0;
00491     polygon[1].Scale[1] = 1.0;
00492     polygon[1].Shift[0] = 0.0;
00493     polygon[1].Shift[1] = 0.0;
00494     polygon[1].Rotate = 0.0;
00495     polygon[1].Vertex[0] = vertex[0];
00496     polygon[1].Vertex[1] = vertex[1];
00497     polygon[1].Vertex[2] = vertex[17];
00498     polygon[1].Texture = texture[2].TexID;
00499     polygon[1].Vertex[0].u = 0.0;
00500     polygon[1].Vertex[0].v = 0.0;
00501     polygon[1].Vertex[1].u = 1.0;
00502     polygon[1].Vertex[1].v = 0.0;
00503     polygon[1].Vertex[2].u = 1.0;
00504     polygon[1].Vertex[2].v = 1.0;
00505 
00506     polygon[2].Scale[0] = 1.0;
00507     polygon[2].Scale[1] = 1.0;
00508     polygon[2].Shift[0] = 0.0;
00509     polygon[2].Shift[1] = 0.0;
00510     polygon[2].Rotate = 0.0;
00511     polygon[2].Vertex[0] = vertex[1];
00512     polygon[2].Vertex[1] = vertex[18];
00513     polygon[2].Vertex[2] = vertex[17];
00514     polygon[2].Texture = texture[2].TexID;
00515     polygon[2].Vertex[0].u = 0.0;
00516     polygon[2].Vertex[0].v = 0.0;
00517     polygon[2].Vertex[1].u = 1.0;
00518     polygon[2].Vertex[1].v = 1.0;
00519     polygon[2].Vertex[2].u = 0.0;
00520     polygon[2].Vertex[2].v = 1.0;
00521 
00522     polygon[3].Scale[0] = 1.0;
00523     polygon[3].Scale[1] = 1.0;
00524     polygon[3].Shift[0] = 0.0;
00525     polygon[3].Shift[1] = 0.0;
00526     polygon[3].Rotate = 0.0;
00527     polygon[3].Vertex[0] = vertex[1];
00528     polygon[3].Vertex[1] = vertex[2];
00529     polygon[3].Vertex[2] = vertex[18];
00530     polygon[3].Texture = texture[2].TexID;
00531     polygon[3].Vertex[0].u = 0.0;
00532     polygon[3].Vertex[0].v = 0.0;
00533     polygon[3].Vertex[1].u = 1.0;
00534     polygon[3].Vertex[1].v = 0.0;
00535     polygon[3].Vertex[2].u = 1.0;
00536     polygon[3].Vertex[2].v = 1.0;
00537 
00538     polygon[4].Scale[0] = 5.0;
00539     polygon[4].Scale[1] = 1.0;
00540     polygon[4].Shift[0] = 0.0;
00541     polygon[4].Shift[1] = 0.0;
00542     polygon[4].Rotate = 0.0;
00543     polygon[4].Vertex[0] = vertex[2];
00544     polygon[4].Vertex[1] = vertex[19];
00545     polygon[4].Vertex[2] = vertex[18];
00546     polygon[4].Texture = texture[2].TexID;
00547     polygon[4].Vertex[0].u = 0.0;
00548     polygon[4].Vertex[0].v = 0.0;
00549     polygon[4].Vertex[1].u = 1.0;
00550     polygon[4].Vertex[1].v = 1.0;
00551     polygon[4].Vertex[2].u = 0.0;
00552     polygon[4].Vertex[2].v = 1.0;
00553 
00554     polygon[5].Scale[0] = 5.0;
00555     polygon[5].Scale[1] = 1.0;
00556     polygon[5].Shift[0] = 0.0;
00557     polygon[5].Shift[1] = 0.0;
00558     polygon[5].Rotate = 0.0;
00559     polygon[5].Vertex[0] = vertex[2];
00560     polygon[5].Vertex[1] = vertex[3];
00561     polygon[5].Vertex[2] = vertex[19];
00562     polygon[5].Texture = texture[2].TexID;
00563     polygon[5].Vertex[0].u = 0.0;
00564     polygon[5].Vertex[0].v = 0.0;
00565     polygon[5].Vertex[1].u = 1.0;
00566     polygon[5].Vertex[1].v = 0.0;
00567     polygon[5].Vertex[2].u = 1.0;
00568     polygon[5].Vertex[2].v = 1.0;
00569 
00570     polygon[6].Scale[0] = 4.0;
00571     polygon[6].Scale[1] = 1.0;
00572     polygon[6].Shift[0] = 0.0;
00573     polygon[6].Shift[1] = 0.0;
00574     polygon[6].Rotate = 0.0;
00575     polygon[6].Vertex[0] = vertex[3];
00576     polygon[6].Vertex[1] = vertex[20];
00577     polygon[6].Vertex[2] = vertex[19];
00578     polygon[6].Texture = texture[2].TexID;
00579     polygon[6].Vertex[0].u = 0.0;
00580     polygon[6].Vertex[0].v = 0.0;
00581     polygon[6].Vertex[1].u = 1.0;
00582     polygon[6].Vertex[1].v = 1.0;
00583     polygon[6].Vertex[2].u = 0.0;
00584     polygon[6].Vertex[2].v = 1.0;
00585 
00586     polygon[7].Scale[0] = 4.0;
00587     polygon[7].Scale[1] = 1.0;
00588     polygon[7].Shift[0] = 0.0;
00589     polygon[7].Shift[1] = 0.0;
00590     polygon[7].Rotate = 0.0;
00591     polygon[7].Vertex[0] = vertex[3];
00592     polygon[7].Vertex[1] = vertex[4];
00593     polygon[7].Vertex[2] = vertex[20];
00594     polygon[7].Texture = texture[2].TexID;
00595     polygon[7].Vertex[0].u = 0.0;
00596     polygon[7].Vertex[0].v = 0.0;
00597     polygon[7].Vertex[1].u = 1.0;
00598     polygon[7].Vertex[1].v = 0.0;
00599     polygon[7].Vertex[2].u = 1.0;
00600     polygon[7].Vertex[2].v = 1.0;
00601 
00602     polygon[8].Scale[0] = 2.0;
00603     polygon[8].Scale[1] = 1.0;
00604     polygon[8].Shift[0] = 0.0;
00605     polygon[8].Shift[1] = 0.0;
00606     polygon[8].Rotate = 0.0;
00607     polygon[8].Vertex[0] = vertex[4];
00608     polygon[8].Vertex[1] = vertex[21];
00609     polygon[8].Vertex[2] = vertex[20];
00610     polygon[8].Texture = texture[2].TexID;
00611     polygon[8].Vertex[0].u = 0.0;
00612     polygon[8].Vertex[0].v = 0.0;
00613     polygon[8].Vertex[1].u = 1.0;
00614     polygon[8].Vertex[1].v = 1.0;
00615     polygon[8].Vertex[2].u = 0.0;
00616     polygon[8].Vertex[2].v = 1.0;
00617 
00618     polygon[9].Scale[0] = 2.0;
00619     polygon[9].Scale[1] = 1.0;
00620     polygon[9].Shift[0] = 0.0;
00621     polygon[9].Shift[1] = 0.0;
00622     polygon[9].Rotate = 0.0;
00623     polygon[9].Vertex[0] = vertex[4];
00624     polygon[9].Vertex[1] = vertex[5];
00625     polygon[9].Vertex[2] = vertex[21];
00626     polygon[9].Texture = texture[2].TexID;
00627     polygon[9].Vertex[0].u = 0.0;
00628     polygon[9].Vertex[0].v = 0.0;
00629     polygon[9].Vertex[1].u = 1.0;
00630     polygon[9].Vertex[1].v = 0.0;
00631     polygon[9].Vertex[2].u = 1.0;
00632     polygon[9].Vertex[2].v = 1.0;
00633 
00634     polygon[10].Scale[0] = 2.0;
00635     polygon[10].Scale[1] = 1.0;
00636     polygon[10].Shift[0] = 0.0;
00637     polygon[10].Shift[1] = 0.0;
00638     polygon[10].Rotate = 0.0;
00639     polygon[10].Vertex[0] = vertex[5];
00640     polygon[10].Vertex[1] = vertex[22];
00641     polygon[10].Vertex[2] = vertex[21];
00642     polygon[10].Texture = texture[2].TexID;
00643     polygon[10].Vertex[0].u = 0.0;
00644     polygon[10].Vertex[0].v = 0.0;
00645     polygon[10].Vertex[1].u = 1.0;
00646     polygon[10].Vertex[1].v = 1.0;
00647     polygon[10].Vertex[2].u = 0.0;
00648     polygon[10].Vertex[2].v = 1.0;
00649 
00650     polygon[11].Scale[0] = 2.0;
00651     polygon[11].Scale[1] = 1.0;
00652     polygon[11].Shift[0] = 0.0;
00653     polygon[11].Shift[1] = 0.0;
00654     polygon[11].Rotate = 0.0;
00655     polygon[11].Vertex[0] = vertex[5];
00656     polygon[11].Vertex[1] = vertex[6];
00657     polygon[11].Vertex[2] = vertex[22];
00658     polygon[11].Texture = texture[2].TexID;
00659     polygon[11].Vertex[0].u = 0.0;
00660     polygon[11].Vertex[0].v = 0.0;
00661     polygon[11].Vertex[1].u = 1.0;
00662     polygon[11].Vertex[1].v = 0.0;
00663     polygon[11].Vertex[2].u = 1.0;
00664     polygon[11].Vertex[2].v = 1.0;
00665 
00666     polygon[12].Scale[0] = 2.0;
00667     polygon[12].Scale[1] = 1.0;
00668     polygon[12].Shift[0] = 0.0;
00669     polygon[12].Shift[1] = 0.0;
00670     polygon[12].Rotate = 0.0;
00671     polygon[12].Vertex[0] = vertex[6];
00672     polygon[12].Vertex[1] = vertex[23];
00673     polygon[12].Vertex[2] = vertex[22];
00674     polygon[12].Texture = texture[2].TexID;
00675     polygon[12].Vertex[0].u = 0.0;
00676     polygon[12].Vertex[0].v = 0.0;
00677     polygon[12].Vertex[1].u = 1.0;
00678     polygon[12].Vertex[1].v = 1.0;
00679     polygon[12].Vertex[2].u = 0.0;
00680     polygon[12].Vertex[2].v = 1.0;
00681 
00682     polygon[13].Scale[0] = 2.0;
00683     polygon[13].Scale[1] = 1.0;
00684     polygon[13].Shift[0] = 0.0;
00685     polygon[13].Shift[1] = 0.0;
00686     polygon[13].Rotate = 0.0;
00687     polygon[13].Vertex[0] = vertex[6];
00688     polygon[13].Vertex[1] = vertex[7];
00689     polygon[13].Vertex[2] = vertex[23];
00690     polygon[13].Texture = texture[2].TexID;
00691     polygon[13].Vertex[0].u = 0.0;
00692     polygon[13].Vertex[0].v = 0.0;
00693     polygon[13].Vertex[1].u = 1.0;
00694     polygon[13].Vertex[1].v = 0.0;
00695     polygon[13].Vertex[2].u = 1.0;
00696     polygon[13].Vertex[2].v = 1.0;
00697 
00698     polygon[14].Scale[0] = 2.0;
00699     polygon[14].Scale[1] = 1.0;
00700     polygon[14].Shift[0] = 0.0;
00701     polygon[14].Shift[1] = 0.0;
00702     polygon[14].Rotate = 0.0;
00703     polygon[14].Vertex[0] = vertex[7];
00704     polygon[14].Vertex[1] = vertex[24];
00705     polygon[14].Vertex[2] = vertex[23];
00706     polygon[14].Texture = texture[2].TexID;
00707     polygon[14].Vertex[0].u = 0.0;
00708     polygon[14].Vertex[0].v = 0.0;
00709     polygon[14].Vertex[1].u = 1.0;
00710     polygon[14].Vertex[1].v = 1.0;
00711     polygon[14].Vertex[2].u = 0.0;
00712     polygon[14].Vertex[2].v = 1.0;
00713 
00714     polygon[15].Scale[0] = 2.0;
00715     polygon[15].Scale[1] = 1.0;
00716     polygon[15].Shift[0] = 0.0;
00717     polygon[15].Shift[1] = 0.0;
00718     polygon[15].Rotate = 0.0;
00719     polygon[15].Vertex[0] = vertex[7];
00720     polygon[15].Vertex[1] = vertex[8];
00721     polygon[15].Vertex[2] = vertex[24];
00722     polygon[15].Texture = texture[2].TexID;
00723     polygon[15].Vertex[0].u = 0.0;
00724     polygon[15].Vertex[0].v = 0.0;
00725     polygon[15].Vertex[1].u = 1.0;
00726     polygon[15].Vertex[1].v = 0.0;
00727     polygon[15].Vertex[2].u = 1.0;
00728     polygon[15].Vertex[2].v = 1.0;
00729 
00730     polygon[16].Scale[0] = 2.0;
00731     polygon[16].Scale[1] = 1.0;
00732     polygon[16].Shift[0] = 0.0;
00733     polygon[16].Shift[1] = 0.0;
00734     polygon[16].Rotate = 0.0;
00735     polygon[16].Vertex[0] = vertex[8];
00736     polygon[16].Vertex[1] = vertex[25];
00737     polygon[16].Vertex[2] = vertex[24];
00738     polygon[16].Texture = texture[2].TexID;
00739     polygon[16].Vertex[0].u = 0.0;
00740     polygon[16].Vertex[0].v = 0.0;
00741     polygon[16].Vertex[1].u = 1.0;
00742     polygon[16].Vertex[1].v = 1.0;
00743     polygon[16].Vertex[2].u = 0.0;
00744     polygon[16].Vertex[2].v = 1.0;
00745 
00746     polygon[17].Scale[0] = 2.0;
00747     polygon[17].Scale[1] = 1.0;
00748     polygon[17].Shift[0] = 0.0;
00749     polygon[17].Shift[1] = 0.0;
00750     polygon[17].Rotate = 0.0;
00751     polygon[17].Vertex[0] = vertex[8];
00752     polygon[17].Vertex[1] = vertex[9];
00753     polygon[17].Vertex[2] = vertex[25];
00754     polygon[17].Texture = texture[2].TexID;
00755     polygon[17].Vertex[0].u = 0.0;
00756     polygon[17].Vertex[0].v = 0.0;
00757     polygon[17].Vertex[1].u = 1.0;
00758     polygon[17].Vertex[1].v = 0.0;
00759     polygon[17].Vertex[2].u = 1.0;
00760     polygon[17].Vertex[2].v = 1.0;
00761 
00762     polygon[18].Scale[0] = 2.0;
00763     polygon[18].Scale[1] = 1.0;
00764     polygon[18].Shift[0] = 0.0;
00765     polygon[18].Shift[1] = 20.0;
00766     polygon[18].Rotate = 0.0;
00767     polygon[18].Vertex[0] = vertex[9];
00768     polygon[18].Vertex[1] = vertex[26];
00769     polygon[18].Vertex[2] = vertex[25];
00770     polygon[18].Texture = texture[2].TexID;
00771     polygon[18].Vertex[0].u = 0.0;
00772     polygon[18].Vertex[0].v = 0.0;
00773     polygon[18].Vertex[1].u = 1.0;
00774     polygon[18].Vertex[1].v = 1.0;
00775     polygon[18].Vertex[2].u = 0.0;
00776     polygon[18].Vertex[2].v = 1.0;
00777 
00778     polygon[19].Scale[0] = 2.0;
00779     polygon[19].Scale[1] = 1.0;
00780     polygon[19].Shift[0] = 0.0;
00781     polygon[19].Shift[1] = 20.0;
00782     polygon[19].Rotate = 0.0;
00783     polygon[19].Vertex[0] = vertex[9];
00784     polygon[19].Vertex[1] = vertex[10];
00785     polygon[19].Vertex[2] = vertex[26];
00786     polygon[19].Texture = texture[2].TexID;
00787     polygon[19].Vertex[0].u = 0.0;
00788     polygon[19].Vertex[0].v = 0.0;
00789     polygon[19].Vertex[1].u = 1.0;
00790     polygon[19].Vertex[1].v = 0.0;
00791     polygon[19].Vertex[2].u = 1.0;
00792     polygon[19].Vertex[2].v = 1.0;
00793 
00794     polygon[20].Scale[0] = 2.0;
00795     polygon[20].Scale[1] = 1.0;
00796     polygon[20].Shift[0] = 0.0;
00797     polygon[20].Shift[1] = 0.0;
00798     polygon[20].Rotate = 0.0;
00799     polygon[20].Vertex[0] = vertex[10];
00800     polygon[20].Vertex[1] = vertex[27];
00801     polygon[20].Vertex[2] = vertex[26];
00802     polygon[20].Texture = texture[2].TexID;
00803     polygon[20].Vertex[0].u = 0.0;
00804     polygon[20].Vertex[0].v = 0.0;
00805     polygon[20].Vertex[1].u = 1.0;
00806     polygon[20].Vertex[1].v = 1.0;
00807     polygon[20].Vertex[2].u = 0.0;
00808     polygon[20].Vertex[2].v = 1.0;
00809 
00810     polygon[21].Scale[0] = 2.0;
00811     polygon[21].Scale[1] = 1.0;
00812     polygon[21].Shift[0] = 0.0;
00813     polygon[21].Shift[1] = 0.0;
00814     polygon[21].Rotate = 0.0;
00815     polygon[21].Vertex[0] = vertex[10];
00816     polygon[21].Vertex[1] = vertex[11];
00817     polygon[21].Vertex[2] = vertex[27];
00818     polygon[21].Texture = texture[2].TexID;
00819     polygon[21].Vertex[0].u = 0.0;
00820     polygon[21].Vertex[0].v = 0.0;
00821     polygon[21].Vertex[1].u = 1.0;
00822     polygon[21].Vertex[1].v = 0.0;
00823     polygon[21].Vertex[2].u = 1.0;
00824     polygon[21].Vertex[2].v = 1.0;
00825 
00826     polygon[22].Scale[0] = 2.0;
00827     polygon[22].Scale[1] = 1.0;
00828     polygon[22].Shift[0] = 0.0;
00829     polygon[22].Shift[1] = 0.0;
00830     polygon[22].Rotate = 0.0;
00831     polygon[22].Vertex[0] = vertex[11];
00832     polygon[22].Vertex[1] = vertex[28];
00833     polygon[22].Vertex[2] = vertex[27];
00834     polygon[22].Texture = texture[2].TexID;
00835     polygon[22].Vertex[0].u = 0.0;
00836     polygon[22].Vertex[0].v = 0.0;
00837     polygon[22].Vertex[1].u = 1.0;
00838     polygon[22].Vertex[1].v = 1.0;
00839     polygon[22].Vertex[2].u = 0.0;
00840     polygon[22].Vertex[2].v = 1.0;
00841 
00842     polygon[23].Scale[0] = 2.0;
00843     polygon[23].Scale[1] = 1.0;
00844     polygon[23].Shift[0] = 0.0;
00845     polygon[23].Shift[1] = 0.0;
00846     polygon[23].Rotate = 0.0;
00847     polygon[23].Vertex[0] = vertex[11];
00848     polygon[23].Vertex[1] = vertex[12];
00849     polygon[23].Vertex[2] = vertex[28];
00850     polygon[23].Texture = texture[2].TexID;
00851     polygon[23].Vertex[0].u = 0.0;
00852     polygon[23].Vertex[0].v = 0.0;
00853     polygon[23].Vertex[1].u = 1.0;
00854     polygon[23].Vertex[1].v = 0.0;
00855     polygon[23].Vertex[2].u = 1.0;
00856     polygon[23].Vertex[2].v = 1.0;
00857 
00858 
00859     polygon[24].Scale[0] = 2.0;
00860     polygon[24].Scale[1] = 1.0;
00861     polygon[24].Shift[0] = 0.0;
00862     polygon[24].Shift[1] = 0.0;
00863     polygon[24].Rotate = 0.0;
00864     polygon[24].Vertex[0] = vertex[12];
00865     polygon[24].Vertex[1] = vertex[29];
00866     polygon[24].Vertex[2] = vertex[28];
00867     polygon[24].Texture = texture[2].TexID;
00868     polygon[24].Vertex[0].u = 0.0;
00869     polygon[24].Vertex[0].v = 0.0;
00870     polygon[24].Vertex[1].u = 1.0;
00871     polygon[24].Vertex[1].v = 1.0;
00872     polygon[24].Vertex[2].u = 0.0;
00873     polygon[24].Vertex[2].v = 1.0;
00874 
00875     polygon[25].Scale[0] = 2.0;
00876     polygon[25].Scale[1] = 1.0;
00877     polygon[25].Shift[0] = 0.0;
00878     polygon[25].Shift[1] = 0.0;
00879     polygon[25].Rotate = 0.0;
00880     polygon[25].Vertex[0] = vertex[12];
00881     polygon[25].Vertex[1] = vertex[13];
00882     polygon[25].Vertex[2] = vertex[29];
00883     polygon[25].Texture = texture[2].TexID;
00884     polygon[25].Vertex[0].u = 0.0;
00885     polygon[25].Vertex[0].v = 0.0;
00886     polygon[25].Vertex[1].u = 1.0;
00887     polygon[25].Vertex[1].v = 0.0;
00888     polygon[25].Vertex[2].u = 1.0;
00889     polygon[25].Vertex[2].v = 1.0;
00890 
00891     polygon[26].Scale[0] = 1.0;
00892     polygon[26].Scale[1] = 1.0;
00893     polygon[26].Shift[0] = 0.0;
00894     polygon[26].Shift[1] = 0.0;
00895     polygon[26].Rotate = 0.0;
00896     polygon[26].Vertex[0] = vertex[13];
00897     polygon[26].Vertex[1] = vertex[30];
00898     polygon[26].Vertex[2] = vertex[29];
00899     polygon[26].Texture = texture[2].TexID;
00900     polygon[26].Vertex[0].u = 0.0;
00901     polygon[26].Vertex[0].v = 0.0;
00902     polygon[26].Vertex[1].u = 1.0;
00903     polygon[26].Vertex[1].v = 1.0;
00904     polygon[26].Vertex[2].u = 0.0;
00905     polygon[26].Vertex[2].v = 1.0;
00906 
00907     polygon[27].Scale[0] = 1.0;
00908     polygon[27].Scale[1] = 1.0;
00909     polygon[27].Shift[0] = 0.0;
00910     polygon[27].Shift[1] = 0.0;
00911     polygon[27].Rotate = 0.0;
00912     polygon[27].Vertex[0] = vertex[13];
00913     polygon[27].Vertex[1] = vertex[14];
00914     polygon[27].Vertex[2] = vertex[30];
00915     polygon[27].Texture = texture[2].TexID;
00916     polygon[27].Vertex[0].u = 0.0;
00917     polygon[27].Vertex[0].v = 0.0;
00918     polygon[27].Vertex[1].u = 1.0;
00919     polygon[27].Vertex[1].v = 0.0;
00920     polygon[27].Vertex[2].u = 1.0;
00921     polygon[27].Vertex[2].v = 1.0;
00922 
00923     polygon[28].Scale[0] = 6.0;
00924     polygon[28].Scale[1] = 1.0;
00925     polygon[28].Shift[0] = 0.0;
00926     polygon[28].Shift[1] = 0.0;
00927     polygon[28].Rotate = 0.0;
00928     polygon[28].Vertex[0] = vertex[14];
00929     polygon[28].Vertex[1] = vertex[31];
00930     polygon[28].Vertex[2] = vertex[30];
00931     polygon[28].Texture = texture[2].TexID;
00932     polygon[28].Vertex[0].u = 0.0;
00933     polygon[28].Vertex[0].v = 0.0;
00934     polygon[28].Vertex[1].u = 1.0;
00935     polygon[28].Vertex[1].v = 1.0;
00936     polygon[28].Vertex[2].u = 0.0;
00937     polygon[28].Vertex[2].v = 1.0;
00938 
00939     polygon[29].Scale[0] = 6.0;
00940     polygon[29].Scale[1] = 1.0;
00941     polygon[29].Shift[0] = 0.0;
00942     polygon[29].Shift[1] = 0.0;
00943     polygon[29].Rotate = 0.0;
00944     polygon[29].Vertex[0] = vertex[14];
00945     polygon[29].Vertex[1] = vertex[15];
00946     polygon[29].Vertex[2] = vertex[31];
00947     polygon[29].Texture = texture[2].TexID;
00948     polygon[29].Vertex[0].u = 0.0;
00949     polygon[29].Vertex[0].v = 0.0;
00950     polygon[29].Vertex[1].u = 1.0;
00951     polygon[29].Vertex[1].v = 0.0;
00952     polygon[29].Vertex[2].u = 1.0;
00953     polygon[29].Vertex[2].v = 1.0;
00954 
00955     polygon[30].Scale[0] = 5.0;
00956     polygon[30].Scale[1] = 1.0;
00957     polygon[30].Shift[0] = 0.0;
00958     polygon[30].Shift[1] = 0.0;
00959     polygon[30].Rotate = 0.0;
00960     polygon[30].Vertex[0] = vertex[15];
00961     polygon[30].Vertex[1] = vertex[16];
00962     polygon[30].Vertex[2] = vertex[31];
00963     polygon[30].Texture = texture[2].TexID;
00964     polygon[30].Vertex[0].u = 0.0;
00965     polygon[30].Vertex[0].v = 0.0;
00966     polygon[30].Vertex[1].u = 1.0;
00967     polygon[30].Vertex[1].v = 1.0;
00968     polygon[30].Vertex[2].u = 0.0;
00969     polygon[30].Vertex[2].v = 1.0;
00970 
00971     polygon[31].Scale[0] = 5.0;
00972     polygon[31].Scale[1] = 1.0;
00973     polygon[31].Shift[0] = 0.0;
00974     polygon[31].Shift[1] = 0.0;
00975     polygon[31].Rotate = 0.0;
00976     polygon[31].Vertex[0] = vertex[15];
00977     polygon[31].Vertex[1] = vertex[0];
00978     polygon[31].Vertex[2] = vertex[16];
00979     polygon[31].Texture = texture[2].TexID;
00980     polygon[31].Vertex[0].u = 0.0;
00981     polygon[31].Vertex[0].v = 0.0;
00982     polygon[31].Vertex[1].u = 1.0;
00983     polygon[31].Vertex[1].v = 0.0;
00984     polygon[31].Vertex[2].u = 1.0;
00985     polygon[31].Vertex[2].v = 1.0;
00986 
00987     polygon[32].Scale[0] = 5.0;
00988     polygon[32].Scale[1] = 5.0;
00989     polygon[32].Shift[0] = 0.0;
00990     polygon[32].Shift[1] = 0.0;
00991     polygon[32].Rotate = 0.0;
00992     polygon[32].Vertex[0] = vertex[15];
00993     polygon[32].Vertex[1] = vertex[1];
00994     polygon[32].Vertex[2] = vertex[0];
00995     polygon[32].Texture = texture[0].TexID;
00996     polygon[32].Vertex[0].u = 0.0;
00997     polygon[32].Vertex[0].v = 0.0;
00998     polygon[32].Vertex[1].u = 1.0;
00999     polygon[32].Vertex[1].v = 1.0;
01000     polygon[32].Vertex[2].u = 0.0;
01001     polygon[32].Vertex[2].v = 1.0;
01002 
01003     polygon[33].Scale[0] = 5.0;
01004     polygon[33].Scale[1] = 5.0;
01005     polygon[33].Shift[0] = 0.0;
01006     polygon[33].Shift[1] = 0.0;
01007     polygon[33].Rotate = 0.0;
01008     polygon[33].Vertex[0] = vertex[15];
01009     polygon[33].Vertex[1] = vertex[14];
01010     polygon[33].Vertex[2] = vertex[1];
01011     polygon[33].Texture = texture[0].TexID;
01012     polygon[33].Vertex[0].u = 0.0;
01013     polygon[33].Vertex[0].v = 0.0;
01014     polygon[33].Vertex[1].u = 1.0;
01015     polygon[33].Vertex[1].v = 0.0;
01016     polygon[33].Vertex[2].u = 1.0;
01017     polygon[33].Vertex[2].v = 1.0;
01018 
01019     polygon[34].Scale[0] = 5.0;
01020     polygon[34].Scale[1] = 5.0;
01021     polygon[34].Shift[0] = 0.0;
01022     polygon[34].Shift[1] = 0.0;
01023     polygon[34].Rotate = 0.0;
01024     polygon[34].Vertex[0] = vertex[13];
01025     polygon[34].Vertex[1] = vertex[3];
01026     polygon[34].Vertex[2] = vertex[2];
01027     polygon[34].Texture = texture[0].TexID;
01028     polygon[34].Vertex[0].u = 0.0;
01029     polygon[34].Vertex[0].v = 0.0;
01030     polygon[34].Vertex[1].u = 1.0;
01031     polygon[34].Vertex[1].v = 1.0;
01032     polygon[34].Vertex[2].u = 0.0;
01033     polygon[34].Vertex[2].v = 1.0;
01034 
01035     polygon[35].Scale[0] = 5.0;
01036     polygon[35].Scale[1] = 5.0;
01037     polygon[35].Shift[0] = 0.0;
01038     polygon[35].Shift[1] = 0.0;
01039     polygon[35].Rotate = 0.0;
01040     polygon[35].Vertex[0] = vertex[13];
01041     polygon[35].Vertex[1] = vertex[4];
01042     polygon[35].Vertex[2] = vertex[3];
01043     polygon[35].Texture = texture[0].TexID;
01044     polygon[35].Vertex[0].u = 0.0;
01045     polygon[35].Vertex[0].v = 0.0;
01046     polygon[35].Vertex[1].u = 1.0;
01047     polygon[35].Vertex[1].v = 0.0;
01048     polygon[35].Vertex[2].u = 1.0;
01049     polygon[35].Vertex[2].v = 1.0;
01050 
01051     polygon[36].Scale[0] = 1.0;
01052     polygon[36].Scale[1] = 2.0;
01053     polygon[36].Shift[0] = 0.0;
01054     polygon[36].Shift[1] = 0.0;
01055     polygon[36].Rotate = 0.0;
01056     polygon[36].Vertex[0] = vertex[11];
01057     polygon[36].Vertex[1] = vertex[5];
01058     polygon[36].Vertex[2] = vertex[12];
01059     polygon[36].Texture = texture[0].TexID;
01060     polygon[36].Vertex[0].u = 0.0;
01061     polygon[36].Vertex[0].v = 0.0;
01062     polygon[36].Vertex[1].u = 1.0;
01063     polygon[36].Vertex[1].v = 1.0;
01064     polygon[36].Vertex[2].u = 0.0;
01065     polygon[36].Vertex[2].v = 1.0;
01066 
01067     polygon[37].Scale[0] = 1.0;
01068     polygon[37].Scale[1] = 2.0;
01069     polygon[37].Shift[0] = 0.0;
01070     polygon[37].Shift[1] = 0.0;
01071     polygon[37].Rotate = 0.0;
01072     polygon[37].Vertex[0] = vertex[11];
01073     polygon[37].Vertex[1] = vertex[6];
01074     polygon[37].Vertex[2] = vertex[5];
01075     polygon[37].Texture = texture[0].TexID;
01076     polygon[37].Vertex[0].u = 0.0;
01077     polygon[37].Vertex[0].v = 0.0;
01078     polygon[37].Vertex[1].u = 1.0;
01079     polygon[37].Vertex[1].v = 0.0;
01080     polygon[37].Vertex[2].u = 1.0;
01081     polygon[37].Vertex[2].v = 1.0;
01082 
01083     polygon[38].Scale[0] = 5.0;
01084     polygon[38].Scale[1] = 5.0;
01085     polygon[38].Shift[0] = 0.0;
01086     polygon[38].Shift[1] = 0.0;
01087     polygon[38].Rotate = 0.0;
01088     polygon[38].Vertex[0] = vertex[9];
01089     polygon[38].Vertex[1] = vertex[7];
01090     polygon[38].Vertex[2] = vertex[10];
01091     polygon[38].Texture = texture[0].TexID;
01092     polygon[38].Vertex[0].u = 0.0;
01093     polygon[38].Vertex[0].v = 0.0;
01094     polygon[38].Vertex[1].u = 1.0;
01095     polygon[38].Vertex[1].v = 1.0;
01096     polygon[38].Vertex[2].u = 0.0;
01097     polygon[38].Vertex[2].v = 1.0;
01098 
01099     polygon[39].Scale[0] = 5.0;
01100     polygon[39].Scale[1] = 5.0;
01101     polygon[39].Shift[0] = 0.0;
01102     polygon[39].Shift[1] = 0.0;
01103     polygon[39].Rotate = 0.0;
01104     polygon[39].Vertex[0] = vertex[9];
01105     polygon[39].Vertex[1] = vertex[8];
01106     polygon[39].Vertex[2] = vertex[7];
01107     polygon[39].Texture = texture[0].TexID;
01108     polygon[39].Vertex[0].u = 0.0;
01109     polygon[39].Vertex[0].v = 0.0;
01110     polygon[39].Vertex[1].u = 1.0;
01111     polygon[39].Vertex[1].v = 0.0;
01112     polygon[39].Vertex[2].u = 1.0;
01113     polygon[39].Vertex[2].v = 1.0;
01114 
01115     polygon[40].Scale[0] = 5.0;
01116     polygon[40].Scale[1] = 1.0;
01117     polygon[40].Shift[0] = 0.0;
01118     polygon[40].Shift[1] = 0.0;
01119     polygon[40].Rotate = 0.0;
01120     polygon[40].Vertex[0] = vertex[18];
01121     polygon[40].Vertex[1] = vertex[16];
01122     polygon[40].Vertex[2] = vertex[17];
01123     polygon[40].Texture = texture[1].TexID;
01124     polygon[40].Vertex[0].u = 0.0;
01125     polygon[40].Vertex[0].v = 0.0;
01126     polygon[40].Vertex[1].u = 1.0;
01127     polygon[40].Vertex[1].v = 1.0;
01128     polygon[40].Vertex[2].u = 0.0;
01129     polygon[40].Vertex[2].v = 1.0;
01130 
01131     polygon[41].Scale[0] = 5.0;
01132     polygon[41].Scale[1] = 1.0;
01133     polygon[41].Shift[0] = 0.0;
01134     polygon[41].Shift[1] = 0.0;
01135     polygon[41].Rotate = 0.0;
01136     polygon[41].Vertex[0] = vertex[18];
01137     polygon[41].Vertex[1] = vertex[34];
01138     polygon[41].Vertex[2] = vertex[16];
01139     polygon[41].Texture = texture[1].TexID;
01140     polygon[41].Vertex[0].u = 0.0;
01141     polygon[41].Vertex[0].v = 0.0;
01142     polygon[41].Vertex[1].u = 1.0;
01143     polygon[41].Vertex[1].v = 0.0;
01144     polygon[41].Vertex[2].u = 1.0;
01145     polygon[41].Vertex[2].v = 1.0;
01146 
01147     polygon[42].Scale[0] = 3.0;
01148     polygon[42].Scale[1] = 2.0;
01149     polygon[42].Shift[0] = 0.0;
01150     polygon[42].Shift[1] = 0.0;
01151     polygon[42].Rotate = 0.0;
01152     polygon[42].Vertex[0] = vertex[36];
01153     polygon[42].Vertex[1] = vertex[18];
01154     polygon[42].Vertex[2] = vertex[19];
01155     polygon[42].Texture = texture[3].TexID;
01156     polygon[42].Vertex[0].u = 0.0;
01157     polygon[42].Vertex[0].v = 0.0;
01158     polygon[42].Vertex[1].u = 1.0;
01159     polygon[42].Vertex[1].v = 1.0;
01160     polygon[42].Vertex[2].u = 0.0;
01161     polygon[42].Vertex[2].v = 1.0;
01162 
01163     polygon[43].Scale[0] = 3.0;
01164     polygon[43].Scale[1] = 2.0;
01165     polygon[43].Shift[0] = 0.0;
01166     polygon[43].Shift[1] = 0.0;
01167     polygon[43].Rotate = 0.0;
01168     polygon[43].Vertex[0] = vertex[36];
01169     polygon[43].Vertex[1] = vertex[35];
01170     polygon[43].Vertex[2] = vertex[18];
01171     polygon[43].Texture = texture[3].TexID;
01172     polygon[43].Vertex[0].u = 0.0;
01173     polygon[43].Vertex[0].v = 0.0;
01174     polygon[43].Vertex[1].u = 1.0;
01175     polygon[43].Vertex[1].v = 0.0;
01176     polygon[43].Vertex[2].u = 1.0;
01177     polygon[43].Vertex[2].v = 1.0;
01178 
01179     polygon[44].Scale[0] = 1.0;
01180     polygon[44].Scale[1] = 2.0;
01181     polygon[44].Shift[0] = 0.0;
01182     polygon[44].Shift[1] = 0.0;
01183     polygon[44].Rotate = 0.0;
01184     polygon[44].Vertex[0] = vertex[22];
01185     polygon[44].Vertex[1] = vertex[28];
01186     polygon[44].Vertex[2] = vertex[21];
01187     polygon[44].Texture = texture[1].TexID;
01188     polygon[44].Vertex[0].u = 0.0;
01189     polygon[44].Vertex[0].v = 0.0;
01190     polygon[44].Vertex[1].u = 1.0;
01191     polygon[44].Vertex[1].v = 1.0;
01192     polygon[44].Vertex[2].u = 0.0;
01193     polygon[44].Vertex[2].v = 1.0;
01194 
01195     polygon[45].Scale[0] = 1.0;
01196     polygon[45].Scale[1] = 2.0;
01197     polygon[45].Shift[0] = 0.0;
01198     polygon[45].Shift[1] = 0.0;
01199     polygon[45].Rotate = 0.0;
01200     polygon[45].Vertex[0] = vertex[22];
01201     polygon[45].Vertex[1] = vertex[27];
01202     polygon[45].Vertex[2] = vertex[28];
01203     polygon[45].Texture = texture[1].TexID;
01204     polygon[45].Vertex[0].u = 0.0;
01205     polygon[45].Vertex[0].v = 0.0;
01206     polygon[45].Vertex[1].u = 1.0;
01207     polygon[45].Vertex[1].v = 0.0;
01208     polygon[45].Vertex[2].u = 1.0;
01209     polygon[45].Vertex[2].v = 1.0;
01210 
01211     polygon[46].Scale[0] = 5.0;
01212     polygon[46].Scale[1] = 5.0;
01213     polygon[46].Shift[0] = 0.0;
01214     polygon[46].Shift[1] = 0.0;
01215     polygon[46].Rotate = 0.0;
01216     polygon[46].Vertex[0] = vertex[24];
01217     polygon[46].Vertex[1] = vertex[26];
01218     polygon[46].Vertex[2] = vertex[23];
01219     polygon[46].Texture = texture[1].TexID;
01220     polygon[46].Vertex[0].u = 0.0;
01221     polygon[46].Vertex[0].v = 0.0;
01222     polygon[46].Vertex[1].u = 1.0;
01223     polygon[46].Vertex[1].v = 1.0;
01224     polygon[46].Vertex[2].u = 0.0;
01225     polygon[46].Vertex[2].v = 1.0;
01226 
01227     polygon[47].Scale[0] = 5.0;
01228     polygon[47].Scale[1] = 5.0;
01229     polygon[47].Shift[0] = 0.0;
01230     polygon[47].Shift[1] = 0.0;
01231     polygon[47].Rotate = 0.0;
01232     polygon[47].Vertex[0] = vertex[24];
01233     polygon[47].Vertex[1] = vertex[25];
01234     polygon[47].Vertex[2] = vertex[26];
01235     polygon[47].Texture = texture[1].TexID;
01236     polygon[47].Vertex[0].u = 0.0;
01237     polygon[47].Vertex[0].v = 0.0;
01238     polygon[47].Vertex[1].u = 1.0;
01239     polygon[47].Vertex[1].v = 0.0;
01240     polygon[47].Vertex[2].u = 1.0;
01241     polygon[47].Vertex[2].v = 1.0;
01242 
01243     polygon[48].Scale[0] = 3.0;
01244     polygon[48].Scale[1] = 2.0;
01245     polygon[48].Shift[0] = 0.0;
01246     polygon[48].Shift[1] = 0.0;
01247     polygon[48].Rotate = 0.0;
01248     polygon[48].Vertex[0] = vertex[20];
01249     polygon[48].Vertex[1] = vertex[35];
01250     polygon[48].Vertex[2] = vertex[36];
01251     polygon[48].Texture = texture[3].TexID;
01252     polygon[48].Vertex[0].u = 0.0;
01253     polygon[48].Vertex[0].v = 0.0;
01254     polygon[48].Vertex[1].u = 1.0;
01255     polygon[48].Vertex[1].v = 1.0;
01256     polygon[48].Vertex[2].u = 0.0;
01257     polygon[48].Vertex[2].v = 1.0;
01258 
01259     polygon[49].Scale[0] = 3.0;
01260     polygon[49].Scale[1] = 2.0;
01261     polygon[49].Shift[0] = 0.0;
01262     polygon[49].Shift[1] = 0.0;
01263     polygon[49].Rotate = 0.0;
01264     polygon[49].Vertex[0] = vertex[20];
01265     polygon[49].Vertex[1] = vertex[29];
01266     polygon[49].Vertex[2] = vertex[35];
01267     polygon[49].Texture = texture[3].TexID;
01268     polygon[49].Vertex[0].u = 0.0;
01269     polygon[49].Vertex[0].v = 0.0;
01270     polygon[49].Vertex[1].u = 1.0;
01271     polygon[49].Vertex[1].v = 0.0;
01272     polygon[49].Vertex[2].u = 1.0;
01273     polygon[49].Vertex[2].v = 1.0;
01274 
01275     polygon[50].Scale[0] = 5.0;
01276     polygon[50].Scale[1] = 5.0;
01277     polygon[50].Shift[0] = 0.0;
01278     polygon[50].Shift[1] = 0.0;
01279     polygon[50].Rotate = 0.0;
01280     polygon[50].Vertex[0] = vertex[30];
01281     polygon[50].Vertex[1] = vertex[32];
01282     polygon[50].Vertex[2] = vertex[29];
01283     polygon[50].Texture = texture[1].TexID;
01284     polygon[50].Vertex[0].u = 0.0;
01285     polygon[50].Vertex[0].v = 0.0;
01286     polygon[50].Vertex[1].u = 1.0;
01287     polygon[50].Vertex[1].v = 1.0;
01288     polygon[50].Vertex[2].u = 0.0;
01289     polygon[50].Vertex[2].v = 1.0;
01290 
01291     polygon[51].Scale[0] = 5.0;
01292     polygon[51].Scale[1] = 5.0;
01293     polygon[51].Shift[0] = 0.0;
01294     polygon[51].Shift[1] = 0.0;
01295     polygon[51].Rotate = 0.0;
01296     polygon[51].Vertex[0] = vertex[30];
01297     polygon[51].Vertex[1] = vertex[31];
01298     polygon[51].Vertex[2] = vertex[32];
01299     polygon[51].Texture = texture[1].TexID;
01300     polygon[51].Vertex[0].u = 0.0;
01301     polygon[51].Vertex[0].v = 0.0;
01302     polygon[51].Vertex[1].u = 1.0;
01303     polygon[51].Vertex[1].v = 0.0;
01304     polygon[51].Vertex[2].u = 1.0;
01305     polygon[51].Vertex[2].v = 1.0;
01306 
01307     polygon[52].Scale[0] = 3.0;
01308     polygon[52].Scale[1] = 2.0;
01309     polygon[52].Shift[0] = 0.0;
01310     polygon[52].Shift[1] = 0.0;
01311     polygon[52].Rotate = 0.0;
01312     polygon[52].Vertex[0] = vertex[29];
01313     polygon[52].Vertex[1] = vertex[33];
01314     polygon[52].Vertex[2] = vertex[35];
01315     polygon[52].Texture = texture[3].TexID;
01316     polygon[52].Vertex[0].u = 0.0;
01317     polygon[52].Vertex[0].v = 0.0;
01318     polygon[52].Vertex[1].u = 1.0;
01319     polygon[52].Vertex[1].v = 1.0;
01320     polygon[52].Vertex[2].u = 0.0;
01321     polygon[52].Vertex[2].v = 1.0;
01322 
01323     polygon[53].Scale[0] = 3.0;
01324     polygon[53].Scale[1] = 2.0;
01325     polygon[53].Shift[0] = 0.0;
01326     polygon[53].Shift[1] = 0.0;
01327     polygon[53].Rotate = 0.0;
01328     polygon[53].Vertex[0] = vertex[29];
01329     polygon[53].Vertex[1] = vertex[32];
01330     polygon[53].Vertex[2] = vertex[33];
01331     polygon[53].Texture = texture[3].TexID;
01332     polygon[53].Vertex[0].u = 0.0;
01333     polygon[53].Vertex[0].v = 0.0;
01334     polygon[53].Vertex[1].u = 1.0;
01335     polygon[53].Vertex[1].v = 0.0;
01336     polygon[53].Vertex[2].u = 1.0;
01337     polygon[53].Vertex[2].v = 1.0;
01338 
01339     polygon[54].Scale[0] = 3.0;
01340     polygon[54].Scale[1] = 2.0;
01341     polygon[54].Shift[0] = 0.0;
01342     polygon[54].Shift[1] = 0.0;
01343     polygon[54].Rotate = 0.0;
01344     polygon[54].Vertex[0] = vertex[35];
01345     polygon[54].Vertex[1] = vertex[34];
01346     polygon[54].Vertex[2] = vertex[18];
01347     polygon[54].Texture = texture[3].TexID;
01348     polygon[54].Vertex[0].u = 0.0;
01349     polygon[54].Vertex[0].v = 0.0;
01350     polygon[54].Vertex[1].u = 1.0;
01351     polygon[54].Vertex[1].v = 1.0;
01352     polygon[54].Vertex[2].u = 0.0;
01353     polygon[54].Vertex[2].v = 1.0;
01354 
01355     polygon[55].Scale[0] = 3.0;
01356     polygon[55].Scale[1] = 2.0;
01357     polygon[55].Shift[0] = 0.0;
01358     polygon[55].Shift[1] = 0.0;
01359     polygon[55].Rotate = 0.0;
01360     polygon[55].Vertex[0] = vertex[35];
01361     polygon[55].Vertex[1] = vertex[33];
01362     polygon[55].Vertex[2] = vertex[34];
01363     polygon[55].Texture = texture[3].TexID;
01364     polygon[55].Vertex[0].u = 0.0;
01365     polygon[55].Vertex[0].v = 0.0;
01366     polygon[55].Vertex[1].u = 1.0;
01367     polygon[55].Vertex[1].v = 0.0;
01368     polygon[55].Vertex[2].u = 1.0;
01369     polygon[55].Vertex[2].v = 1.0;
01370 
01371     polygon[56].Scale[0] = 4.0;
01372     polygon[56].Scale[1] = 3.0;
01373     polygon[56].Shift[0] = 0.0;
01374     polygon[56].Shift[1] = 0.0;
01375     polygon[56].Rotate = 0.0;
01376     polygon[56].Vertex[0] = vertex[32];
01377     polygon[56].Vertex[1] = vertex[34];
01378     polygon[56].Vertex[2] = vertex[33];
01379     polygon[56].Texture = texture[2].TexID;
01380     polygon[56].Vertex[0].u = 0.0;
01381     polygon[56].Vertex[0].v = 0.0;
01382     polygon[56].Vertex[1].u = 1.0;
01383     polygon[56].Vertex[1].v = 0.0;
01384     polygon[56].Vertex[2].u = 0.5;
01385     polygon[56].Vertex[2].v = 0.5;
01386 
01387     polygon[57].Scale[0] = 4.0;
01388     polygon[57].Scale[1] = 3.0;
01389     polygon[57].Shift[0] = 0.0;
01390     polygon[57].Shift[1] = 0.0;
01391     polygon[57].Rotate = 0;
01392     polygon[57].Vertex[0] = vertex[19];
01393     polygon[57].Vertex[1] = vertex[20];
01394     polygon[57].Vertex[2] = vertex[36];
01395     polygon[57].Texture = texture[2].TexID;
01396     polygon[57].Vertex[0].u = 0.0;
01397     polygon[57].Vertex[0].v = 0.0;
01398     polygon[57].Vertex[1].u = 1.0;
01399     polygon[57].Vertex[1].v = 0.0;
01400     polygon[57].Vertex[2].u = 0.5;
01401     polygon[57].Vertex[2].v = 0.5;
01402 
01403     for (int loop = 0; loop < numPolygons; loop++)
01404         polygon[loop].SetNormal();
01405 }

void SetSplines LinkedList< SPLINE > &   
 

Definition at line 288 of file general.cpp.

References AddSpline(), LoadSplines(), numSplines, SplineFileName, and SplineList.

Referenced by InitGL().

00289 {
00290     srand((unsigned)time(NULL));
00291     //Create a new spline
00292     for (int loop = 0; loop < numSplines; loop++)
00293     {
00294         AddSpline(loop, SplineList);
00295     }
00296     //Load splines from data file
00297     LoadSplines(SplineFileName, SplineList);
00298 }

int SphereInFrustum VECTOR    point,
float    radius
 

Definition at line 39 of file general.cpp.

References PLANE::Distance, PLANE::nx, PLANE::ny, PLANE::nz, VECTOR::x, VECTOR::y, and VECTOR::z.

00040 {
00041    int p;
00042    int c = 0;
00043    float d;
00044 
00045    for( p = 0; p < 6; p++ )
00046    {
00047       d = frustum[p].nx * point.x + frustum[p].ny * point.y + frustum[p].nz * point.z + frustum[p].Distance;
00048       if( d <= -radius )
00049          return 0;
00050       if( d > radius )
00051          c++;
00052    }
00053    return (c == 6) ? 2 : 1;
00054 }


Generated on Fri Dec 23 05:20:41 2005 for Potentially Visible Sets by doxygen1.2.15