home dev games gallery work
Lewpen.com»Research & Development»3D Graphics»OpenGL»Reflective Sphere

Reflective Sphere

Analytical reflections in OpenGL

/ Source / common / 001 / cylinder.h

/*
  CYLINDER

    Generic cylinder which can be put along any path and given a height map


    If you want to use a radius function, set 
      
      drawCylinder_getPoint  = drawCylinder_getPoint_radiusMap
      drawCylinder_getRadius = your radius functions

*/




#ifndef __CYLINDER_H__
#define __CYLINDER_H__




//  this will be a pure scope function (no params, everything coming from environment.





extern double time;




//---- CYLINDER RADIUS MAP FUNCTIONS

typedef double (*DRAWCYLINDER_GETRADIUS)( double around, double along );

double drawCylinder_getRadius_standard( double around, double along );
double drawCylinder_getRadius_animation001( double around, double along );

extern DRAWCYLINDER_GETRADIUS drawCylinder_getRadius;





//---- CYLINDER POINT MAP FUNCTIONS

typedef void (*DRAWCYLINDER_GETPOINT)( double around, double along, double &x, double &y, double &z );

//- drawCylinder_getPoint_standard
void drawCylinder_getPoint_standard( double around, double along, double &x, double &y, double &z );

//- drawCylinder_getPoint_radiusMap

void drawCylinder_getPoint_radiusMap( double around, double along, double &x, double &y, double &z );

//- drawCylinder_getPoint_torus

extern double drawCylinder_getPoint_torus_majorRadius;
void drawCylinder_getPoint_torus( double around, double along, double &x, double &y, double &z );







extern int drawCylinder_segmentsLong;    //  How many segments long the cylinder is
extern int drawCylinder_segmentsAround;  //  How many segments around the circumference of the cylinder

extern double drawCylinder_radius;  //  Radius of the cylinder
extern double drawCylinder_length;  //  Length of the cylinder





extern DRAWCYLINDER_GETPOINT drawCylinder_getPoint;

void drawCylinder();





#endif
Related Articles

Procedural city block layout

Animated 4-dimensional objects mapped down to 3D

Simulating a cloth falling and slipping over objects

Windows C++ OpenGL example

Games

The Dodge Game
Flatspace

2-Player Games:

Quake 2D
Meteora

Puzzle Games:

Mini Tetris
Sudoku Solver

Development

3D Graphics:

3D Graphics Articles
WebGL Examples
OpenGL Examples
Flash 3D Engine
Java 3D Engine

Development:

Programming Articles
Game Development Examples

Work

Portfolio
Clients
Startups & Projects
Expertise

Links

CubeLogix Studios
PHP Charts & Graphs
Local Legends Football