Tachyon (current)  Current Main Branch
Functions
apigeom.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "tachyon.h"

Go to the source code of this file.

Functions

void VNorm (apivector *)
 
void rt_polycylinder (SceneHandle scene, void *tex, apivector *points, int numpts, flt rad)
 Define a sequence of connected cylinders. More...
 
void rt_polycylinder3fv (SceneHandle scene, void *tex, const float *points, int numpts, float rad)
 Define a sequence of connected cylinders. More...
 
void rt_heightfield (SceneHandle scene, void *tex, apivector ctr, int m, int n, flt *field, flt wx, flt wy)
 Define an axis-aligned height field. More...
 
static void rt_sheightfield (SceneHandle scene, void *tex, apivector ctr, int m, int n, flt *field, flt wx, flt wy)
 
static void adjust (flt *base, int xres, int yres, flt wx, flt wy, int xa, int ya, int x, int y, int xb, int yb, unsigned int *rndval)
 
static void subdivide (flt *base, int xres, int yres, flt wx, flt wy, int x1, int y1, int x2, int y2, unsigned int *rndval)
 
void rt_landscape (SceneHandle scene, void *tex, int m, int n, apivector ctr, flt wx, flt wy)
 Define an auto-generated height field. More...
 

Function Documentation

◆ adjust()

static void adjust ( flt base,
int  xres,
int  yres,
flt  wx,
flt  wy,
int  xa,
int  ya,
int  x,
int  y,
int  xb,
int  yb,
unsigned int *  rndval 
)
static

Definition at line 180 of file apigeom.c.

References rt_rand(), RT_RAND_MAX_INV, and SQRT.

Referenced by subdivide().

◆ rt_heightfield()

void rt_heightfield ( SceneHandle  ,
void *  tex,
apivector  center,
int  m,
int  n,
flt field,
flt  wx,
flt  wy 
)

Define an axis-aligned height field.

Definition at line 70 of file apigeom.c.

References rt_tri(), apivector::x, apivector::y, and apivector::z.

◆ rt_landscape()

void rt_landscape ( SceneHandle  ,
void *  tex,
int  m,
int  n,
apivector  center,
flt  wx,
flt  wy 
)

Define an auto-generated height field.

Definition at line 225 of file apigeom.c.

References rt_rand(), RT_RAND_MAX_INV, rt_sheightfield(), and subdivide().

Referenced by GetLandScape().

◆ rt_polycylinder()

void rt_polycylinder ( SceneHandle  ,
void *  tex,
apivector points,
int  numpoints,
flt  radius 
)

Define a sequence of connected cylinders.

Definition at line 20 of file apigeom.c.

References rt_fcylinder(), rt_sphere(), apivector::x, apivector::y, and apivector::z.

Referenced by GetPolyCylinder().

◆ rt_polycylinder3fv()

void rt_polycylinder3fv ( SceneHandle  ,
void *  tex,
const float *  points,
int  numpoints,
float  radius 
)

Define a sequence of connected cylinders.

Definition at line 44 of file apigeom.c.

References rt_fcylinder3fv(), and rt_sphere3fv().

◆ rt_sheightfield()

static void rt_sheightfield ( SceneHandle  scene,
void *  tex,
apivector  ctr,
int  m,
int  n,
flt field,
flt  wx,
flt  wy 
)
static

Definition at line 114 of file apigeom.c.

References rt_stri(), rt_vector(), VNorm(), apivector::x, apivector::y, and apivector::z.

Referenced by rt_landscape().

◆ subdivide()

static void subdivide ( flt base,
int  xres,
int  yres,
flt  wx,
flt  wy,
int  x1,
int  y1,
int  x2,
int  y2,
unsigned int *  rndval 
)
static

Definition at line 199 of file apigeom.c.

References adjust().

Referenced by rt_landscape().

◆ VNorm()

void VNorm ( apivector )