53 #define CUBE_BSIZE_CHAR 1
54 #define CUBE_BSIZE_SHORT 2
55 #define CUBE_BSIZE_RGB 3
56 #define CUBE_BSIZE_LONG 4
68 typedef struct vertex_fp
73 typedef struct vertex_p
78 typedef struct rotation_desc
86 typedef struct graph_env
88 int clipl, clipr, clipd, clipu, clipz;
89 int midx, midy, lineadd, zpro;
90 unsigned long bbox_colour;
95 typedef struct tex_desc
98 int widthx, widthy, widthz;
108 typedef struct mdd_desc
121 typedef struct bounding_box
123 int minx, miny, maxx, maxy;
137 #define RENDER_NORM_KERNEL_VOID 0
138 #define RENDER_NORM_KERNEL_HOMO 1
139 #define RENDER_NORM_KERNEL_LINEAR 2
140 #define RENDER_NORM_KERNEL_GAUSS 3
142 typedef unsigned short zbuffer_t;
144 typedef struct mesh_desc
148 real_t scaleGrid, scaleHeight;
149 real_t oldGrid, oldHeight;
155 unsigned int zbuffSize;
158 typedef struct light_desc
167 typedef struct voxel_desc
169 double pixelThresholdLow;
170 double pixelThresholdHigh;
171 double weightThreshold;
172 int weightQuantisation;
173 int useRgbBrightness;
180 typedef struct render_desc
183 vertex_fp left_g, right_g;
184 vertex_fp left_t, right_t;
185 long left_p, right_p;
200 extern void RenderCubeClipCube(
const vertex_fp geomData[4], render_desc *renderDesc,
int removeHidden);
201 extern render_desc *RenderCubeBuild(
const vertex_fp geomData[4],
const graph_env *graphEnv);
202 extern void RenderCubeFreeDesc(render_desc *renderDesc);
203 extern int RenderCubeGetPosition(
int x_p,
int y_p, vertex_fp *pos, render_desc *renderDesc);
204 extern void RenderCubeDetermineRotation(
const vertex_fp *base, rotation_desc *rd);
213 extern int RenderCube(
const vertex_fp geomData[4],
const graph_env *graphEnv,
const tex_desc *texDesc);
216 extern int RenderCubeSurf(
const vertex_fp geomData[4],
const graph_env *graphEnv,
const tex_desc *texDesc);
219 extern int RenderCubeVoxel(
const vertex_fp geomData[4],
const graph_env *graphEnv,
const tex_desc *texDesc, voxel_desc *voxDesc);
223 extern void Render3DLine(
const vertex_fp *from,
const vertex_fp *to,
const render_desc *renderDesc,
long colour);
225 extern void RenderLineSegment(
const vertex_p *from,
const vertex_p *to,
const render_desc *renderDesc,
long colour);
228 extern int RenderShadedPolygon(
int numVert,
const vertex_fp *vertices,
const vertex_fp *normals,
unsigned int colour,
const graph_env *graphEnv,
const light_desc *lightDesc,
const vertex_fp *real_norm, zbuffer_t *zbuffer);
231 extern int RenderHeightField(mesh_desc *meshDesc,
const vertex_fp *rotTrans,
const graph_env *graphEnv,
const mdd_desc *mddDesc,
const light_desc *lightDesc);
233 extern void RenderHeightFreeMesh(mesh_desc *meshDesc);
235 extern int RenderHeightGetDomain(
const mdd_desc *mddDesc,
int *dimx,
int *dimz,
int *stepx,
int *stepz);