Skip to content
This repository was archived by the owner on Feb 9, 2022. It is now read-only.

Commit f1e384a

Browse files
committed
writing documentation
1 parent 1960fd5 commit f1e384a

3,543 files changed

Lines changed: 387700 additions & 13 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Perspective/CMakeLists.txt

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ cmake_minimum_required(VERSION 3.17)
22
project(Perspective)
33
option(BUILD_ANIMATION "Build Animation" ON)
44
set(CMAKE_CXX_STANDARD 17)
5-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
6-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
7-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
5+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
6+
# set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
7+
# set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
8+
# set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
9+
810

911
add_subdirectory(Source/deps/)
1012

@@ -37,7 +39,6 @@ message("Sources ${SOURCES}")
3739
add_executable(Perspective ${SOURCES} ${SHADER_CROSS_SOURCES} ${EXT_SOURCES} )
3840

3941

40-
4142
source_group("Source" FILES ${SOURCES})
4243
source_group("Cross Shaders" FILES ${SHADER_CROSS_SOURCES})
4344

@@ -53,12 +54,32 @@ target_link_libraries(Perspective PRIVATE glm_static)
5354
target_link_libraries(Perspective PRIVATE tinyobjloader)
5455
target_link_libraries(Perspective PRIVATE assimp)
5556

56-
set_target_properties( assimp
57-
PROPERTIES
57+
# Set Perspective, assimp, and glfw output to the bin directory
58+
set_target_properties(assimp glfw Perspective PROPERTIES
5859
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
5960
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
6061
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
61-
)
62+
)
63+
64+
################ Macro to retrieve all targets #####################
65+
function(get_all_targets var)
66+
set(targets)
67+
get_all_targets_recursive(targets ${CMAKE_CURRENT_SOURCE_DIR})
68+
set(${var} ${targets} PARENT_SCOPE)
69+
endfunction()
70+
71+
macro(get_all_targets_recursive targets dir)
72+
get_property(subdirectories DIRECTORY ${dir} PROPERTY SUBDIRECTORIES)
73+
foreach(subdir ${subdirectories})
74+
get_all_targets_recursive(${targets} ${subdir})
75+
endforeach()
76+
77+
get_property(current_targets DIRECTORY ${dir} PROPERTY BUILDSYSTEM_TARGETS)
78+
list(APPEND ${targets} ${current_targets})
79+
endmacro()
80+
###############################################################
81+
82+
6283

6384
target_precompile_headers(Perspective PRIVATE "Source/src/stdafx.cpp")
6485

@@ -71,4 +92,10 @@ if(MSVC)
7192
target_link_options(Perspective PUBLIC /incremental PUBLIC /debug:fastlink)
7293
set_property(TARGET Perspective PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
7394
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Perspective)
95+
96+
# Now we can put all targets into nice folders for msvc
97+
get_all_targets(all_targets)
98+
message("All targets: ${all_targets}")
99+
list(REMOVE_ITEM all_targets "Perspective")
100+
set_target_properties(${all_targets} PROPERTIES FOLDER "External")
74101
endif()
713 KB
Binary file not shown.
476 KB
Binary file not shown.

