The last assignment of CMU CG course is a self-selected project (detail).
What I chose is Option F, SPH Fluid Simulation, cooperated with Sarvesh Subramanian. I implemented the SPH model, while he took charge of the Marching Cube algorithm and OpenGL part.
This post includes a tutorial of how to setup OpenGL project on Windows by Visual Studio 2015.
- Download the library from here and extract it. you get:
- Create an empty project in Visual Studio. (What I used was VS 2015)
- Press ctrl+shift+A to add a new item, choose Visual C++ > C++ file, name it “main.cpp”;
- In Solution Explorer, right click the project (NOT the solution), choose properties.
- On the top left besides Configuration, click on the drop down menu and choose All Configurations. ( For some reason I cannot switch the language to English or it will cause error. but the location of the menu and the option might be the same )
- On the left menu, choose Configuration Properties > C/C++ > General > Additional Include Directions. Choose it and click on <eidt..>
- In the pop-up window, click on the blank place, click the “…” button. Choose (your extract location)/freeglut/include from the folder you just extracted. Click on the following line, click the “…” button, and again, choose (your extract location)/glew-1.11.0/include. Once you done, click OK.
- Back to the Property Page, on the left choose choose Configuration Properties > Linker > Input> Additional Dependencies. Choose it and click on <edit..>
- In the pop-up window, input “freeglut.lib” and “glew32.lib” as 2 lines. Then click “OK“.
- Back to the Property Page, on the left choose choose Configuration Properties > Linker > General> Additional Library Directions. Choose it and click on <edit..>
- As step 7, add (your extract location)/freeglut/lib and (your extract location)/glew-1.11.0/lib
- Back to the Property Page, click on “Apply” and “OK“.
- In Solution Explorer, right click the project, choose Open Folder in File Explorer.
- Copy freeglut.dll and glew32.dll from the file you extracted to the file.
Now you should be able to code your OpenGL project. If you want to test whether the system is working, you can copy code from (your extract location)/Base Code.txt to main.cpp and run it. The result should be: