资源简介
写毕业论文,从国外网站找到的液体流动仿真这方面的材料,这个是比较好的一个,可以运行,使用对比学习
代码片段和文件信息
/*
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
相关资源
- Eclipse+WebSphere部署WAR应用
- 大气科学Atmospheric Science An Introductor
- 精通WebSphere Message Broker
- IBM Websphere安装配置与项目部署
- 精通 WebSphere MQ(完整版)
- WebSphere+MQ入门培训教程(PPT)
- IBM_WAS.rar
- IBM WebSphere Message Broker Toolkit 7.0 教程一
- SPH 计算K文件
- WebSphere入门教程
- 基于光滑粒子流体动力学SPH的流体模
- Websphere+MQ全套教程合集.rar
- IBM_WebSphere_Portal_Express_7.0_从到安装步
- 精通+WebSphere+MQ+中文完整版
- Websphere MQ入门教程(pdf版)
- websphere MQ入门经典教程---经典
- MA5675 V800R016C00SPH205固件
- 利用OpenGL自编程实现球体源码——网
- MA5675V800R313C00SPH212固件
- sphinx4 中文声学模型、词典、语言模型
- MA5675MV800R313C00SPH213.rar
- VMware Remote Console 10.0.3 for WindowsVMware
- MA5671固件V800R016C00SPH205,205版本,最新
- ansys SPH方法教程
- Smoothed Particle Hydrodynamics A Meshfree Par
- VMware vSphere VCP 6.0培训课件官方中文版
- 光滑粒子流体动力学 一种无网格粒子
- vSphere6.7文档中文版全套
- 经典流体模拟—SPH源代码
- MA5671 V800R016C00SPH202固件
评论
共有 条评论