12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- #ifndef __meshgen_h__
- #define __meshgen_h__
- #include "c3dlas.h"
- typedef struct {
- Vector3* vertices;
- Vector3* normals;
- short* indices;
- int nElements;
- int nVertices;
- int nNormals;
- int nIndices;
- short width;
- short height;
- } IndexedPatch;
- typedef struct TriangleMesh {
- Vector3* vertices;
- Vector3* normals;
- unsigned int* indices;
-
-
- int vertexCnt;
- int indexCnt;
-
-
-
- int szVertices;
- int szIndices;
-
- char windingDir;
- } TriangleMesh;
- typedef struct MeshSlice {
-
- short* indices;
-
-
- int vertexCnt;
- int indexCnt;
-
-
- int szVertices;
- int szIndices;
-
- Vector2 texDxDy;
- } MeshSlice;
- void mgGenFlatPatch(short width, short height, IndexedPatch* out);
- float* genNoisef(short width, short height, float min, float max);
- TriangleMesh* makeCube(Matrix* mat, int flat);
- TriangleMesh* makeQuad(float width, float height);
- TriangleMesh* makeCylinder(int sides, float height, float baseRadius, float topRadius);
- TriangleMesh* makeIcosahedron(float radius);
- TriangleMesh* makeSubbedIcosahedron(float radius, int subdivisions);
- TriangleMesh* makeParallelpiped();
- #endif
|