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

◆ M_PI

#define M_PI   3.14159265

Definition at line 46 of file dinoshade.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MISSING 
EXTENSION 
ONE_DOT_ONE 

Definition at line 68 of file dinoshade.c.

◆ anonymous enum

anonymous enum
Enumerator

Definition at line 155 of file dinoshade.c.

◆ anonymous enum

anonymous enum
Enumerator

Definition at line 158 of file dinoshade.c.

◆ anonymous enum

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.

◆ displayLists

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

◆ controlLights()

static void controlLights ( int  value)
static

Definition at line 681 of file dinoshade.c.

◆ drawDinosaur()

static void drawDinosaur ( void  )
static

Definition at line 303 of file dinoshade.c.

◆ drawFloor()

static void drawFloor ( void  )
static

Definition at line 334 of file dinoshade.c.

◆ extrudeSolidFromPolygon()

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

Definition at line 223 of file dinoshade.c.

◆ findPlane()

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

Definition at line 200 of file dinoshade.c.

◆ idle()

static void idle ( void  )
static

Definition at line 661 of file dinoshade.c.

◆ key()

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

Definition at line 753 of file dinoshade.c.

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 783 of file dinoshade.c.

◆ makeDinosaur()

static void makeDinosaur ( void  )
static

Definition at line 290 of file dinoshade.c.

◆ makeFloorTexture()

static void makeFloorTexture ( void  )
static

Definition at line 112 of file dinoshade.c.

◆ motion()

static void motion ( int  x,
int  y 
)
static

Definition at line 641 of file dinoshade.c.

◆ mouse()

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

Definition at line 615 of file dinoshade.c.

◆ redraw()

static void redraw ( void  )
static

Definition at line 364 of file dinoshade.c.

◆ shadowMatrix()

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

Definition at line 164 of file dinoshade.c.

◆ special()

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

Definition at line 765 of file dinoshade.c.

◆ supportsOneDotOne()

static int supportsOneDotOne ( void  )
static

Definition at line 771 of file dinoshade.c.

◆ visible()

static void visible ( int  vis)
static

Definition at line 738 of file dinoshade.c.

Variable Documentation

◆ angle

GLfloat angle = -150

Definition at line 62 of file dinoshade.c.

◆ angle2

GLfloat angle2 = 30

Definition at line 63 of file dinoshade.c.

◆ animation

int animation = 1
static

Definition at line 54 of file dinoshade.c.

◆ arm

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.

◆ body

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.

◆ bodyWidth

GLdouble bodyWidth = 3.0
static

Definition at line 73 of file dinoshade.c.

◆ circles

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.

◆ directionalLight

int directionalLight = 1
static

Definition at line 56 of file dinoshade.c.

◆ eye

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.

◆ eyeColor

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

Definition at line 88 of file dinoshade.c.

◆ floorPlane

GLfloat floorPlane[4]
static

Definition at line 360 of file dinoshade.c.

◆ floorShadow

GLfloat floorShadow[4][4]
static

Definition at line 361 of file dinoshade.c.

◆ floorVertices

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.

◆ forceExtension

int forceExtension = 0
static

Definition at line 57 of file dinoshade.c.

◆ jump

float jump = 0.0
static

Definition at line 60 of file dinoshade.c.

◆ leg

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.

◆ lightAngle

float lightAngle = 0.0
static

Definition at line 61 of file dinoshade.c.

◆ lightColor

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

Definition at line 87 of file dinoshade.c.

◆ lightHeight

float lightHeight = 20
static

Definition at line 61 of file dinoshade.c.

◆ lightMoving

int lightMoving = 0

Definition at line 66 of file dinoshade.c.

◆ lightPosition

GLfloat lightPosition[4]
static

Definition at line 86 of file dinoshade.c.

◆ lightStartX

int lightStartX

Definition at line 66 of file dinoshade.c.

◆ lightStartY

int lightStartY

Definition at line 66 of file dinoshade.c.

◆ lightSwitch

GLboolean lightSwitch = GL_TRUE
static

Definition at line 55 of file dinoshade.c.

◆ linearFiltering

int linearFiltering = 0
static

Definition at line 52 of file dinoshade.c.

◆ moving

int moving

Definition at line 65 of file dinoshade.c.

◆ offsetShadow

int offsetShadow = 1
static

Definition at line 50 of file dinoshade.c.

◆ polygonOffsetVersion

int polygonOffsetVersion

Definition at line 71 of file dinoshade.c.

◆ renderDinosaur

int renderDinosaur = 1
static

Definition at line 51 of file dinoshade.c.

◆ renderReflection

int renderReflection = 1
static

Definition at line 51 of file dinoshade.c.

◆ renderShadow

int renderShadow = 1
static

Definition at line 51 of file dinoshade.c.

◆ reportSpeed

int reportSpeed = 0
static

Definition at line 53 of file dinoshade.c.

◆ skinColor

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

Definition at line 88 of file dinoshade.c.

◆ startx

int startx

Definition at line 65 of file dinoshade.c.

◆ starty

int starty

Definition at line 65 of file dinoshade.c.

◆ stencilReflection

int stencilReflection = 1
static

Definition at line 50 of file dinoshade.c.

◆ stencilShadow

int stencilShadow = 1
static

Definition at line 50 of file dinoshade.c.

◆ useMipmaps

int useMipmaps = 0
static

Definition at line 52 of file dinoshade.c.

◆ useTexture

int useTexture = 1
static

Definition at line 52 of file dinoshade.c.



euslisp
Author(s): Toshihiro Matsui
autogenerated on Mon Feb 28 2022 22:18:28