资源简介
写毕业论文,从国外网站找到的液体流动仿真这方面的材料,这个是比较好的一个,可以运行,使用对比学习

代码片段和文件信息
/*
FLUIDS v.1 - SPH Fluid Simulator for CPU and GPU
Copyright (C) 2008. Rama Hoetzlein http://www.rchoetzlein.com
ZLib license
This software is provided ‘as-is‘ without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose
including commercial applications and to alter it and redistribute it
freely subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include
#include
#include
#include
#include
#include “common_defs.h“
#ifdef BUILD_CUDA
#include “fluid_system_host.cuh“
#endif
#include “fluid_system.h“
#include “gl_helper.h“
#ifdef _MSC_VER // Windows
#include
#else // Linux
#include
#endif
bool bTiming = false;
bool bRec = false;
int mframe = 0;
// Globals
FluidSystem psys;
float window_width = 1024;
float window_height = 768;
Vector3DF cam_from cam_angs cam_to; // Camera stuff
Vector3DF obj_from obj_angs obj_dang;
Vector3DF light[2] light_to[2]; // Light stuff
float light_fov cam_fov;
int psys_rate = 0; // Particle stuff
int psys_freq = 1;
int psys_demo = 0;
int psys_nmax = 4096;
bool bHelp = false; // Toggles
int iShade = 1;
int iClrMode = 0;
bool bPntDraw = false;
bool bPause = false;
// View matricies
float view_matrix[16]; // View matrix (V)
float model_matrix[16]; // Model matrix (M)
float proj_matrix[16]; // Projective matrix
// Mouse control
#define DRAG_OFF 0 // mouse states
#define DRAG_LEFT 1
#define DRAG_RIGHT 2
int last_x = -1 last_y = -1; // mouse vars
int mode = 0;
int dragging = 0;
int psel;
GLuint screen_id;
GLuint depth_id;
// Different things we can move around
#define MODE_CAM 0
#define MODE_CAM_TO 1
#define MODE_OBJ 2
#define MODE_OBJPOS 3
#define MODE_OBJGRP 4
#define MODE_LIGHTPOS 5
#define MODE_DOF 6
GLuint screenBufferobject;
GLuint depthBufferobject;
GLuint envid;
void drawScene ( float* viewmat bool bShade )
{
if ( iShade <= 1 && bShade ) {
glEnable ( GL_LIGHT0 );
GLfloat diff[4];
GLfloat spec[4];
GLfloat shininess = 60.0;
diff[0] = 0.8f; diff[1] = 0.8f; diff[2] = 0.8f; diff[3] = 1.0f;
spec[0] = 1.0f; spec[1] = 1.0f; spec[2] = 1.0f; spec[3] = 1.0f;
glMaterialfv (GL_FRONT_AND_BACK GL_DIFFUSE &diff[
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-03-29 10:24 fluids_v2\
文件 2342 2009-10-19 18:30 fluids_v2\READ_ME.txt
目录 0 2013-03-29 10:22 fluids_v2\common\
目录 0 2013-03-29 10:22 fluids_v2\common\GL\
文件 720794 2009-10-19 18:30 fluids_v2\common\GL\glee.c
文件 603316 2009-10-19 18:30 fluids_v2\common\GL\glee.h
文件 382527 2009-10-19 18:30 fluids_v2\common\GL\glext.h
文件 639 2009-10-19 18:30 fluids_v2\common\GL\glut.h
文件 911 2009-10-19 18:30 fluids_v2\common\common_defs.h
文件 681 2009-10-19 18:30 fluids_v2\common\freeglut.h
文件 7324 2009-10-19 18:30 fluids_v2\common\freeglut_ext.h
文件 23980 2009-10-20 02:48 fluids_v2\common\freeglut_std.h
文件 12246 2009-10-19 18:30 fluids_v2\common\geomx.cpp
文件 4306 2009-10-19 18:30 fluids_v2\common\geomx.h
文件 13360 2009-10-19 18:30 fluids_v2\common\gl_helper.cpp
文件 1791 2009-10-19 18:30 fluids_v2\common\gl_helper.h
文件 43334 2009-10-19 18:30 fluids_v2\common\image.cpp
文件 4450 2009-10-19 18:30 fluids_v2\common\image.h
文件 70037 2009-10-19 18:30 fluids_v2\common\matrix-inline.h
文件 79956 2009-10-19 18:30 fluids_v2\common\matrix.cci
文件 25 2009-10-19 18:30 fluids_v2\common\matrix.cpp
文件 14445 2009-10-19 18:30 fluids_v2\common\matrix.h
文件 14952 2009-10-19 18:30 fluids_v2\common\mdebug.cpp
文件 3131 2009-10-19 18:30 fluids_v2\common\mdebug.h
文件 27529 2009-10-19 18:30 fluids_v2\common\mesh.cpp
文件 4352 2009-10-19 18:30 fluids_v2\common\mesh.h
文件 1325 2009-10-19 18:30 fluids_v2\common\mesh_info.h
文件 15492 2009-10-19 18:30 fluids_v2\common\mtime.cpp
文件 7977 2009-10-19 18:30 fluids_v2\common\mtime.h
文件 22 2009-10-19 18:30 fluids_v2\common\particle.cpp
文件 76 2009-10-19 18:30 fluids_v2\common\particle.h
............此处省略34个文件信息
- 上一篇:计算机组成原理第2版蒋本珊
- 下一篇:20170508095032398.rar
相关资源
- Apolipoprotein E4 Impairs in vivo Hippocampal
- vSphere6.06.56.7通用版注册机
- VMware vSphere 的 Intel 82579LM网卡驱动 最
- Numerical simulation and prediction of radio f
- WebSphere MQ工作原理
- Optimal recovery of functions on the sphere on
- IBM Websphere MQ 教程之备份与恢复
- 通过IBM WebSphere技术Intrix解决方案中已
- sphinx中文分词 xdict_1.1.tar.gz
- VMware vSphere 全系列序列号
- A simple two-step synthesis of Fe2O3 hollow mi
- Facile hydrothermal synthesis of Tb2(MoO4)
- TH upstream-inhibited ARHGAP12 subnetwork for
- SCMA系统的仿真
- sph代码(美国)
- 光滑粒子流体动力学SPH源程序
- Finite-time blowup for the 3-D primitive equat
- (Salen)Ti(IV)-Catalyzed Asymmetric Rin
- WebSphere_Application_Server教程
- 西门子MindSphere技术白皮书
- IBM Websphere ESB企业服务总线
- HP VC FlexFabric应用于VMware vSphere环境的
- PocketSphinxDemo
- Vmware vSphere 架构师培训官方PPT
- S9300 V200R011SPH008 补丁与WEB文件
- VMWARE NSX6.4安装+管理指南中文版.zip
- sphinx 声学模型和词典
- veeam backup9.5使用心得
- vsan-6.7-管理指南.pdf
- VMware vSphere P2V操作文档 图文版VMware
评论
共有 条评论