Macros | Enumerations | Functions | Variables
dinoshade.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <GL/glut.h>
Include dependency graph for dinoshade.c:

Go to the source code of this file.

Macros

#define M_PI   3.14159265
 

Enumerations

enum  { MISSING, EXTENSION, ONE_DOT_ONE }
 
enum  { X, Y, Z, W }
 
enum  { A, B, C, D }
 
enum  {
  M_NONE, M_MOTION, M_LIGHT, M_TEXTURE,
  M_SHADOWS, M_REFLECTION, M_DINOSAUR, M_STENCIL_REFLECTION,
  M_STENCIL_SHADOW, M_OFFSET_SHADOW, M_POSITIONAL, M_DIRECTIONAL,
  M_PERFORMANCE
}
 
enum  displayLists {
  RESERVED, BODY_SIDE, BODY_EDGE, BODY_WHOLE,
  ARM_SIDE, ARM_EDGE, ARM_WHOLE, LEG_SIDE,
  LEG_EDGE, LEG_WHOLE, EYE_SIDE, EYE_EDGE,
  EYE_WHOLE
}
 

Functions

static void controlLights (int value)
 
static void drawDinosaur (void)
 
static void drawFloor (void)
 
void extrudeSolidFromPolygon (GLfloat data[][2], unsigned int dataSize, GLdouble thickness, GLuint side, GLuint edge, GLuint whole)
 
void findPlane (GLfloat plane[4], GLfloat v0[3], GLfloat v1[3], GLfloat v2[3])
 
static void idle (void)
 
static void key (unsigned char c, int x, int y)
 
int main (int argc, char **argv)
 
static void makeDinosaur (void)
 
static void makeFloorTexture (void)
 
static void motion (int x, int y)
 
static void mouse (int button, int state, int x, int y)
 
static void redraw (void)
 
void shadowMatrix (GLfloat shadowMat[4][4], GLfloat groundplane[4], GLfloat lightpos[4])
 
static void special (int k, int x, int y)
 
static int supportsOneDotOne (void)
 
static void visible (int vis)
 

Variables

GLfloat angle = -150
 
GLfloat angle2 = 30
 
static int animation = 1
 
static GLfloat arm [][2]
 
static GLfloat body [][2]
 
static GLdouble bodyWidth = 3.0
 
static char * circles []
 
static int directionalLight = 1
 
static GLfloat eye [][2]
 
static GLfloat eyeColor [] = {1.0, 0.2, 0.2, 1.0}
 
static GLfloat floorPlane [4]
 
static GLfloat floorShadow [4][4]
 
static GLfloat floorVertices [4][3]
 
static int forceExtension = 0
 
static float jump = 0.0
 
static GLfloat leg [][2]
 
static float lightAngle = 0.0
 
static GLfloat lightColor [] = {0.8, 1.0, 0.8, 1.0}
 
static float lightHeight = 20
 
int lightMoving = 0
 
static GLfloat lightPosition [4]
 
int lightStartX
 
int lightStartY
 
static GLboolean lightSwitch = GL_TRUE
 
static int linearFiltering = 0
 
int moving
 
static int offsetShadow = 1
 
int polygonOffsetVersion
 
static int renderDinosaur = 1
 
static int renderReflection = 1
 
static int renderShadow = 1
 
static int reportSpeed = 0
 
static GLfloat skinColor [] = {0.1, 1.0, 0.1, 1.0}
 
int startx
 
int starty
 
static int stencilReflection = 1
 
static int stencilShadow = 1
 
static int useMipmaps = 0
 
static int useTexture = 1
 

Macro Definition Documentation

#define M_PI   3.14159265

Definition at line 46 of file dinoshade.c.

Enumeration Type Documentation

anonymous enum
Enumerator
MISSING 
EXTENSION 
ONE_DOT_ONE 

Definition at line 68 of file dinoshade.c.

anonymous enum
Enumerator

Definition at line 155 of file dinoshade.c.

anonymous enum
Enumerator

Definition at line 158 of file dinoshade.c.

