绘制线框正交十二面体
[ 2007-01-17 12:39:30 | 作者: Admin ]
/*
*
*/
double rdod_r[14][3] = { { 0.0, 0.0, 1.0 },
{ 0.707106781187, 0.000000000000, 0.5 }, { 0.000000000000, 0.707106781187, 0.5 }, { -0.707106781187, 0.000000000000, 0.5 }, { 0.000000000000, -0.707106781187, 0.5 },
{ 0.707106781187, 0.707106781187, 0.0 }, { -0.707106781187, 0.707106781187, 0.0
...*
*/
double rdod_r[14][3] = { { 0.0, 0.0, 1.0 },
{ 0.707106781187, 0.000000000000, 0.5 }, { 0.000000000000, 0.707106781187, 0.5 }, { -0.707106781187, 0.000000000000, 0.5 }, { 0.000000000000, -0.707106781187, 0.5 },
{ 0.707106781187, 0.707106781187, 0.0 }, { -0.707106781187, 0.707106781187, 0.0
阅读全文...
/*
*
*/
double icos_r[12][3] = { { 1.0, 0.0, 0.0 },
{ 0.447213595500, 0.894427191000, 0.0 }, { 0.447213595500, 0.276393202252, 0.850650808354 }, { 0.447213595500, -0.723606797748, 0.525731112119 }, { 0.447213595500, -0.723606797748, -0.525731112119 }, { 0.447213595500, 0.276393202252, -0.850650808354 },
{ -0.447213595500,
...*
*/
double icos_r[12][3] = { { 1.0, 0.0, 0.0 },
{ 0.447213595500, 0.894427191000, 0.0 }, { 0.447213595500, 0.276393202252, 0.850650808354 }, { 0.447213595500, -0.723606797748, 0.525731112119 }, { 0.447213595500, -0.723606797748, -0.525731112119 }, { 0.447213595500, 0.276393202252, -0.850650808354 },
{ -0.447213595500,
阅读全文...
/*
*
*/
double icos_r[12][3] = { { 1.0, 0.0, 0.0 },
{ 0.447213595500, 0.894427191000, 0.0 }, { 0.447213595500, 0.276393202252, 0.850650808354 }, { 0.447213595500, -0.723606797748, 0.525731112119 }, { 0.447213595500, -0.723606797748, -0.525731112119 }, { 0.447213595500, 0.276393202252, -0.850650808354 },
{ -0.447213595500,
...*
*/
double icos_r[12][3] = { { 1.0, 0.0, 0.0 },
{ 0.447213595500, 0.894427191000, 0.0 }, { 0.447213595500, 0.276393202252, 0.850650808354 }, { 0.447213595500, -0.723606797748, 0.525731112119 }, { 0.447213595500, -0.723606797748, -0.525731112119 }, { 0.447213595500, 0.276393202252, -0.850650808354 },
{ -0.447213595500,
阅读全文...
/*
*
*/
void renderSolidTetrahedron( void )
{
/* Magic Numbers: r0 = ( 1, 0, 0 )
* r1 = ( -1/3, 2 sqrt(2) / 3, 0 )
* r2 = ( -1/3, -sqrt(2) / 3, sqrt(6) / 3 )
* r3 = ( -1/3, -sqrt(2) / 3, -sqrt(6) / 3 )
* |r0| = |r1| = |r2| = |r3| = 1
* Distance between any two points is 2 sqrt(6) / 3
...*
*/
void renderSolidTetrahedron( void )
{
/* Magic Numbers: r0 = ( 1, 0, 0 )
* r1 = ( -1/3, 2 sqrt(2) / 3, 0 )
* r2 = ( -1/3, -sqrt(2) / 3, sqrt(6) / 3 )
* r3 = ( -1/3, -sqrt(2) / 3, -sqrt(6) / 3 )
* |r0| = |r1| = |r2| = |r3| = 1
* Distance between any two points is 2 sqrt(6) / 3
阅读全文...
/*
*
*/
void renderWireTetrahedron( void )
{
/* Magic Numbers: r0 = ( 1, 0, 0 )
* r1 = ( -1/3, 2 sqrt(2) / 3, 0 )
* r2 = ( -1/3, -sqrt(2) / 3, sqrt(6) / 3 )
* r3 = ( -1/3, -sqrt(2) / 3, -sqrt(6) / 3 )
* |r0| = |r1| = |r2| = |r3| = 1
* Distance between any two points is 2 sqrt(6) / 3
...*
*/
void renderWireTetrahedron( void )
{
/* Magic Numbers: r0 = ( 1, 0, 0 )
* r1 = ( -1/3, 2 sqrt(2) / 3, 0 )
* r2 = ( -1/3, -sqrt(2) / 3, sqrt(6) / 3 )
* r3 = ( -1/3, -sqrt(2) / 3, -sqrt(6) / 3 )
* |r0| = |r1| = |r2| = |r3| = 1
* Distance between any two points is 2 sqrt(6) / 3
阅读全文...
/*
*
*/
void renderSolidOctahedron( void )
{
#define RADIUS 1.0f
glBegin( GL_TRIANGLES );
glNormal3d( 0.577350269189, 0.577350269189, 0.577350269189); glVertex3d( RADIUS, 0.0, 0.0 ); glVertex3d( 0.0, RADIUS, 0.0 ); glVertex3d( 0.0, 0.0, RADIUS );
glNormal3d( 0.577350269189, 0.577350269189,-0.577350269189); glVertex3d(
...*
*/
void renderSolidOctahedron( void )
{
#define RADIUS 1.0f
glBegin( GL_TRIANGLES );
glNormal3d( 0.577350269189, 0.577350269189, 0.577350269189); glVertex3d( RADIUS, 0.0, 0.0 ); glVertex3d( 0.0, RADIUS, 0.0 ); glVertex3d( 0.0, 0.0, RADIUS );
glNormal3d( 0.577350269189, 0.577350269189,-0.577350269189); glVertex3d(
阅读全文...
/*
*
*/
void renderWireOctahedron( void )
{
#define RADIUS 1.0f
glBegin( GL_LINE_LOOP );
glNormal3d( 0.577350269189, 0.577350269189, 0.577350269189); glVertex3d( RADIUS, 0.0, 0.0 ); glVertex3d( 0.0, RADIUS, 0.0 ); glVertex3d( 0.0, 0.0, RADIUS );
glNormal3d( 0.577350269189, 0.577350269189,-0.577350269189); glVertex3d(
...*
*/
void renderWireOctahedron( void )
{
#define RADIUS 1.0f
glBegin( GL_LINE_LOOP );
glNormal3d( 0.577350269189, 0.577350269189, 0.577350269189); glVertex3d( RADIUS, 0.0, 0.0 ); glVertex3d( 0.0, RADIUS, 0.0 ); glVertex3d( 0.0, 0.0, RADIUS );
glNormal3d( 0.577350269189, 0.577350269189,-0.577350269189); glVertex3d(
阅读全文...
/*
*
*/
void renderSolidDodecahedron( void )
{
/* Magic Numbers: It is possible to create a dodecahedron by attaching two pentagons to each face of
* of a cube. The coordinates of the points are:
* (+-x,0, z); (+-1, 1, 1); (0, z, x )
* where x = 0.61803398875 and z = 1.61803398875.
*/
glBegin ( GL_POLYGON ) ;
...*
*/
void renderSolidDodecahedron( void )
{
/* Magic Numbers: It is possible to create a dodecahedron by attaching two pentagons to each face of
* of a cube. The coordinates of the points are:
* (+-x,0, z); (+-1, 1, 1); (0, z, x )
* where x = 0.61803398875 and z = 1.61803398875.
*/
glBegin ( GL_POLYGON ) ;
阅读全文...
/*
*
*/
void renderWireDodecahedron( void )
{
/* Magic Numbers: It is possible to create a dodecahedron by attaching two pentagons to each face of
* of a cube. The coordinates of the points are:
* (+-x,0, z); (+-1, 1, 1); (0, z, x )
* where x = 0.61803398875 and z = 1.61803398875.
*/
glBegin ( GL_LINE_LOOP ) ;
...*
*/
void renderWireDodecahedron( void )
{
/* Magic Numbers: It is possible to create a dodecahedron by attaching two pentagons to each face of
* of a cube. The coordinates of the points are:
* (+-x,0, z); (+-1, 1, 1); (0, z, x )
* where x = 0.61803398875 and z = 1.61803398875.
*/
glBegin ( GL_LINE_LOOP ) ;
阅读全文...
/*
*
*/
void renderSolidTorus( GLdouble dInnerRadius, GLdouble dOuterRadius, GLint nSides, GLint nRings )
{
double iradius = dInnerRadius, oradius = dOuterRadius, phi, psi, dpsi, dphi;
double *vertex, *normal;
int i, j;
double spsi, cpsi, sphi, cphi ;
/*
* Increment the number of sides and rings to allow for one more point than surface
...*
*/
void renderSolidTorus( GLdouble dInnerRadius, GLdouble dOuterRadius, GLint nSides, GLint nRings )
{
double iradius = dInnerRadius, oradius = dOuterRadius, phi, psi, dpsi, dphi;
double *vertex, *normal;
int i, j;
double spsi, cpsi, sphi, cphi ;
/*
* Increment the number of sides and rings to allow for one more point than surface
阅读全文...




















