Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
94 changes: 0 additions & 94 deletions CMakeLists.txt

This file was deleted.

17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# CIS563-FluidSolver
(Credit : CIS565 README)

Fluid Solver Submission guidelines:
final changes:

1.
diffuse steps according to:
http://www.intpowertechcorp.com/GDC03.pdf

- If you have modified any of the CMakeLists.txt files at all (aside from the list of CORE_SRC), you must test that your project can build. Beware of any build issues.
at line 533 of particle.js; this exchanges and diffuses density for each particle at every iteration, so it will stablize the simulation alittle bit

- Open a GitHub pull request so that we can see that you have finished. The title should be "Submission: YOUR NAME".

- In the body of the pull request, include a link to your repository.

- Submit on canvas with a direct link to your pull request on GitHub
2.
add (fake) rigid body

see line 356 and 392;

And you're done!
it does not really interact with fluid, it just take certain grids and estimate the velocity of those particles and apply that to the big cube. real rigid body interaction still needs works...
62 changes: 62 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.user_control
{
display: inline;
float: left;
margin-left: 10px;
margin-right: 50px;
}

.btn_s1 {
background: #3498db;
background-image: -webkit-linear-gradient(top, #3498db, #2980b9);
background-image: -moz-linear-gradient(top, #3498db, #2980b9);
background-image: -ms-linear-gradient(top, #3498db, #2980b9);
background-image: -o-linear-gradient(top, #3498db, #2980b9);
background-image: linear-gradient(to bottom, #3498db, #2980b9);
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0px;
font-family: Arial;
color: #ffffff;
font-size: 16px;
padding: 10px 20px 10px 20px;
text-decoration: none;
cursor: pointer;
max-width: 100px;
}

.btn_s1:hover {
background: #3cb0fd;
background-image: -webkit-linear-gradient(top, #3cb0fd, #3498db);
background-image: -moz-linear-gradient(top, #3cb0fd, #3498db);
background-image: -ms-linear-gradient(top, #3cb0fd, #3498db);
background-image: -o-linear-gradient(top, #3cb0fd, #3498db);
background-image: linear-gradient(to bottom, #3cb0fd, #3498db);
text-decoration: none;
cursor: pointer;
}

.btn_s1:active {
background: #3cb0fd;
background-image: -webkit-linear-gradient(top, #028eea, #015f9c);
background-image: -moz-linear-gradient(top, #028eea, #015f9c);
background-image: -ms-linear-gradient(top, #028eea, #015f9c);
background-image: -o-linear-gradient(top, #028eea, #015f9c);
background-image: linear-gradient(to bottom, #028eea, #015f9c);
text-decoration: none;
cursor: pointer;
}

.btn_container
{
margin-bottom: 15px;
}

#ut_display
{
min-width: 300px;
min-height: 300px;
max-height: 300px;
overflow-y: scroll;
resize: none;
}
13 changes: 13 additions & 0 deletions js/camera.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

var Camera = function() {
this.view = mat4.create();
mat4.lookAt(this.view, [0.0, 0.0, -12.0], [0.0, 0.0, 0.0], [0.0, 1.0, 0.0]);

this.perspective = mat4.create();
mat4.perspective(this.perspective, 0.65, 1, 1, 1000);

this.viewProj = mat4.create();

mat4.multiply(this.viewProj, this.perspective, this.view);
};
171 changes: 171 additions & 0 deletions js/fluid_system/box.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
var Box = function(gl) {

// -- Local space position

//for passing to find boundingbox
this.faces =[];

//six faces
this.faces.push(
[
[-1.0, -1.0, 1.0],
[1.0, -1.0, 1.0],
[1.0, 1.0, 1.0],
[-1.0, 1.0, 1.0]
]
);
this.faces.push(
[
[-1.0, -1.0, -1.0],
[-1.0, 1.0, -1.0],
[1.0, 1.0, -1.0],
[1.0, -1.0, -1.0]
]
);
// this.faces.push(
// [
// [-1.0, 1.0, -1.0],
// [-1.0, 1.0, 1.0],
// [1.0, 1.0, 1.0],
// [1.0, 1.0, -1.0]
// ]
// );
this.faces.push(
[
[-1.0, -1.0, -1.0],
[1.0, -1.0, -1.0],
[1.0, -1.0, 1.0],
[-1.0, -1.0, 1.0]
]
);
this.faces.push(
[
[1.0, -1.0, -1.0],
[1.0, 1.0, -1.0],
[1.0, 1.0, 1.0],
[1.0, -1.0, 1.0]
]
);
this.faces.push(
[
[-1.0, -1.0, -1.0],
[-1.0, -1.0, 1.0],
[-1.0, 1.0, 1.0],
[-1.0, 1.0, -1.0]
]
);

this.positions = [
// Front face
-1.0, -1.0, 1.0,
1.0, -1.0, 1.0,
1.0, 1.0, 1.0,
-1.0, 1.0, 1.0,

// Back face
-1.0, -1.0, -1.0,
-1.0, 1.0, -1.0,
1.0, 1.0, -1.0,
1.0, -1.0, -1.0,

// Top face
-1.0, 1.0, -1.0,
-1.0, 1.0, 1.0,
1.0, 1.0, 1.0,
1.0, 1.0, -1.0,

// Bottom face
-1.0, -1.0, -1.0,
1.0, -1.0, -1.0,
1.0, -1.0, 1.0,
-1.0, -1.0, 1.0,

// Right face
1.0, -1.0, -1.0,
1.0, 1.0, -1.0,
1.0, 1.0, 1.0,
1.0, -1.0, 1.0,

// Left face
-1.0, -1.0, -1.0,
-1.0, -1.0, 1.0,
-1.0, 1.0, 1.0,
-1.0, 1.0, -1.0
];

// @todo: fill up
this.normals = new Float32Array([

]);

// @todo: doesn't have to be 32-bit
this.colors = new Float32Array([

]);

// @todo: fill up
this.texcoords = new Float32Array([

]);

this.indices = new Uint16Array([
0, 1, 2, 1, 2, 3, // front
2, 3, 0, 3, 0, 1,

4, 5, 6, 5, 6, 7, // back
6, 7, 4, 7, 4, 5,

8, 9, 8, 9, 10, 9, // top
10, 11, 10, 11, 8, 11,

12, 13, 14, 13, 14, 15, // bottom
14, 15, 12, 15, 12, 13,

16, 17, 18, 17, 18, 19, // right
18, 19, 16, 19, 16, 17,

20, 21, 22, 21, 22, 23, // left
22, 23, 20, 23, 20, 21

]);

// -- GL Buffers

this.posBuffer = gl.createBuffer();
this.norBuffer = gl.createBuffer();
this.idxBuffer = gl.createBuffer();

this.idxCount = this.indices.length;

// -- TRANSFORMATIONS

this.model = mat4.create();

this.translate = function(newPosition) {

}

this.rotate = function(radx, rady, radz) {
mat4.rotateX(this.model, this.model, radx * Math.PI);
mat4.rotateY(this.model, this.model, rady * Math.PI);
mat4.rotateZ(this.model, this.model, radz * Math.PI);
}

// -- FUNCTIONS


// -- Create function. Must call during intialization
this.create = function(gl) {

// Position buffer
gl.bindBuffer(gl.ARRAY_BUFFER, this.posBuffer);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.positions), gl.STATIC_DRAW);

// @todo: fill up data for normals, texcoord, and colors

// Element buffer
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.idxBuffer);
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);

}
}
Loading