sph_surf.h
来自「游戏编程精粹6第中关于粒子的实时流体仿真系统,对入门的游戏开发者很有帮助.」· C头文件 代码 · 共 44 行
H
44 行
#ifndef _VOLUME_RENDERING_H
#define _VOLUME_RENDERING_H
#include "gpu_util.h"
typedef struct
{
GLfloat x;
GLfloat y;
GLfloat z;
} vector3f;
typedef struct
{
vector3f p;
vector3f n;
GLfloat val;
} cellvertex;
typedef struct
{
// cellvertex v[8];
cellvertex* v[8];
cellvertex vmem[8];
} gridcell;
typedef struct
{
GLuint width;
GLuint height;
GLuint depth;
GLfloat voxelsize;
GLfloat* density;
gridcell g;
} implicit_surface;
void implicit_surface_create(implicit_surface* s);
//void render_volume(GLfloat* density, GLfloat stride, GLuint width, GLuint height, GLuint depth, float threshold);
void render_marching_cubes(const implicit_surface* v,
int x0, int x1,
int y0, int y1,
int z0, int z1,
float threshold);
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?