gCAD3D 2.40
tst_glDrawElements1.c File Reference
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/gl.h>

Data Structures

struct  Point
 3D-point, Typ_PT More...
 
struct  Vector
 3D-vector, Typ_VC More...
 
struct  Pnt3f
 
struct  Vec3f
 3D-vector, Typ_VC3F More...
 

Macros

#define GLU_CB   static void
 
#define COL_RED   0
 
#define COL_YELLOW   1
 
#define COL_SUR   2
 
#define Typ_VC   2
 D Vector. More...
 
#define Typ_VC3f   514
 vector 3D float More...
 
#define BCKPLN_XY   2
 Z-Vec BCKVEC_Z. More...
 
#define BCKPLN_XZ   1
 Y-Vec BCKVEC_Y. More...
 
#define BCKPLN_YZ   0
 X-Vec BCKVEC_X. More...
 
#define UT3F_len_vc(vc)   (sqrtf((vc)->dx*(vc)->dx + (vc)->dy*(vc)->dy + (vc)->dz*(vc)->dz))
 

Functions

int UT3F_bp_vcz (Vec3f *vcn)
 
int UT3F_vc_perp_3pt (Vec3f *vp, Point *ptc, Point *ptx, Point *pty)
 
float UT3D_len_vc (Vec3f *)
 UT3F_len_vc length of 3D-vector. More...
 
void UT3F_vc_setLength (Vec3f *vco, Vec3f *vci, float new_len)
 
int set_inormal (Vec3f *nvca, Vec3f *vc1)
 
int ck_orient (Vec3f *vcn, Point *p1, Point *p2, Point *p3)
 
int comp_inormals (Vec3f *nvca, Point *pta, int ptNr, unsigned short *ixa, int ixNr)
 
int comp_normals (float *nvca, int vNr, Point *pa)
 
int tst_glDrawArrays1 ()
 
int tst_glDrawElements1 ()
 
int gCad_fini ()
 
int gCad_main ()
 

Variables

static GLfloat colTab [][4]
 
static Vec3f VEC3F_NUL = {0.f, 0.f,0.f}
 
double vertices1 []
 

Macro Definition Documentation

#define GLU_CB   static void
#define COL_RED   0
#define COL_YELLOW   1
#define COL_SUR   2
#define Typ_VC   2

D Vector.

#define Typ_VC3f   514

vector 3D float

#define BCKPLN_XY   2

Z-Vec BCKVEC_Z.

#define BCKPLN_XZ   1

Y-Vec BCKVEC_Y.

#define BCKPLN_YZ   0

X-Vec BCKVEC_X.

#define UT3F_len_vc (   vc)    (sqrtf((vc)->dx*(vc)->dx + (vc)->dy*(vc)->dy + (vc)->dz*(vc)->dz))

Function Documentation

int UT3F_bp_vcz ( Vec3f vcn)
* UT3D_bp_vcz returns main-BackPlaneNr (0-2) from normalvec
*
* eine Hilfsebene auswaehlen; Input ist der Normalvektor der Ebene;
* es wird jene Hauptebene mit dem geringsten Wert gewaehlt.
* In: Out:
* 1,0,0 X-Vektor: 0 = BCKPLN_YZ es wird Y-Z-Plane gewaehlt;
* 0,1,0 Y-Vektor: 1 = BCKPLN_XZ es wird X-Z-Plane gewaehlt;
* 0,0,1 Z-Vektor: 2 = BCKPLN_XY es wird X-Y-Plane gewaehlt;
*
int UT3F_vc_perp_3pt ( Vec3f vp,
Point ptc,
Point ptx,
Point pty 
)
* UT3D_vc_perp_3pt float-vector = perpendic. to 3 points (crossprod)
*
* Liefert den Z-Vektor von Origin, X-AchsEndpunkt und Y-AchsEndpunkt
* Get VZ from PO, PX, PY: UT3D_vc_perp3pt (&vz, &po, &px, &py);
* Get VY from PO, PX, PZ: UT3D_vc_perp3pt (&vy, &po, &pz, &px);
*
float UT3D_len_vc ( Vec3f )

UT3F_len_vc length of 3D-vector.

void UT3F_vc_setLength ( Vec3f vco,
Vec3f vci,
float  new_len 
)
* UT3D_vc_setLength change vectorlength
*
* vco und vci duerfen ident sein
*
* use UT3D_vc_multvc with vectors of length=1
*
int set_inormal ( Vec3f nvca,
Vec3f vc1 
)
int ck_orient ( Vec3f vcn,
Point p1,
Point p2,
Point p3 
)

Output: RetCod 1 = CCW -1 = CW

int comp_inormals ( Vec3f nvca,
Point pta,
int  ptNr,
unsigned short *  ixa,
int  ixNr 
)
int comp_normals ( float *  nvca,
int  vNr,
Point pa 
)
int tst_glDrawArrays1 ( )
int tst_glDrawElements1 ( )
int gCad_fini ( )
int gCad_main ( )

Variable Documentation

GLfloat colTab[][4]
static
Initial value:
= {
1.0, 0.0, 0.0, 1.0,
1.0, 1.0, 0.0, 1.0,
0.6, 0.5, 0.5, 1.0}
Vec3f VEC3F_NUL = {0.f, 0.f,0.f}
static
double vertices1[]
Initial value:
= { 1, 1, 1, -1, 1, 1, -1,-1, 1,
-1,-1, 1, 1,-1, 1, 1, 1, 1,
1, 1, 1, 1,-1, 1, 1,-1,-1,
1,-1,-1, 1, 1,-1, 1, 1, 1,
1, 1, 1, 1, 1,-1, -1, 1,-1,
-1, 1,-1, -1, 1, 1, 1, 1, 1,
-1, 1, 1, -1, 1,-1, -1,-1,-1,
-1,-1,-1, -1,-1, 1, -1, 1, 1,
-1,-1,-1, 1,-1,-1, 1,-1, 1,
1,-1, 1, -1,-1, 1, -1,-1,-1,
1,-1,-1, -1,-1,-1, -1, 1,-1,
-1, 1,-1, 1, 1,-1, 1,-1,-1 }