anonymous enum
Enumerator
M_NONE 
M_MOTION 
M_LIGHT 
M_TEXTURE 
M_SHADOWS 
M_REFLECTION 
M_DINOSAUR 
M_STENCIL_REFLECTION 
M_STENCIL_SHADOW 
M_OFFSET_SHADOW 
M_POSITIONAL 
M_DIRECTIONAL 
M_PERFORMANCE 

Definition at line 674 of file dinoshade.c.

Enumerator
RESERVED 
BODY_SIDE 
BODY_EDGE 
BODY_WHOLE 
ARM_SIDE 
ARM_EDGE 
ARM_WHOLE 
LEG_SIDE 
LEG_EDGE 
LEG_WHOLE 
EYE_SIDE 
EYE_EDGE 
EYE_WHOLE 

Definition at line 284 of file dinoshade.c.

Function Documentation

static void controlLights ( int  value)
static

Definition at line 681 of file dinoshade.c.

static void drawDinosaur ( void  )
static

Definition at line 303 of file dinoshade.c.

static void drawFloor ( void  )
static

Definition at line 334 of file dinoshade.c.

void extrudeSolidFromPolygon ( GLfloat  data[][2],
unsigned int  dataSize,
GLdouble  thickness,
GLuint  side,
GLuint  edge,
GLuint  whole 
)

Definition at line 223 of file dinoshade.c.

void findPlane ( GLfloat  plane[4],
GLfloat  v0[3],
GLfloat  v1[3],
GLfloat  v2[3] 
)

Definition at line 200 of file dinoshade.c.

static void idle ( void  )
static

Definition at line 661 of file dinoshade.c.

static void key ( unsigned char  c,
int  x,
int  y 
)
static

Definition at line 753 of file dinoshade.c.

int main ( int  argc,
char **  argv 
)

Definition at line 783 of file dinoshade.c.

static void makeDinosaur ( void  )
static

Definition at line 290 of file dinoshade.c.

static void makeFloorTexture ( void  )
static

Definition at line 112 of file dinoshade.c.

static void motion ( int  x,
int  y 
)
static

Definition at line 641 of file dinoshade.c.

static void mouse ( int  button,
int  state,
int  x,
int  y 
)
static

Definition at line 615 of file dinoshade.c.

static void redraw ( void  )
static

Definition at line 364 of file dinoshade.c.

void shadowMatrix ( GLfloat  shadowMat[4][4],
GLfloat  groundplane[4],
GLfloat  lightpos[4] 
)

Definition at line 164 of file dinoshade.c.

static void special ( int  k,
int  x,
int  y 
)
static

Definition at line 765 of file dinoshade.c.

static int supportsOneDotOne ( void  )
static

Definition at line 771 of file dinoshade.c.

static void visible ( int  vis)
static

Definition at line 738 of file dinoshade.c.

Variable Documentation

GLfloat angle = -150

Definition at line 62 of file dinoshade.c.

GLfloat angle2 = 30

Definition at line 63 of file dinoshade.c.

int animation = 1
static

Definition at line 54 of file dinoshade.c.

GLfloat arm[][2]
static
Initial value:
= { {8, 10}, {9, 9}, {10, 9}, {13, 8}, {14, 9}, {16, 9},
{15, 9.5}, {16, 10}, {15, 10}, {15.5, 11}, {14.5, 10}, {14, 11}, {14, 10},
{13, 9}, {11, 11}, {9, 11} }

Definition at line 79 of file dinoshade.c.

GLfloat body[][2]
static
Initial value:
= { {0, 3}, {1, 1}, {5, 1}, {8, 4}, {10, 4}, {11, 5},
{11, 11.5}, {13, 12}, {13, 13}, {10, 13.5}, {13, 14}, {13, 15}, {11, 16},
{8, 16}, {7, 15}, {7, 13}, {8, 12}, {7, 11}, {6, 6}, {4, 3}, {3, 2},
{1, 2} }

Definition at line 75 of file dinoshade.c.

GLdouble bodyWidth = 3.0
static

