geometry.cpp File Reference

Implements the test model geometry. More...

#include "application.h"
#include "model.h"
#include "vertexstream.h"

Classes

class  CBaseModel
 Implementation of IModel. More...

Defines

#define DEFINE_VERTEX(ring, seg)
#define DEFINE_VERTEX(ring, seg)


Detailed Description

Implements the test model geometry.


Define Documentation

#define DEFINE_VERTEX ( ring,
seg   ) 

Value:

/* point on unit circle */ \
    p = vec3_t( cb ## seg, sb ## seg, 0.0f ); \
    /* point on circle rotated around Y axis*/ \
    *n = vec3_t( p.x * ca ## ring, p.y, p.x * sa ## ring ); \
    /* translate and scale */ \
    p2 = p * radius2; p2.x += radius1; \
    /* transformed and rotated around Y axis */ \
    *v = vec3_t( p2.x * ca ## ring, p2.y, p2.x * sa ## ring ); \
    /* tex coord */ \
    *t = vec2_t( U ## ring , V ## seg ); \
    /* interpolate color along X axis */ \
    *c = v->x < 0.0f ? \
        ( colorWest * (-(v->x)) + colorMid * ( 1 + (v->x)) ) : \
        ( colorEast *   (v->x)  + colorMid * ( 1 - (v->x)) ); \
    /* advance pointers */ \
    v++; n++; t++; c++;

#define DEFINE_VERTEX ( ring,
seg   ) 

Value:

/* setup normal / vertex position */ \
    *n = vec3_t( ca ## ring * cb ## seg, \
                 sa ## ring, \
                 ca ## ring * sb ## seg ); \
    /* setup vertex position */ \
    *v = (*n) * radius; \
    \
    /* setup color - interpolate along Y axis */ \
    *c = n->y < 0.0f ? \
        ( colorNorth * (-(n->y)) + colorEquator * ( 1 + (n->y)) ) : \
        ( colorSouth *   (n->y)  + colorEquator * ( 1 - (n->y)) ); \
    \
    /* setup texture coords */ \
    *t = vec2_t( U ## seg, V ## ring ); \
    \
    /* advance array pointers */ \
    v++; n++; t++; c++;


Generated on Sun Mar 2 17:12:31 2008 for Shader Maker by  doxygen 1.5.4