Khady/p5
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
README Author: Eric Butler <edbutler@andrew.cmu.edu> Derek Basehor <dbasehor@andrew.cmu.edu> Steven Fackler <sfackler@andrew.cmu.edu> --------------------------------------------------------------------------- Overview --------------------------------------------------------------------------- In here you will find instructions for building the project and a short description of each source file. The starter code is nearly the same as the previous labs, so you should be familiar with most of it by now. The only new additions are the files realated to simulation. Report any bugs to the TAs. --------------------------------------------------------------------------- Building the Code --------------------------------------------------------------------------- This project uses the CMake build system (www.cmake.org). CMake is a kind of "meta build-system," in that it creates a build system for you. It supports many different build systems, ranging from Unix Makefiles to Visual Studio projects to XCode projects. 1) If you don't have CMake installed, you should install it. If you're running Linux, it should be available through your disto's package manager (apt-get, pacman, ports, etc). Windows and OSX installers can be downloaded from http://www.cmake.org/cmake/resources/software.html 2) Open up a command prompt in the "build" directory and run "cmake ../src". CMake will generate the build system in the build directory. By default, CMake will generate Makefiles on Linux and OSX and a Visual Studio project on Windows. If you'd like to change that, you can pass a different "generator" to cmake with the -G flag. A full list of generators can be found at the bottom of the output generated by running "cmake". For example, "cmake -G 'Xcode' ../src" will generate an Xcode project on OSX. 3) You can now use the build system in the "build" directory. The default target will compile everything for you, and the "install" target will copy the p2 executable to the main "p2" directory. CMake can build in several different modes: normal, release and debug. Debug mode adds flags to support debugging your code. If you're running into strange problems, you might want to recompile in debug mode and use GDB to see what's going on. Release mode tells the compiler to significantly optimize your code. A project like the raytracer can see significant speedups from this. To change modes, add the "-DCMAKE_BUILD_TYPE=<type>" to the cmake command, where type is Debug or Release or nothing (i.e. the empty string). For example, cmake -DCMAKE_BUILD_TYPE=Debug ../src will create a debug build. WINDOWS NOTE: If you're using Windows, you'll have to add the "windows/bin" directory to your PATH environment variable so Windows can find the shared libraries the project will use. Note: Your program MUST COMPILE on the SCS Linux machines. If you use Windows, make sure to test on Linux well in advance of the deadline. --------------------------------------------------------------------------- Running the Program --------------------------------------------------------------------------- ./p5 [scene] The program should take just a single argument, which is the scene you are rendering. It may have whichever controls you like, though they should be documented in the writeup.txt. --------------------------------------------------------------------------- C++ Notes --------------------------------------------------------------------------- For the sake of simpler math routines and data structures, the code uses C++ over straight C. The code tries to stay away from most features of the language to keep it as simple as possible. This project attempts to break you into C++ easily. Questions about virtual functions, classes, or any C++ idioms are welcome. --------------------------------------------------------------------------- Source Files and Directory Structure --------------------------------------------------------------------------- The code base is rather big, so here's a description of the top-level directories and every header/source file pair we give you. You are free to edit any of them and add as many as you like, as long as the program behavior remains the same. Also, feel free to use any files (either starter code or your code) from previous labs to help with the current project. You should have a look at: - writeup.txt - src/p5/* Note: we omit the '.cpp' or '.hpp' from the source file names in the follow listing. Legend: # - must edit this file * - should look at (header) file README -- this file writeup.txt# -- Description of your project and implementation. models/ -- models used in scenes. images/ -- textures used in scenes. src/build/* == Build system stuff. CMakeLists.txt -- Compiler flags can be adjusted by editing the list in here. src/physics/ == Project-specific files. body* -- contains the parent class for physical bodies collisions# -- contains functions for detecting collisions main -- contains main function for project physics# -- contains the physics object which contains all physical objects and updates everything. Must edit to implement RK4 for spheres. planebody* -- contains the planebody class. Mostly just a container spherebody# -- contains the spherebody class. Must edit to do step and application of forces spring# -- contains the spring class. Must edit so that it applies spring forces to objects trianglebody* -- contains the trianglebody class. Like the planebody class it is mostly just a container src/application/ == General application files. You can ignore all of it. application -- SDL backend, runs main loop. camera_roam -- camera controller imageio -- used for outputting images opengl -- Header to include correct OpenGL headers. scene_loader -- Code to load a scene from a file. src/math/ == Math utilities. camera -- Camera class with functions to mutate. color -- A class for RGB colors and related functions. math -- Basic header and a few generic functions. matrix -- 3D, 4D matrix classes and several related functions. quaternion -- Quaternion class and several related functions--very useful for 3D rotations. vector -- 2D, 3D, 4D vector classes and many related functions. src/scene/ == Scene-specific files and rendering. You can ignore all of this (mostly the same as raytracer scene files) src/tinyxml/ == XML parser ... -- Don't worry about it, you'll be better off
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published