Perspective/Readme.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Advanced Animation CS460 Assignment 1
2+
### Student: Roland Shum
3+
### Professor: Prof Xin Li
4+
5+
# Assignment Objectives
6+
(1) Modelling:
7+
* Loading of .fbx model
8+
* Imported ASSIMP library
9+
* https://github.com/assimp/assimp
10+
* Library has known issues with fbx files, so untested models may break
11+
* Imported animation using .fbx files
12+
* Using ASSIMP library again
13+
* Used node tree to graph bones
14+
* Used my own implementation of Quaternion and VQS
15+
* Used VQS concatenation to transform spaces
16+
17+
(2) Animation:
18+
* Read key frames and interpolate between keyframes for animation
19+
* Implemented Lerp, Slerp, ELerp
20+
* Demonstrated and used in exe
21+
* Implemented iSlerp and iVQS
22+
* iSlerp is used and demonstrated in build
23+
* iVQS proved very troublesome to showcase as it requires preprocessing of each frame
24+
* ASSIMP gives a [position, timestamp], [rotation, timestamp], and [scale, timestamp] for each bone
25+
* To properly use iVQS I would need to
26+
* At each timestamp regardless of position, rotation or scale
27+
* Record the [position, rotation or scale]
28+
* Interpolate the other two elements to find the right values for them
29+
* Insert into keyframe
30+
* This proved too long to do
31+
* Incremental approaches run at 60 FPS, while others run at a variadic rate
32+
33+
# How to Build:
34+
* Run prepackaged file "RunCMake.bat" which will
35+
* Run the packaged portable cmake
36+
* cmake will generate the visual studio solution
37+
* Open VS solution
38+
* Build + Run
39+
40+
# Instructions / Controls:
41+
* **[WASD] camera movement**
42+
* **[Hold Right Mouse button + Drag] to rotate camera**
43+
* Rendering speed of ~110 FPS on my laptop
44+
* Modify ImGui GUI at will to make things nice and simple
45+
* There are GUI controls in the ImGui meant for showcasing different lerp
46+
* GUI controls for selecting which animation to play
47+
48+
49+
# High Level Explanation
50+
* Framework modified from previous CS class
51+
* That is why it uses a CMake pipeline
52+
* Has deferred and forward rendering for OpenGL
53+
* Relevant files for grading:
54+
* Project: Perspective
55+
* CS460AssignmentOne.cpp
56+
* Main entry point to the scene
57+
* Bone.cpp
58+
* Abstracts a bone
59+
* **Interpolation functions for bones are called here**
60+
* Model.cpp
61+
* Holds multiple meshes
62+
* Loads meshes from assimp
63+
* Loads vertex data
64+
* Quaternions.cpp
65+
* **My implementation of quaternions**
66+
* **My implementation of VQS**
67+
* Main.cpp
68+
* Holds test cases for VQS and quaternion implementation
69+
* Animation.cpp
70+
* Holds a specific animation reel loaded from ASSIMP
71+
* Animator.cpp
72+
* Holds a pointer to the current animation playing
73+
* Updates that animation
74+
* MyMath.cpp
75+
* Holds implemntation for
76+
* Lerp
77+
* Slerp
78+
* Slight modification to slerp
79+
* When alpha < 0.0f
80+
* It swaps around one of the quaternions for correct interpolation
81+
* When alpha is close to 1.0f
82+
* Use Lerp to avoid side effects of flipping
83+
* iLerp
84+
* iSlerp
85+
* eLerp
86+
* Shaders
87+
* shader/material/Phong_Animated.vert.glsl
88+
* Skinning
89+
* VQS sent to shaders via UBO
90+
* VQS conversion to mat4
91+
92+
# Developed on
93+
Windows:
94+
95+
OS: Windows NT 10.0.18362.0
96+
97+
Host: GIGABYTE AERO 15WV8
98+
99+
CPU: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
100+
101+
GPU: Intel(R) UHD Graphics 630 NVIDIA GeForce GTX 1060
102+
103+
OpenGL version: 4.6 NVIDIA 451.67
104+
105+
Visual Studio 2019 Preview
106+
107+
Windows SDK version : 10.0.18362.0
108+
109+
110+
111+
112+
113+
114+

Perspective/RunCMake.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
set BUILD_CONFIG=%1
44
set BUILD_DIR=%2
5+
set CMAKE_EXE="tools\\cmake\\bin\\cmake.exe"
56

67
IF NOT DEFINED BUILD_CONFIG (SET BUILD_CONFIG="RelWithDebInfo")
78
IF NOT DEFINED BUILD_DIR (SET BUILD_DIR="vsbuild")
89

9-
cmake -G "Visual Studio 16 2019" -A x64 -S . -B %BUILD_DIR%
10+
%CMAKE_EXE% -G "Visual Studio 16 2019" -A x64 -S . -B %BUILD_DIR%
1011

1112

Perspective/Source/src/CS460AssignmentOne.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
#include "FinalPass.h"
2121
#include "ForwardRendering.h"
2222
#include "DebugDraw.h"
23-
#include <assimp/Importer.hpp> // C++ importer interface
24-
#include <assimp/scene.h> // Output data structure
25-
#include <assimp/postprocess.h> // Post processing flags
2623
#include "Model.h"
2724
#include "TransformSystem.h"
2825
#include "Animation.h"
@@ -188,6 +185,4 @@ void CS460AssignmentOne::Draw(const Input &input, float deltaTime, float running
188185
ImGui::TreePop();
189186
}
190187
}
191-
192-
193188
}
9.03 MB
Binary file not shown.
1.06 MB
Binary file not shown.
9.12 MB
Binary file not shown.
9.91 MB
Binary file not shown.

0 commit comments

Comments
 (0)