#include <GL/glut.h>#include <math.h>#include <stdio.h>#include <tinyxml2.h>Go to the source code of this file.
Macros | |
| #define | _USE_MATH_DEFINES |
| #define | DEFAULT_GLOBAL_ANGLE_STEP 16 |
| #define | DEFAULT_GLOBAL_TRANSLATE_STEP 1 |
| #define | DEFAULT_GLOBAL_SCALE_STEP 1 |
| #define | DEFAULT_GLOBAL_EYE_STEP 1.0f |
| #define | DEFAULT_GLOBAL_EYE_X 5.0f |
| #define | DEFAULT_GLOBAL_EYE_Y (-2.0f) |
| #define | DEFAULT_GLOBAL_EYE_Z (3.0f) |
| #define | DEFAULT_GLOBAL_CENTER_STEP 1.0f |
| #define | DEFAULT_GLOBAL_CENTER_X 0.0f |
| #define | DEFAULT_GLOBAL_CENTER_Y 0.0f |
| #define | DEFAULT_GLOBAL_CENTER_Z 0.0f |
| #define | DEFAULT_GLOBAL_UP_STEP 1.0f |
| #define | DEFAULT_GLOBAL_UP_X 0.0f |
| #define | DEFAULT_GLOBAL_UP_Y 1.0f |
| #define | DEFAULT_GLOBAL_UP_Z 0.0f |
| #define | DEFAULT_GLOBAL_STACK 10 |
| #define | DEFAULT_GLOBAL_SLICE 10 |
Functions | |
| void | render3d (const char *path) |
| size_t | readModelToBuffer (const char *path, float *p, unsigned int n) |
| void | renderTriangleVertexSeq (float *p, int n) |
| void | changeSize (int w, int h) |
| void | cylinderVertex (float radius, float height, float theta) |
| void | drawCylinder (float r, float height, int slices) |
| void | coneVertex (float r, float height, float theta, float h) |
| void | drawCone (float r, float height, unsigned int slices, unsigned int stacks) |
| void | sphereVertex (float r, float theta, float phi) |
| void | drawSphere (float r, unsigned int slices, unsigned int stacks) |
| void | drawPlane (float length, unsigned int divisions) |
| void | drawAxes () |
| void | drawCube (float length, unsigned int divisions) |
| void | renderScene (void) |
| void | keyboardFunc (unsigned char key, int xmouse, int ymouse) |
| void | processSpecialKeys (int key, int xx, int yy) |
| int | main2 (int argc, char **argv) |
| int | main (int argc, char **argv) |
| #define _USE_MATH_DEFINES |
| #define DEFAULT_GLOBAL_ANGLE_STEP 16 |
| #define DEFAULT_GLOBAL_CENTER_STEP 1.0f |
| #define DEFAULT_GLOBAL_CENTER_X 0.0f |
| #define DEFAULT_GLOBAL_CENTER_Y 0.0f |
| #define DEFAULT_GLOBAL_CENTER_Z 0.0f |
| #define DEFAULT_GLOBAL_EYE_STEP 1.0f |
| #define DEFAULT_GLOBAL_EYE_X 5.0f |
| #define DEFAULT_GLOBAL_EYE_Y (-2.0f) |
| #define DEFAULT_GLOBAL_EYE_Z (3.0f) |
| #define DEFAULT_GLOBAL_SCALE_STEP 1 |
| #define DEFAULT_GLOBAL_SLICE 10 |
| #define DEFAULT_GLOBAL_STACK 10 |
| #define DEFAULT_GLOBAL_TRANSLATE_STEP 1 |
| #define DEFAULT_GLOBAL_UP_STEP 1.0f |
| #define DEFAULT_GLOBAL_UP_X 0.0f |
| #define DEFAULT_GLOBAL_UP_Y 1.0f |
| #define DEFAULT_GLOBAL_UP_Z 0.0f |
| void changeSize | ( | int | w, |
| int | h | ||
| ) |
References globalFar, globalFOV, and globalNear.
Referenced by main().
| void coneVertex | ( | float | r, |
| float | height, | ||
| float | theta, | ||
| float | h | ||
| ) |
Referenced by drawCone().
| void cylinderVertex | ( | float | radius, |
| float | height, | ||
| float | theta | ||
| ) |
Referenced by drawCylinder().
| void drawAxes | ( | ) |
| void drawCone | ( | float | r, |
| float | height, | ||
| unsigned int | slices, | ||
| unsigned int | stacks | ||
| ) |
References coneVertex().
Referenced by renderScene().
| void drawCube | ( | float | length, |
| unsigned int | divisions | ||
| ) |
| void drawCylinder | ( | float | r, |
| float | height, | ||
| int | slices | ||
| ) |
References cylinderVertex().
| void drawPlane | ( | float | length, |
| unsigned int | divisions | ||
| ) |
| void drawSphere | ( | float | r, |
| unsigned int | slices, | ||
| unsigned int | stacks | ||
| ) |
References sphereVertex().
| void keyboardFunc | ( | unsigned char | key, |
| int | xmouse, | ||
| int | ymouse | ||
| ) |
References DEFAULT_GLOBAL_ANGLE_STEP, DEFAULT_GLOBAL_CENTER_STEP, DEFAULT_GLOBAL_CENTER_X, DEFAULT_GLOBAL_CENTER_Y, DEFAULT_GLOBAL_CENTER_Z, DEFAULT_GLOBAL_EYE_STEP, DEFAULT_GLOBAL_EYE_X, DEFAULT_GLOBAL_EYE_Y, DEFAULT_GLOBAL_EYE_Z, DEFAULT_GLOBAL_SCALE_STEP, DEFAULT_GLOBAL_SLICE, DEFAULT_GLOBAL_STACK, DEFAULT_GLOBAL_TRANSLATE_STEP, DEFAULT_GLOBAL_UP_STEP, DEFAULT_GLOBAL_UP_X, DEFAULT_GLOBAL_UP_Y, DEFAULT_GLOBAL_UP_Z, globalAngle, globalAngleStep, globalBackgroundColorB, globalBackgroundColorG, globalBackgroundColorR, globalBackgroundColorStep, globalCenterStep, globalCenterX, globalCenterY, globalCenterZ, globalEyeStep, globalEyeX, globalEyeY, globalEyeZ, globalRotateX, globalRotateY, globalRotateZ, globalScaleStep, globalScaleX, globalScaleY, globalScaleZ, globalSlice, globalStack, globalStackSliceStep, globalTranslateStep, globalTranslateX, globalTranslateY, globalTranslateZ, globalUpStep, globalUpX, globalUpY, and globalUpZ.
Referenced by main().
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
References changeSize(), keyboardFunc(), processSpecialKeys(), and renderScene().
| int main2 | ( | int | argc, |
| char ** | argv | ||
| ) |
| void processSpecialKeys | ( | int | key, |
| int | xx, | ||
| int | yy | ||
| ) |
Referenced by main().
| size_t readModelToBuffer | ( | const char * | path, |
| float * | p, | ||
| unsigned int | n | ||
| ) |
| void render3d | ( | const char * | path | ) |
| void renderScene | ( | void | ) |
References drawCone(), globalAngle, globalCenterX, globalCenterY, globalCenterZ, globalEyeX, globalEyeY, globalEyeZ, globalRotateX, globalRotateY, globalRotateZ, globalScaleX, globalScaleY, globalScaleZ, globalTranslateX, globalTranslateY, globalTranslateZ, globalUpX, globalUpY, and globalUpZ.
Referenced by main().
| void renderTriangleVertexSeq | ( | float * | p, |
| int | n | ||
| ) |
| void sphereVertex | ( | float | r, |
| float | theta, | ||
| float | phi | ||
| ) |
Referenced by drawSphere().
| float globalAngle = 0 |
Referenced by keyboardFunc(), and renderScene().
| float globalAngleStep = DEFAULT_GLOBAL_ANGLE_STEP |
Referenced by keyboardFunc().
| float globalBackgroundColorB = 0 |
Referenced by keyboardFunc().
| float globalBackgroundColorG = 0 |
Referenced by keyboardFunc().
| float globalBackgroundColorR = 0 |
Referenced by keyboardFunc().
| float globalBackgroundColorStep = 1 |
Referenced by keyboardFunc().
| float globalCenterStep = DEFAULT_GLOBAL_CENTER_STEP |
Referenced by keyboardFunc().
| float globalCenterX = DEFAULT_GLOBAL_CENTER_X |
Referenced by keyboardFunc(), and renderScene().
| float globalCenterY = DEFAULT_GLOBAL_CENTER_Y |
Referenced by keyboardFunc(), and renderScene().
| float globalCenterZ = DEFAULT_GLOBAL_CENTER_Z |
Referenced by keyboardFunc(), and renderScene().
| float globalEyeStep = DEFAULT_GLOBAL_EYE_STEP |
Referenced by keyboardFunc().
| float globalEyeX = DEFAULT_GLOBAL_EYE_X |
Referenced by keyboardFunc(), and renderScene().
| float globalEyeY = DEFAULT_GLOBAL_EYE_Y |
Referenced by keyboardFunc(), and renderScene().
| float globalEyeZ = DEFAULT_GLOBAL_EYE_Z |
Referenced by keyboardFunc(), and renderScene().
|
static |
Referenced by changeSize().
|
static |
Referenced by changeSize().
|
static |
Referenced by changeSize().
| float globalRotateX = 0 |
Referenced by keyboardFunc(), and renderScene().
| float globalRotateY = 0 |
Referenced by keyboardFunc(), and renderScene().
| float globalRotateZ = 0 |
Referenced by keyboardFunc(), and renderScene().
| float globalScaleStep = DEFAULT_GLOBAL_SCALE_STEP |
Referenced by keyboardFunc().
| float globalScaleX = 1 |
Referenced by keyboardFunc(), and renderScene().
| float globalScaleY = 1 |
Referenced by keyboardFunc(), and renderScene().
| float globalScaleZ = 1 |
Referenced by keyboardFunc(), and renderScene().
| int globalSlice = DEFAULT_GLOBAL_SLICE |
Referenced by keyboardFunc().
| int globalStack = DEFAULT_GLOBAL_STACK |
Referenced by keyboardFunc().
| int globalStackSliceStep = 1 |
Referenced by keyboardFunc().
| float globalTranslateStep = DEFAULT_GLOBAL_TRANSLATE_STEP |
Referenced by keyboardFunc().
| float globalTranslateX = 0 |
Referenced by keyboardFunc(), and renderScene().
| float globalTranslateY = 0 |
Referenced by keyboardFunc(), and renderScene().
| float globalTranslateZ = 0 |
Referenced by keyboardFunc(), and renderScene().
| float globalUpStep = DEFAULT_GLOBAL_UP_STEP |
Referenced by keyboardFunc().
| float globalUpX = DEFAULT_GLOBAL_UP_X |
Referenced by keyboardFunc(), and renderScene().
| float globalUpY = DEFAULT_GLOBAL_UP_Y |
Referenced by keyboardFunc(), and renderScene().
| float globalUpZ = DEFAULT_GLOBAL_UP_Z |
Referenced by keyboardFunc(), and renderScene().