Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sprint 2 submission #6

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
  •  
  •  
  •  
Binary file added .DS_Store
Binary file not shown.
33 changes: 28 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ find_package(OPENGL REQUIRED)
find_package(GLEW)
find_library(GLFW_LIBRARY "glfw3" HINTS ${GLFW_LIBRARY_DIR})
find_library(JSONCPP "jsoncpp")
find_library(TBB "tbb")


# For open VDB
find_library(OPENVDB "openvdb")
find_library(LIBZ "z")
find_library(HALF "half")


add_definitions(
-DTW_STATIC
Expand All @@ -46,7 +54,9 @@ add_definitions(
-D_CRT_SECURE_NO_WARNINGS
)

set(CORE_LIBS ${GLFW_LIBRARY} ${GLUT_LIBRARY} ${GLEW_LIBRARY} ${JSONCPP} ${OPENGL_LIBRARY} )

set(CORE_LIBS ${GLFW_LIBRARY} ${GLUT_LIBRARY} ${GLEW_LIBRARY} ${JSONCPP} ${OPENGL_LIBRARY} ${TBB} ${OPENVDB} ${LIBZ} ${HALF})


# OSX-specific hacks/fixes
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
Expand All @@ -57,38 +67,51 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CORE_LIBS ${CORE_LIBS} ${COCOA} ${IOKIT} ${COREVIDEO})
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")


# Linux specific hacks/fixes
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lX11 -lXxf86vm -lXrandr -lpthread -lXi")
endif()


# set compiler flags for c++11
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -m64 -msse2 -w")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O0 -m64 -msse2 -w")
elseif(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()


if(MSVC)
set(COMPILER_FLAGS
set(COMPILER_FLAGS
CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_RELEASE
CMAKE_C_FLAGS
CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_RELEASE
)
endif()


# Add source files you want to compile (.cpp)
set(CORE_SRC
src/main.cpp
src/camera/camera.cpp
src/viewer/shader.cpp
src/viewer/viewer.cpp
src/fluidSolver/fluidSolver.cpp
src/fluidSolver/grid.cpp
src/scene/scene.cpp
src/geom/geom.cpp
src/geom/cube.cpp
src/geom/particles.cpp
)

add_executable(Thanda ${CORE_SRC})

add_executable(Thanda ${CORE_SRC} src/viewer/SimpleVertexShader.vertexshader src/viewer/SimpleFragmentShader.fragmentshader)


target_link_libraries(Thanda ${CORE_LIBS})


Binary file added Debug/Thanda
Binary file not shown.
48 changes: 42 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,52 @@
# CIS563-FluidSolver
(Credit : CIS565 README)

Fluid Solver Submission guidelines:
Hello!

This is a fluid solver and OpenGL particle viewer that I created for CIS563:Physically-Based Animation. The fluid solver uses the FLIP/PIC algorithm, which is much too complicated for me to do justice here. Instead, I link you to the original SIGGRAPH paper, a veritable masterpiece: https://www.cs.ubc.ca/~rbridson/docs/zhu-siggraph05-sandfluid.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.
Although there's still much to be done here, I'm quite proud of this simulator -- I consider it to be some of the trickiest implementation I've ever tackled.

- Open a GitHub pull request so that we can see that you have finished. The title should be "Submission: YOUR NAME".
Next up:
I plan to find a way to export my particles and positions to Houdini so that I can create a lego fluid effect, as depicted here: http://gfycat.com/TautExcellentGrouper, created by Ryan Guy.

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

UP: zoom in
DOWN: zoom out
LEFT: pan left
RIGHT: pan right
W: rotate about the camera right axis, negative direction
S: rotate about the camera right axis, positive direction
A: rotate about the camera up axis, negative direction
D: rotate about the camera up axis, positive direction

#Organization

Camera:
Stores all camera operations for matrix computation and movement.

FluidSolver:
Will eventually be library of functions to act on Particles.

Scene:
Container for scene geometry. Initializes scene with json.

Viewer:
Calls all the window operations. Draws geometry with a call from scene.

Geometry:
Abstract class defining required functionality for the subclasses... basically just the create function for now.

Particles:
A object storing a list of particle positions and states in a bunch of parallel vectors... I'm considering changing to having a particle object also. Also a particle init function.

Cube:
Essentially just used for the fluid container. Basic cube drawing.

#External code

I used the open gl tutorial code as reference. I changed most of the code, but I'm using the loadShader code in shader.cpp verbatim. This is the code for loading the shader programs, which reads in the fragement and vertex shader code, compiles it, and links it, checking for errors at each step. This essentially just does everything necessary to actually use the shaders.

- Submit on canvas with a direct link to your pull request on GitHub


And you're done!
Binary file added Release/Thanda
Binary file not shown.
11 changes: 0 additions & 11 deletions nuparu/include/Eigen/Array

This file was deleted.

26 changes: 0 additions & 26 deletions nuparu/include/Eigen/COPYING.BSD

This file was deleted.

Loading