Definition at line 73 of file dinoshade.c.

char* circles[]
static
Initial value:
= {
"....xxxx........",
"..xxxxxxxx......",
".xxxxxxxxxx.....",
".xxx....xxx.....",
"xxx......xxx....",
"xxx......xxx....",
"xxx......xxx....",
"xxx......xxx....",
".xxx....xxx.....",
".xxxxxxxxxx.....",
"..xxxxxxxx......",
"....xxxx........",
"................",
"................",
"................",
"................",
}

Definition at line 92 of file dinoshade.c.

int directionalLight = 1
static

Definition at line 56 of file dinoshade.c.

GLfloat eye[][2]
static
Initial value:
= { {8.75, 15}, {9, 14.7}, {9.6, 14.7}, {10.1, 15},
{9.6, 15.25}, {9, 15.25} }

Definition at line 84 of file dinoshade.c.

GLfloat eyeColor[] = {1.0, 0.2, 0.2, 1.0}
static

Definition at line 88 of file dinoshade.c.

GLfloat floorPlane[4]
static

Definition at line 360 of file dinoshade.c.

GLfloat floorShadow[4][4]
static

Definition at line 361 of file dinoshade.c.

GLfloat floorVertices[4][3]
static
Initial value:
= {
{ -20.0, 0.0, 20.0 },
{ 20.0, 0.0, 20.0 },
{ 20.0, 0.0, -20.0 },
{ -20.0, 0.0, -20.0 },
}

Definition at line 325 of file dinoshade.c.

int forceExtension = 0
static

Definition at line 57 of file dinoshade.c.

float jump = 0.0
static

Definition at line 60 of file dinoshade.c.

GLfloat leg[][2]
static
Initial value:
= { {8, 6}, {8, 4}, {9, 3}, {9, 2}, {8, 1}, {8, 0.5}, {9, 0},
{12, 0}, {10, 1}, {10, 2}, {12, 4}, {11, 6}, {10, 7}, {9, 7} }

Definition at line 82 of file dinoshade.c.

float lightAngle = 0.0
static

Definition at line 61 of file dinoshade.c.

GLfloat lightColor[] = {0.8, 1.0, 0.8, 1.0}
static

Definition at line 87 of file dinoshade.c.

float lightHeight = 20
static

Definition at line 61 of file dinoshade.c.

int lightMoving = 0

Definition at line 66 of file dinoshade.c.

GLfloat lightPosition[4]
static

Definition at line 86 of file dinoshade.c.

int lightStartX

Definition at line 66 of file dinoshade.c.

int lightStartY

Definition at line 66 of file dinoshade.c.

GLboolean lightSwitch = GL_TRUE
static

Definition at line 55 of file dinoshade.c.

int linearFiltering = 0
static

Definition at line 52 of file dinoshade.c.

int moving

Definition at line 65 of file dinoshade.c.

int offsetShadow = 1
static

Definition at line 50 of file dinoshade.c.

int polygonOffsetVersion

Definition at line 71 of file dinoshade.c.

int renderDinosaur = 1
static

Definition at line 51 of file dinoshade.c.

int renderReflection = 1
static

Definition at line 51 of file dinoshade.c.

int renderShadow = 1
static

Definition at line 51 of file dinoshade.c.

int reportSpeed = 0
static

Definition at line 53 of file dinoshade.c.

GLfloat skinColor[] = {0.1, 1.0, 0.1, 1.0}
static

Definition at line 88 of file dinoshade.c.

int startx

Definition at line 65 of file dinoshade.c.

int starty

Definition at line 65 of file dinoshade.c.

int stencilReflection = 1
static

Definition at line 50 of file dinoshade.c.

int stencilShadow = 1
static

Definition at line 50 of file dinoshade.c.

int useMipmaps = 0
static

Definition at line 52 of file dinoshade.c.

int useTexture = 1
static

Definition at line 52 of file dinoshade.c.



euslisp
Author(s): Toshihiro Matsui
autogenerated on Thu Jun 6 2019 20:00:44