| 23 |
|
|
| 24 |
|
struct Face; /* forward declaration */ |
| 25 |
|
|
| 26 |
+ |
typedef int VNDX[3]; /* vertex indices (point,map,normal) */ |
| 27 |
+ |
|
| 28 |
+ |
/* Structure to hold vertex indices and link back to face list */ |
| 29 |
|
typedef struct { |
| 30 |
|
int vid; /* vertex id */ |
| 31 |
|
int tid; /* texture id */ |
| 98 |
|
/* Add a descriptive comment */ |
| 99 |
|
void addComment(Scene *sc, const char *comment); |
| 100 |
|
|
| 101 |
+ |
/* Find index for comment containing the given string (starting from n) */ |
| 102 |
+ |
int findComment(Scene *sc, const char *match, int n); |
| 103 |
+ |
|
| 104 |
|
/* Clear comments */ |
| 105 |
|
void clearComments(Scene *sc); |
| 106 |
|
|
| 158 |
|
int changeMaterial(Scene *sc, const char *mname, |
| 159 |
|
int flreq, int flexc); |
| 160 |
|
|
| 161 |
< |
/* Grab texture coord's/normals from another object via ray tracing */ |
| 162 |
< |
#define GET_TEXTURE 01 |
| 163 |
< |
#define GET_NORMALS 02 |
| 164 |
< |
int traceSurface(Scene *sc, int flreq, int flexc, |
| 165 |
< |
const char *oct, int what); |
| 161 |
> |
/* Add a vertex to our scene, returning index */ |
| 162 |
> |
int addVertex(Scene *sc, double x, double y, double z); |
| 163 |
> |
|
| 164 |
> |
/* Add a texture coordinate to our scene, returning index */ |
| 165 |
> |
int addTexture(Scene *sc, double u, double v); |
| 166 |
> |
|
| 167 |
> |
/* Add a surface normal to our scene, returning index */ |
| 168 |
> |
int addNormal(Scene *sc, double xn, double yn, double zn); |
| 169 |
> |
|
| 170 |
> |
/* Set current group (sc->lastgrp) to given ID */ |
| 171 |
> |
void setGroup(Scene *sc, const char *nm); |
| 172 |
> |
|
| 173 |
> |
/* Set current material (sc->lastmat) to given ID */ |
| 174 |
> |
void setMaterial(Scene *sc, const char *nm); |
| 175 |
> |
|
| 176 |
> |
/* Add a new face to our scene, using current group and material */ |
| 177 |
> |
Face * addFace(Scene *sc, VNDX vid[], int nv); |
| 178 |
|
|
| 179 |
|
/* Free a scene */ |
| 180 |
|
void freeScene(Scene *sc); |