├── .DS_Store ├── Base ├── .DS_Store ├── Mac配置文件.zip ├── fftw3.zip ├── glad.zip └── windows配置文件.zip ├── CODE ├── .DS_Store ├── Learning_OpenGL │ ├── Assimp │ │ ├── glad.c │ │ └── main.cpp │ ├── Base_Light │ │ ├── 2.1.basic_lighting.fs │ │ ├── 2.1.basic_lighting.vs │ │ ├── 2.1.lamp.fs │ │ ├── 2.1.lamp.vs │ │ ├── glad.c │ │ └── main.cpp │ ├── Base_Light2.0 │ │ ├── 2.2.basic_lighting.fs │ │ ├── 2.2.basic_lighting.vs │ │ ├── 2.2.lamp.fs │ │ ├── 2.2.lamp.vs │ │ ├── glad.c │ │ └── main.cpp │ ├── Bloom │ │ ├── 7.bloom.fs │ │ ├── 7.bloom.vs │ │ ├── 7.bloom_final.fs │ │ ├── 7.bloom_final.vs │ │ ├── 7.blur.fs │ │ ├── 7.blur.vs │ │ ├── 7.light_box.fs │ │ ├── glad.c │ │ └── main.cpp │ ├── Debugging │ │ ├── debugging.fs │ │ ├── debugging.vs │ │ ├── glad.c │ │ └── main.cpp │ ├── GLSL │ │ ├── glad.c │ │ ├── main.cpp │ │ └── shader │ │ │ ├── 8.advanced_glsl.vs │ │ │ ├── 8.blue.fs │ │ │ ├── 8.green.fs │ │ │ ├── 8.red.fs │ │ │ └── 8.yellow.fs │ ├── GeometryShader │ │ ├── 9.1.geometry_shader.fs │ │ ├── 9.1.geometry_shader.gs │ │ ├── 9.1.geometry_shader.vs │ │ ├── glad.c │ │ └── main.cpp │ ├── HDR │ │ ├── 6.hdr.fs │ │ ├── 6.hdr.vs │ │ ├── 6.lighting.fs │ │ ├── 6.lighting.vs │ │ ├── SOIL.c │ │ ├── glad.c │ │ └── main.cpp │ ├── Instancing │ │ ├── 10.1.instancing.fs │ │ ├── 10.1.instancing.vs │ │ ├── glad.c │ │ └── main.cpp │ ├── Learning_OpenGL.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcuserdata │ │ │ │ └── boone.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ └── xcuserdata │ │ │ └── boone.xcuserdatad │ │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ ├── Learning_OpenGL │ │ ├── .DS_Store │ │ ├── glad.c │ │ └── main.cpp │ ├── LightCasters │ │ ├── 5.1.lamp.fs │ │ ├── 5.1.lamp.vs │ │ ├── 5.1.light_casters.fs │ │ ├── 5.1.light_casters.vs │ │ ├── glad.c │ │ └── main.cpp │ ├── LightMapping │ │ ├── 4.1.lamp.fs │ │ ├── 4.1.lamp.vs │ │ ├── 4.1.lighting_maps.fs │ │ ├── 4.1.lighting_maps.vs │ │ ├── glad.c │ │ └── main.cpp │ ├── Light_Color │ │ ├── 1.colors.fs │ │ ├── 1.colors.vs │ │ ├── 1.lamp.fs │ │ ├── 1.lamp.vs │ │ ├── glad.c │ │ └── main.cpp │ ├── Material │ │ ├── 3.1.lamp.fs │ │ ├── 3.1.lamp.vs │ │ ├── 3.1.materials.fs │ │ ├── 3.1.materials.vs │ │ ├── glad.c │ │ └── main.cpp │ ├── MultipleLights │ │ ├── glad.c │ │ └── main.cpp │ ├── NormalVector │ │ ├── glad.c │ │ ├── main.cpp │ │ ├── nanosuit.mtl │ │ └── nanosuit.obj │ ├── Planet │ │ ├── 10.3.asteroids.fs │ │ ├── 10.3.asteroids.vs │ │ ├── 10.3.planet.fs │ │ ├── 10.3.planet.vs │ │ ├── glad.c │ │ └── main.cpp │ ├── Render_to_texture │ │ ├── 5.1.framebuffers.fs │ │ ├── 5.1.framebuffers.vs │ │ ├── 5.1.framebuffers_screen.fs │ │ ├── 5.1.framebuffers_screen.vs │ │ ├── glad.c │ │ └── main.cpp │ ├── SkyBox │ │ ├── 6.1.cubemaps.fs │ │ ├── 6.1.cubemaps.vs │ │ ├── 6.1.skybox.fs │ │ ├── 6.1.skybox.vs │ │ ├── glad.c │ │ └── main.cpp │ └── TestFFT │ │ ├── .DS_Store │ │ └── main.cpp ├── OpenGL │ ├── .DS_Store │ ├── FirstWindow │ │ ├── glad.c │ │ └── main.cpp │ ├── OpenGL.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ ├── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ └── xcuserdata │ │ │ │ └── boone.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ └── xcuserdata │ │ │ └── boone.xcuserdatad │ │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ ├── OpenGL │ │ ├── glad.c │ │ └── main.cpp │ ├── Shader │ │ ├── glad.c │ │ └── main.cpp │ ├── Texture2.0 │ │ ├── 4.2.texture.fs │ │ ├── 4.2.texture.vs │ │ ├── awesomeface.png │ │ ├── container.jpg │ │ ├── glad.c │ │ └── main.cpp │ ├── Texture3.0 │ │ ├── .DS_Store │ │ ├── glad.c │ │ ├── image │ │ │ ├── awesomeface.png │ │ │ └── container.jpg │ │ ├── main.cpp │ │ └── shader │ │ │ ├── 4.3.texture.fs │ │ │ └── 4.3.texture.vs │ ├── Transform │ │ ├── .DS_Store │ │ ├── 5.1.transform.fs │ │ ├── 5.1.transform.vs │ │ ├── glad.c │ │ ├── image │ │ │ ├── awesomeface.png │ │ │ └── container.jpg │ │ └── main.cpp │ └── Triangle │ │ ├── glad.c │ │ └── main.cpp ├── Spectrum │ ├── .DS_Store │ ├── Spectrum.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcuserdata │ │ │ │ └── boone.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ └── xcuserdata │ │ │ └── boone.xcuserdatad │ │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ ├── Spectrum │ │ ├── glad.c │ │ └── main.cpp │ ├── Spectrum2.0 │ │ ├── .DS_Store │ │ ├── glad.c │ │ ├── main.cpp │ │ ├── spectrum.fs │ │ └── spectrum.vs │ ├── Spectrum3.0 │ │ ├── glad.c │ │ ├── lamp.fs │ │ ├── lamp.vs │ │ ├── main.cpp │ │ ├── spectrum.fs │ │ └── spectrum.vs │ ├── Spectrum4.0 │ │ ├── .DS_Store │ │ ├── glad.c │ │ ├── main.cpp │ │ └── shader │ │ │ ├── point.fs │ │ │ ├── point.vs │ │ │ ├── spectrum.fs │ │ │ ├── spectrum.vs │ │ │ ├── wave.fs │ │ │ └── wave.vs │ ├── Spectrum5.0 │ │ ├── glad.c │ │ ├── main.cpp │ │ ├── spectrum.fs │ │ └── spectrum.vs │ ├── Spectrum6.0 │ │ ├── glad.c │ │ ├── main.cpp │ │ ├── spectrum.fs │ │ └── spectrum.vs │ └── Test │ │ ├── .DS_Store │ │ ├── glad.c │ │ ├── main.cpp │ │ ├── spectrum.fs │ │ └── spectrum.vs ├── Test │ ├── .DS_Store │ ├── 3D_Circular │ │ ├── glad.c │ │ ├── main.cpp │ │ ├── spectrum.fs │ │ └── spectrum.vs │ ├── Circular │ │ └── main.cpp │ ├── Circular2.0 │ │ ├── glad.c │ │ ├── main.cpp │ │ ├── spectrum.fs │ │ └── spectrum.vs │ ├── PCM1.0 │ │ └── main.cpp │ ├── PCM2.0 │ │ └── main.cpp │ ├── PCM3.0 │ │ └── main.cpp │ ├── Spectrum │ │ ├── glad.c │ │ └── main.cpp │ ├── Spectrum2.0 │ │ └── main.cpp │ ├── Spectrum3.0 │ │ ├── Complex.cpp │ │ ├── Complex.h │ │ ├── FFT.cpp │ │ ├── FFT.h │ │ └── main.cpp │ ├── Test.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ ├── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ └── xcuserdata │ │ │ │ └── boone.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ └── xcuserdata │ │ │ └── boone.xcuserdatad │ │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ ├── Test │ │ ├── KHR │ │ │ └── khrplatform.h │ │ ├── glad.c │ │ ├── glad │ │ │ └── glad.h │ │ ├── main.cpp │ │ ├── spectrum.fs │ │ └── spectrum.vs │ ├── Waveform │ │ └── main.cpp │ ├── Waveform2.0 │ │ └── main.cpp │ ├── Waveform3.0 │ │ ├── 3D_Circular2.0 │ │ │ ├── .DS_Store │ │ │ ├── glad.c │ │ │ ├── main.cpp │ │ │ ├── spectrum.fs │ │ │ └── spectrum.vs │ │ └── main.cpp │ ├── Waveform4.0 │ │ └── main.cpp │ └── Waveform5.0 │ │ ├── glad.c │ │ ├── main.cpp │ │ ├── spectrum.fs │ │ └── spectrum.vs └── include │ ├── .DS_Store │ ├── GLFW │ ├── glfw3.h │ └── glfw3native.h │ ├── KHR │ └── khrplatform.h │ ├── glad │ └── glad.h │ ├── glm-0.9.6.3.rar │ └── glm │ ├── CMakeLists.txt │ ├── common.hpp │ ├── detail │ ├── _features.hpp │ ├── _fixes.hpp │ ├── _noise.hpp │ ├── _swizzle.hpp │ ├── _swizzle_func.hpp │ ├── _vectorize.hpp │ ├── dummy.cpp │ ├── func_common.hpp │ ├── func_common.inl │ ├── func_exponential.hpp │ ├── func_exponential.inl │ ├── func_geometric.hpp │ ├── func_geometric.inl │ ├── func_integer.hpp │ ├── func_integer.inl │ ├── func_matrix.hpp │ ├── func_matrix.inl │ ├── func_noise.hpp │ ├── func_noise.inl │ ├── func_packing.hpp │ ├── func_packing.inl │ ├── func_trigonometric.hpp │ ├── func_trigonometric.inl │ ├── func_vector_relational.hpp │ ├── func_vector_relational.inl │ ├── glm.cpp │ ├── intrinsic_common.hpp │ ├── intrinsic_common.inl │ ├── intrinsic_exponential.hpp │ ├── intrinsic_exponential.inl │ ├── intrinsic_geometric.hpp │ ├── intrinsic_geometric.inl │ ├── intrinsic_integer.hpp │ ├── intrinsic_integer.inl │ ├── intrinsic_matrix.hpp │ ├── intrinsic_matrix.inl │ ├── intrinsic_trigonometric.hpp │ ├── intrinsic_trigonometric.inl │ ├── intrinsic_vector_relational.hpp │ ├── intrinsic_vector_relational.inl │ ├── precision.hpp │ ├── setup.hpp │ ├── type_float.hpp │ ├── type_gentype.hpp │ ├── type_gentype.inl │ ├── type_half.hpp │ ├── type_half.inl │ ├── type_int.hpp │ ├── type_mat.hpp │ ├── type_mat.inl │ ├── type_mat2x2.hpp │ ├── type_mat2x2.inl │ ├── type_mat2x3.hpp │ ├── type_mat2x3.inl │ ├── type_mat2x4.hpp │ ├── type_mat2x4.inl │ ├── type_mat3x2.hpp │ ├── type_mat3x2.inl │ ├── type_mat3x3.hpp │ ├── type_mat3x3.inl │ ├── type_mat3x4.hpp │ ├── type_mat3x4.inl │ ├── type_mat4x2.hpp │ ├── type_mat4x2.inl │ ├── type_mat4x3.hpp │ ├── type_mat4x3.inl │ ├── type_mat4x4.hpp │ ├── type_mat4x4.inl │ ├── type_vec.hpp │ ├── type_vec.inl │ ├── type_vec1.hpp │ ├── type_vec1.inl │ ├── type_vec2.hpp │ ├── type_vec2.inl │ ├── type_vec3.hpp │ ├── type_vec3.inl │ ├── type_vec4.hpp │ ├── type_vec4.inl │ ├── type_vec4_avx.inl │ ├── type_vec4_avx2.inl │ └── type_vec4_sse2.inl │ ├── exponential.hpp │ ├── ext.hpp │ ├── fwd.hpp │ ├── geometric.hpp │ ├── glm.hpp │ ├── gtc │ ├── bitfield.hpp │ ├── bitfield.inl │ ├── constants.hpp │ ├── constants.inl │ ├── epsilon.hpp │ ├── epsilon.inl │ ├── integer.hpp │ ├── integer.inl │ ├── matrix_access.hpp │ ├── matrix_access.inl │ ├── matrix_integer.hpp │ ├── matrix_inverse.hpp │ ├── matrix_inverse.inl │ ├── matrix_transform.hpp │ ├── matrix_transform.inl │ ├── noise.hpp │ ├── noise.inl │ ├── packing.hpp │ ├── packing.inl │ ├── quaternion.hpp │ ├── quaternion.inl │ ├── random.hpp │ ├── random.inl │ ├── reciprocal.hpp │ ├── reciprocal.inl │ ├── round.hpp │ ├── round.inl │ ├── type_precision.hpp │ ├── type_precision.inl │ ├── type_ptr.hpp │ ├── type_ptr.inl │ ├── ulp.hpp │ ├── ulp.inl │ ├── vec1.hpp │ └── vec1.inl │ ├── gtx │ ├── associated_min_max.hpp │ ├── associated_min_max.inl │ ├── bit.hpp │ ├── bit.inl │ ├── closest_point.hpp │ ├── closest_point.inl │ ├── color_space.hpp │ ├── color_space.inl │ ├── color_space_YCoCg.hpp │ ├── color_space_YCoCg.inl │ ├── common.hpp │ ├── common.inl │ ├── compatibility.hpp │ ├── compatibility.inl │ ├── component_wise.hpp │ ├── component_wise.inl │ ├── dual_quaternion.hpp │ ├── dual_quaternion.inl │ ├── euler_angles.hpp │ ├── euler_angles.inl │ ├── extend.hpp │ ├── extend.inl │ ├── extented_min_max.hpp │ ├── extented_min_max.inl │ ├── fast_exponential.hpp │ ├── fast_exponential.inl │ ├── fast_square_root.hpp │ ├── fast_square_root.inl │ ├── fast_trigonometry.hpp │ ├── fast_trigonometry.inl │ ├── gradient_paint.hpp │ ├── gradient_paint.inl │ ├── handed_coordinate_space.hpp │ ├── handed_coordinate_space.inl │ ├── integer.hpp │ ├── integer.inl │ ├── intersect.hpp │ ├── intersect.inl │ ├── io.hpp │ ├── io.inl │ ├── log_base.hpp │ ├── log_base.inl │ ├── matrix_cross_product.hpp │ ├── matrix_cross_product.inl │ ├── matrix_decompose.hpp │ ├── matrix_decompose.inl │ ├── matrix_interpolation.hpp │ ├── matrix_interpolation.inl │ ├── matrix_major_storage.hpp │ ├── matrix_major_storage.inl │ ├── matrix_operation.hpp │ ├── matrix_operation.inl │ ├── matrix_query.hpp │ ├── matrix_query.inl │ ├── matrix_transform_2d.hpp │ ├── matrix_transform_2d.inl │ ├── mixed_product.hpp │ ├── mixed_product.inl │ ├── multiple.hpp │ ├── multiple.inl │ ├── norm.hpp │ ├── norm.inl │ ├── normal.hpp │ ├── normal.inl │ ├── normalize_dot.hpp │ ├── normalize_dot.inl │ ├── number_precision.hpp │ ├── number_precision.inl │ ├── optimum_pow.hpp │ ├── optimum_pow.inl │ ├── orthonormalize.hpp │ ├── orthonormalize.inl │ ├── perpendicular.hpp │ ├── perpendicular.inl │ ├── polar_coordinates.hpp │ ├── polar_coordinates.inl │ ├── projection.hpp │ ├── projection.inl │ ├── quaternion.hpp │ ├── quaternion.inl │ ├── range.hpp │ ├── raw_data.hpp │ ├── raw_data.inl │ ├── rotate_normalized_axis.hpp │ ├── rotate_normalized_axis.inl │ ├── rotate_vector.hpp │ ├── rotate_vector.inl │ ├── scalar_multiplication.hpp │ ├── scalar_relational.hpp │ ├── scalar_relational.inl │ ├── simd_mat4.hpp │ ├── simd_mat4.inl │ ├── simd_quat.hpp │ ├── simd_quat.inl │ ├── simd_vec4.hpp │ ├── simd_vec4.inl │ ├── spline.hpp │ ├── spline.inl │ ├── std_based_type.hpp │ ├── std_based_type.inl │ ├── string_cast.hpp │ ├── string_cast.inl │ ├── transform.hpp │ ├── transform.inl │ ├── transform2.hpp │ ├── transform2.inl │ ├── type_aligned.hpp │ ├── type_aligned.inl │ ├── vector_angle.hpp │ ├── vector_angle.inl │ ├── vector_query.hpp │ ├── vector_query.inl │ ├── wrap.hpp │ └── wrap.inl │ ├── integer.hpp │ ├── mat2x2.hpp │ ├── mat2x3.hpp │ ├── mat2x4.hpp │ ├── mat3x2.hpp │ ├── mat3x3.hpp │ ├── mat3x4.hpp │ ├── mat4x2.hpp │ ├── mat4x3.hpp │ ├── mat4x4.hpp │ ├── matrix.hpp │ ├── packing.hpp │ ├── trigonometric.hpp │ ├── vec2.hpp │ ├── vec3.hpp │ ├── vec4.hpp │ └── vector_relational.hpp ├── Learning_diary.docx ├── README.md ├── pic ├── .DS_Store ├── Spectrum4.0.png └── Spectrum5.0.png └── 说明文档.pages /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/.DS_Store -------------------------------------------------------------------------------- /Base/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/Base/.DS_Store -------------------------------------------------------------------------------- /Base/Mac配置文件.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/Base/Mac配置文件.zip -------------------------------------------------------------------------------- /Base/fftw3.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/Base/fftw3.zip -------------------------------------------------------------------------------- /Base/glad.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/Base/glad.zip -------------------------------------------------------------------------------- /Base/windows配置文件.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/Base/windows配置文件.zip -------------------------------------------------------------------------------- /CODE/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/.DS_Store -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Base_Light/2.1.basic_lighting.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | in vec3 Normal; 5 | in vec3 FragPos; 6 | 7 | uniform vec3 lightPos; 8 | uniform vec3 lightColor; 9 | uniform vec3 objectColor; 10 | 11 | void main() 12 | { 13 | // ambient 14 | float ambientStrength = 0.1; 15 | vec3 ambient = ambientStrength * lightColor; 16 | 17 | // diffuse 18 | vec3 norm = normalize(Normal); 19 | vec3 lightDir = normalize(lightPos - FragPos); 20 | float diff = max(dot(norm, lightDir), 0.0); 21 | vec3 diffuse = diff * lightColor; 22 | 23 | vec3 result = (ambient + diffuse) * objectColor; 24 | FragColor = vec4(result, 1.0); 25 | } -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Base_Light/2.1.basic_lighting.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | layout (location = 1) in vec3 aNormal; 4 | 5 | out vec3 FragPos; 6 | out vec3 Normal; 7 | 8 | uniform mat4 model; 9 | uniform mat4 view; 10 | uniform mat4 projection; 11 | 12 | void main() 13 | { 14 | FragPos = vec3(model * vec4(aPos, 1.0)); 15 | Normal = aNormal; 16 | 17 | gl_Position = projection * view * vec4(FragPos, 1.0); 18 | } -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Base_Light/2.1.lamp.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | void main() 5 | { 6 | FragColor = vec4(1.0); // set alle 4 vector values to 1.0 7 | } -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Base_Light/2.1.lamp.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | 4 | uniform mat4 model; 5 | uniform mat4 view; 6 | uniform mat4 projection; 7 | 8 | void main() 9 | { 10 | gl_Position = projection * view * model * vec4(aPos, 1.0); 11 | } -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Base_Light2.0/2.2.basic_lighting.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | in vec3 Normal; 5 | in vec3 FragPos; 6 | 7 | uniform vec3 lightPos; 8 | uniform vec3 viewPos; 9 | uniform vec3 lightColor; 10 | uniform vec3 objectColor; 11 | 12 | void main() 13 | { 14 | // ambient 15 | float ambientStrength = 0.1; 16 | vec3 ambient = ambientStrength * lightColor; 17 | 18 | // diffuse 19 | vec3 norm = normalize(Normal); 20 | vec3 lightDir = normalize(lightPos - FragPos); 21 | float diff = max(dot(norm, lightDir), 0.0); 22 | vec3 diffuse = diff * lightColor; 23 | 24 | // specular 25 | float specularStrength = 0.5; 26 | vec3 viewDir = normalize(viewPos - FragPos); 27 | vec3 reflectDir = reflect(-lightDir, norm); 28 | float spec = pow(max(dot(viewDir, reflectDir), 0.0), 32); 29 | vec3 specular = specularStrength * spec * lightColor; 30 | 31 | vec3 result = (ambient + diffuse + specular) * objectColor; 32 | FragColor = vec4(result, 1.0); 33 | } 34 | -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Base_Light2.0/2.2.basic_lighting.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | layout (location = 1) in vec3 aNormal; 4 | 5 | out vec3 FragPos; 6 | out vec3 Normal; 7 | 8 | uniform mat4 model; 9 | uniform mat4 view; 10 | uniform mat4 projection; 11 | 12 | void main() 13 | { 14 | FragPos = vec3(model * vec4(aPos, 1.0)); 15 | Normal = mat3(transpose(inverse(model))) * aNormal; 16 | 17 | gl_Position = projection * view * vec4(FragPos, 1.0); 18 | } 19 | -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Base_Light2.0/2.2.lamp.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | void main() 5 | { 6 | FragColor = vec4(1.0); // set alle 4 vector values to 1.0 7 | } -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Base_Light2.0/2.2.lamp.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | 4 | uniform mat4 model; 5 | uniform mat4 view; 6 | uniform mat4 projection; 7 | 8 | void main() 9 | { 10 | gl_Position = projection * view * model * vec4(aPos, 1.0); 11 | } -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Bloom/7.bloom.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) out vec4 FragColor; 3 | layout (location = 1) out vec4 BrightColor; 4 | 5 | in VS_OUT { 6 | vec3 FragPos; 7 | vec3 Normal; 8 | vec2 TexCoords; 9 | } fs_in; 10 | 11 | struct Light { 12 | vec3 Position; 13 | vec3 Color; 14 | }; 15 | 16 | uniform Light lights[4]; 17 | uniform sampler2D diffuseTexture; 18 | uniform vec3 viewPos; 19 | 20 | void main() 21 | { 22 | vec3 color = texture(diffuseTexture, fs_in.TexCoords).rgb; 23 | vec3 normal = normalize(fs_in.Normal); 24 | // ambient 25 | vec3 ambient = 0.0 * color; 26 | // lighting 27 | vec3 lighting = vec3(0.0); 28 | vec3 viewDir = normalize(viewPos - fs_in.FragPos); 29 | for(int i = 0; i < 4; i++) 30 | { 31 | // diffuse 32 | vec3 lightDir = normalize(lights[i].Position - fs_in.FragPos); 33 | float diff = max(dot(lightDir, normal), 0.0); 34 | vec3 result = lights[i].Color * diff * color; 35 | // attenuation (use quadratic as we have gamma correction) 36 | float distance = length(fs_in.FragPos - lights[i].Position); 37 | result *= 1.0 / (distance * distance); 38 | lighting += result; 39 | 40 | } 41 | vec3 result = ambient + lighting; 42 | // check whether result is higher than some threshold, if so, output as bloom threshold color 43 | float brightness = dot(result, vec3(0.2126, 0.7152, 0.0722)); 44 | if(brightness > 1.0) 45 | BrightColor = vec4(result, 1.0); 46 | else 47 | BrightColor = vec4(0.0, 0.0, 0.0, 1.0); 48 | FragColor = vec4(result, 1.0); 49 | } 50 | -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Bloom/7.bloom.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | layout (location = 1) in vec3 aNormal; 4 | layout (location = 2) in vec2 aTexCoords; 5 | 6 | out VS_OUT { 7 | vec3 FragPos; 8 | vec3 Normal; 9 | vec2 TexCoords; 10 | } vs_out; 11 | 12 | uniform mat4 projection; 13 | uniform mat4 view; 14 | uniform mat4 model; 15 | 16 | void main() 17 | { 18 | vs_out.FragPos = vec3(model * vec4(aPos, 1.0)); 19 | vs_out.TexCoords = aTexCoords; 20 | 21 | mat3 normalMatrix = transpose(inverse(mat3(model))); 22 | vs_out.Normal = normalize(normalMatrix * aNormal); 23 | 24 | gl_Position = projection * view * model * vec4(aPos, 1.0); 25 | } 26 | -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Bloom/7.bloom_final.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | in vec2 TexCoords; 5 | 6 | uniform sampler2D scene; 7 | uniform sampler2D bloomBlur; 8 | uniform bool bloom; 9 | uniform float exposure; 10 | 11 | void main() 12 | { 13 | const float gamma = 2.2; 14 | vec3 hdrColor = texture(scene, TexCoords).rgb; 15 | vec3 bloomColor = texture(bloomBlur, TexCoords).rgb; 16 | if(bloom) 17 | hdrColor += bloomColor; // additive blending 18 | // tone mapping 19 | vec3 result = vec3(1.0) - exp(-hdrColor * exposure); 20 | // also gamma correct while we're at it 21 | result = pow(result, vec3(1.0 / gamma)); 22 | FragColor = vec4(result, 1.0); 23 | } 24 | -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Bloom/7.bloom_final.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | layout (location = 1) in vec2 aTexCoords; 4 | 5 | out vec2 TexCoords; 6 | 7 | void main() 8 | { 9 | TexCoords = aTexCoords; 10 | gl_Position = vec4(aPos, 1.0); 11 | } 12 | -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Bloom/7.blur.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | in vec2 TexCoords; 5 | 6 | uniform sampler2D image; 7 | 8 | uniform bool horizontal; 9 | uniform float weight[5] = float[] (0.2270270270, 0.1945945946, 0.1216216216, 0.0540540541, 0.0162162162); 10 | 11 | void main() 12 | { 13 | vec2 tex_offset = 1.0 / textureSize(image, 0); // gets size of single texel 14 | vec3 result = texture(image, TexCoords).rgb * weight[0]; 15 | if(horizontal) 16 | { 17 | for(int i = 1; i < 5; ++i) 18 | { 19 | result += texture(image, TexCoords + vec2(tex_offset.x * i, 0.0)).rgb * weight[i]; 20 | result += texture(image, TexCoords - vec2(tex_offset.x * i, 0.0)).rgb * weight[i]; 21 | } 22 | } 23 | else 24 | { 25 | for(int i = 1; i < 5; ++i) 26 | { 27 | result += texture(image, TexCoords + vec2(0.0, tex_offset.y * i)).rgb * weight[i]; 28 | result += texture(image, TexCoords - vec2(0.0, tex_offset.y * i)).rgb * weight[i]; 29 | } 30 | } 31 | FragColor = vec4(result, 1.0); 32 | } 33 | -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Bloom/7.blur.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | layout (location = 1) in vec2 aTexCoords; 4 | 5 | out vec2 TexCoords; 6 | 7 | void main() 8 | { 9 | TexCoords = aTexCoords; 10 | gl_Position = vec4(aPos, 1.0); 11 | } 12 | -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Bloom/7.light_box.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) out vec4 FragColor; 3 | layout (location = 1) out vec4 BrightColor; 4 | 5 | in VS_OUT { 6 | vec3 FragPos; 7 | vec3 Normal; 8 | vec2 TexCoords; 9 | } fs_in; 10 | 11 | uniform vec3 lightColor; 12 | 13 | void main() 14 | { 15 | FragColor = vec4(lightColor, 1.0); 16 | float brightness = dot(FragColor.rgb, vec3(0.2126, 0.7152, 0.0722)); 17 | if(brightness > 1.0) 18 | BrightColor = vec4(FragColor.rgb, 1.0); 19 | } 20 | -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Debugging/debugging.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | in vec2 TexCoords; 4 | 5 | uniform sampler2D tex; 6 | 7 | void main() 8 | { 9 | FragColor = texture(tex, TexCoords); 10 | } -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Debugging/debugging.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 position; 3 | layout (location = 1) in vec2 texCoords; 4 | 5 | uniform mat4 projection; 6 | uniform mat4 model; 7 | 8 | out vec2 TexCoords; 9 | 10 | void main() 11 | { 12 | gl_Position = projection * model * vec4(position, 1.0f); 13 | TexCoords = texCoords; 14 | } -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/GLSL/shader/8.advanced_glsl.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | 4 | layout (std140) uniform Matrices 5 | { 6 | mat4 projection; 7 | mat4 view; 8 | }; 9 | uniform mat4 model; 10 | 11 | void main() 12 | { 13 | gl_Position = projection * view * model * vec4(aPos, 1.0); 14 | } -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/GLSL/shader/8.blue.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | void main() 5 | { 6 | FragColor = vec4(0.0, 0.0, 1.0, 1.0); 7 | } -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/GLSL/shader/8.green.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | void main() 5 | { 6 | FragColor = vec4(0.0, 1.0, 0.0, 1.0); 7 | } -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/GLSL/shader/8.red.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | void main() 5 | { 6 | FragColor = vec4(1.0, 0.0, 0.0, 1.0); 7 | } -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/GLSL/shader/8.yellow.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | void main() 5 | { 6 | FragColor = vec4(1.0, 1.0, 0.0, 1.0); 7 | } -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/GeometryShader/9.1.geometry_shader.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | in vec3 fColor; 5 | 6 | void main() 7 | { 8 | FragColor = vec4(fColor, 1.0); 9 | } -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/GeometryShader/9.1.geometry_shader.gs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (points) in; 3 | layout (triangle_strip, max_vertices = 5) out; 4 | 5 | in VS_OUT { 6 | vec3 color; 7 | } gs_in[]; 8 | 9 | out vec3 fColor; 10 | 11 | void build_house(vec4 position) 12 | { 13 | fColor = gs_in[0].color; // gs_in[0] since there's only one input vertex 14 | gl_Position = position + vec4(-0.2, -0.2, 0.0, 0.0); // 1:bottom-left 15 | EmitVertex(); 16 | gl_Position = position + vec4( 0.2, -0.2, 0.0, 0.0); // 2:bottom-right 17 | EmitVertex(); 18 | gl_Position = position + vec4(-0.2, 0.2, 0.0, 0.0); // 3:top-left 19 | EmitVertex(); 20 | gl_Position = position + vec4( 0.2, 0.2, 0.0, 0.0); // 4:top-right 21 | EmitVertex(); 22 | gl_Position = position + vec4( 0.0, 0.4, 0.0, 0.0); // 5:top 23 | fColor = vec3(1.0, 1.0, 1.0); 24 | EmitVertex(); 25 | EndPrimitive(); 26 | } 27 | 28 | void main() { 29 | build_house(gl_in[0].gl_Position); 30 | } -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/GeometryShader/9.1.geometry_shader.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec2 aPos; 3 | layout (location = 1) in vec3 aColor; 4 | 5 | out VS_OUT { 6 | vec3 color; 7 | } vs_out; 8 | 9 | void main() 10 | { 11 | vs_out.color = aColor; 12 | gl_Position = vec4(aPos.x, aPos.y, 0.0, 1.0); 13 | } -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/HDR/6.hdr.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | in vec2 TexCoords; 5 | 6 | uniform sampler2D hdrBuffer; 7 | uniform bool hdr; 8 | uniform float exposure; 9 | 10 | void main() 11 | { 12 | const float gamma = 2.2; 13 | vec3 hdrColor = texture(hdrBuffer, TexCoords).rgb; 14 | if(hdr) 15 | { 16 | // reinhard 17 | // vec3 result = hdrColor / (hdrColor + vec3(1.0)); 18 | // exposure 19 | vec3 result = vec3(1.0) - exp(-hdrColor * exposure); 20 | // also gamma correct while we're at it 21 | result = pow(result, vec3(1.0 / gamma)); 22 | FragColor = vec4(result, 1.0); 23 | } 24 | else 25 | { 26 | vec3 result = pow(hdrColor, vec3(1.0 / gamma)); 27 | FragColor = vec4(result, 1.0); 28 | } 29 | } -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/HDR/6.hdr.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | in vec2 TexCoords; 5 | 6 | uniform sampler2D hdrBuffer; 7 | uniform bool hdr; 8 | uniform float exposure; 9 | 10 | void main() 11 | { 12 | const float gamma = 2.2; 13 | vec3 hdrColor = texture(hdrBuffer, TexCoords).rgb; 14 | if(hdr) 15 | { 16 | // reinhard 17 | // vec3 result = hdrColor / (hdrColor + vec3(1.0)); 18 | // exposure 19 | vec3 result = vec3(1.0) - exp(-hdrColor * exposure); 20 | // also gamma correct while we're at it 21 | result = pow(result, vec3(1.0 / gamma)); 22 | FragColor = vec4(result, 1.0); 23 | } 24 | else 25 | { 26 | vec3 result = pow(hdrColor, vec3(1.0 / gamma)); 27 | FragColor = vec4(result, 1.0); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/HDR/6.lighting.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | in VS_OUT { 5 | vec3 FragPos; 6 | vec3 Normal; 7 | vec2 TexCoords; 8 | } fs_in; 9 | 10 | struct Light { 11 | vec3 Position; 12 | vec3 Color; 13 | }; 14 | 15 | uniform Light lights[16]; 16 | uniform sampler2D diffuseTexture; 17 | uniform vec3 viewPos; 18 | 19 | void main() 20 | { 21 | vec3 color = texture(diffuseTexture, fs_in.TexCoords).rgb; 22 | vec3 normal = normalize(fs_in.Normal); 23 | // ambient 24 | vec3 ambient = 0.0 * color; 25 | // lighting 26 | vec3 lighting = vec3(0.0); 27 | for(int i = 0; i < 16; i++) 28 | { 29 | // diffuse 30 | vec3 lightDir = normalize(lights[i].Position - fs_in.FragPos); 31 | float diff = max(dot(lightDir, normal), 0.0); 32 | vec3 diffuse = lights[i].Color * diff * color; 33 | vec3 result = diffuse; 34 | // attenuation (use quadratic as we have gamma correction) 35 | float distance = length(fs_in.FragPos - lights[i].Position); 36 | result *= 1.0 / (distance * distance); 37 | lighting += result; 38 | 39 | } 40 | FragColor = vec4(ambient + lighting, 1.0); 41 | } 42 | -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/HDR/6.lighting.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | in VS_OUT { 5 | vec3 FragPos; 6 | vec3 Normal; 7 | vec2 TexCoords; 8 | } fs_in; 9 | 10 | struct Light { 11 | vec3 Position; 12 | vec3 Color; 13 | }; 14 | 15 | uniform Light lights[16]; 16 | uniform sampler2D diffuseTexture; 17 | uniform vec3 viewPos; 18 | 19 | void main() 20 | { 21 | vec3 color = texture(diffuseTexture, fs_in.TexCoords).rgb; 22 | vec3 normal = normalize(fs_in.Normal); 23 | // ambient 24 | vec3 ambient = 0.0 * color; 25 | // lighting 26 | vec3 lighting = vec3(0.0); 27 | for(int i = 0; i < 16; i++) 28 | { 29 | // diffuse 30 | vec3 lightDir = normalize(lights[i].Position - fs_in.FragPos); 31 | float diff = max(dot(lightDir, normal), 0.0); 32 | vec3 diffuse = lights[i].Color * diff * color; 33 | vec3 result = diffuse; 34 | // attenuation (use quadratic as we have gamma correction) 35 | float distance = length(fs_in.FragPos - lights[i].Position); 36 | result *= 1.0 / (distance * distance); 37 | lighting += result; 38 | 39 | } 40 | FragColor = vec4(ambient + lighting, 1.0); 41 | } 42 | -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Instancing/10.1.instancing.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | in vec3 fColor; 5 | 6 | void main() 7 | { 8 | FragColor = vec4(fColor, 1.0); 9 | } 10 | -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Instancing/10.1.instancing.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec2 aPos; 3 | layout (location = 1) in vec3 aColor; 4 | layout (location = 2) in vec2 aOffset; 5 | 6 | out vec3 fColor; 7 | 8 | void main() 9 | { 10 | vec2 pos = aPos * (gl_InstanceID / 100.0); 11 | gl_Position = vec4(pos + aOffset, 0.0, 1.0); 12 | fColor = aColor; 13 | } 14 | -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Learning_OpenGL.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Learning_OpenGL.xcodeproj/project.xcworkspace/xcuserdata/boone.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/Learning_OpenGL/Learning_OpenGL.xcodeproj/project.xcworkspace/xcuserdata/boone.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Learning_OpenGL.xcodeproj/xcuserdata/boone.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Learning_OpenGL/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/Learning_OpenGL/Learning_OpenGL/.DS_Store -------------------------------------------------------------------------------- /CODE/Learning_OpenGL/Learning_OpenGL/main.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // main.cpp 3 | // Learning_OpenGL 4 | // 5 | // Created by boone on 2018/7/30. 6 | // Copyright © 2018年 boone. All rights reserved. 7 | // 8 | 9 | #include 10 | 11 | #include 12 | 13 | using namespace std; 14 | 15 | #define N 10 16 | 17 | int main() 18 | { 19 | int i; 20 | fftw_complex *in,*out; 21 | fftw_plan p; 22 | in = (fftw_complex*)fftw_malloc(sizeof(fftw_complex)*N); 23 | out = (fftw_complex*)fftw_malloc(sizeof(fftw_complex)*N); 24 | if (in==NULL||out==NULL) { 25 | cout<<"ERROR: Fail to memory allocation"< 10 | #include 11 | 12 | #include 13 | 14 | using namespace std; 15 | 16 | #define N 99 17 | 18 | int main() 19 | { 20 | int i; 21 | fftw_complex *in,*out; 22 | fftw_plan p; 23 | in = (fftw_complex*)fftw_malloc(sizeof(fftw_complex)*N); 24 | out = (fftw_complex*)fftw_malloc(sizeof(fftw_complex)*N); 25 | if (in==NULL||out==NULL) { 26 | cout<<"ERROR: Fail to memory allocation"< 10 | 11 | #include 12 | 13 | using namespace std; 14 | 15 | const unsigned int WID =700; 16 | 17 | const unsigned int HEI = 700; 18 | 19 | 20 | void frame_buffer_size_callback(GLFWwindow* window, int width, int height){ 21 | glViewport(0, 0, width, height); 22 | } 23 | 24 | void pressInput(GLFWwindow* window){ 25 | if(glfwGetKey(window, GLFW_KEY_ESCAPE)==GLFW_PRESS) 26 | glfwSetWindowShouldClose(window,true); 27 | } 28 | 29 | int main(){ 30 | //初始化窗口 31 | glfwInit(); 32 | glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); 33 | glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); 34 | glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); 35 | 36 | //此行用以兼容Mac OS X系统 37 | glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, true); 38 | 39 | //创建窗口对象 40 | GLFWwindow * win =glfwCreateWindow(WID, HEI, "Xiaobooo's test windows!", NULL, NULL); 41 | if(win == NULL){ 42 | cout<<"Fail to Create the windows"< 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CODE/OpenGL/OpenGL.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CODE/OpenGL/OpenGL.xcodeproj/project.xcworkspace/xcuserdata/boone.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/OpenGL/OpenGL.xcodeproj/project.xcworkspace/xcuserdata/boone.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /CODE/OpenGL/OpenGL.xcodeproj/xcuserdata/boone.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /CODE/OpenGL/OpenGL.xcodeproj/xcuserdata/boone.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | FirstWindow.xcscheme 8 | 9 | orderHint 10 | 1 11 | 12 | OpenGL.xcscheme 13 | 14 | orderHint 15 | 0 16 | 17 | Shader.xcscheme 18 | 19 | orderHint 20 | 2 21 | 22 | Texture.xcscheme 23 | 24 | orderHint 25 | 4 26 | 27 | Texture2.0.xcscheme 28 | 29 | orderHint 30 | 4 31 | 32 | Texture3.0.xcscheme 33 | 34 | orderHint 35 | 6 36 | 37 | Transform.xcscheme 38 | 39 | orderHint 40 | 5 41 | 42 | Triangle.xcscheme 43 | 44 | orderHint 45 | 3 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /CODE/OpenGL/Texture2.0/4.2.texture.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | in vec3 ourColor; 5 | in vec2 TexCoord; 6 | 7 | // texture samplers 8 | uniform sampler2D texture1; 9 | uniform sampler2D texture2; 10 | 11 | void main() 12 | { 13 | // linearly interpolate between both textures (80% container, 20% awesomeface) 14 | FragColor = mix(texture(texture1, TexCoord), texture(texture2, TexCoord), 0.2); 15 | } -------------------------------------------------------------------------------- /CODE/OpenGL/Texture2.0/4.2.texture.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | layout (location = 1) in vec3 aColor; 4 | layout (location = 2) in vec2 aTexCoord; 5 | 6 | out vec3 ourColor; 7 | out vec2 TexCoord; 8 | 9 | void main() 10 | { 11 | gl_Position = vec4(aPos, 1.0); 12 | ourColor = aColor; 13 | TexCoord = vec2(aTexCoord.x, aTexCoord.y); 14 | } -------------------------------------------------------------------------------- /CODE/OpenGL/Texture2.0/awesomeface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/OpenGL/Texture2.0/awesomeface.png -------------------------------------------------------------------------------- /CODE/OpenGL/Texture2.0/container.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/OpenGL/Texture2.0/container.jpg -------------------------------------------------------------------------------- /CODE/OpenGL/Texture3.0/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/OpenGL/Texture3.0/.DS_Store -------------------------------------------------------------------------------- /CODE/OpenGL/Texture3.0/image/awesomeface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/OpenGL/Texture3.0/image/awesomeface.png -------------------------------------------------------------------------------- /CODE/OpenGL/Texture3.0/image/container.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/OpenGL/Texture3.0/image/container.jpg -------------------------------------------------------------------------------- /CODE/OpenGL/Texture3.0/shader/4.3.texture.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | in vec3 ourColor; 5 | in vec2 TexCoord; 6 | 7 | // texture samplers 8 | uniform sampler2D texture1; 9 | uniform sampler2D texture2; 10 | 11 | void main() 12 | { 13 | // linearly interpolate between both textures (80% container, 20% awesomeface) 14 | FragColor = mix(texture(texture1, TexCoord), texture(texture2, TexCoord), 0.2); 15 | } -------------------------------------------------------------------------------- /CODE/OpenGL/Texture3.0/shader/4.3.texture.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | layout (location = 1) in vec3 aColor; 4 | layout (location = 2) in vec2 aTexCoord; 5 | 6 | out vec3 ourColor; 7 | out vec2 TexCoord; 8 | 9 | void main() 10 | { 11 | gl_Position = vec4(aPos, 1.0); 12 | ourColor = aColor; 13 | TexCoord = vec2(aTexCoord.x, aTexCoord.y); 14 | } -------------------------------------------------------------------------------- /CODE/OpenGL/Transform/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/OpenGL/Transform/.DS_Store -------------------------------------------------------------------------------- /CODE/OpenGL/Transform/5.1.transform.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | in vec2 TexCoord; 5 | 6 | // texture samplers 7 | uniform sampler2D texture1; 8 | uniform sampler2D texture2; 9 | 10 | void main() 11 | { 12 | // linearly interpolate between both textures (80% container, 20% awesomeface) 13 | FragColor = mix(texture(texture1, TexCoord), texture(texture2, TexCoord), 0.2); 14 | } -------------------------------------------------------------------------------- /CODE/OpenGL/Transform/5.1.transform.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | layout (location = 1) in vec2 aTexCoord; 4 | 5 | out vec2 TexCoord; 6 | 7 | uniform mat4 transform; 8 | 9 | void main() 10 | { 11 | gl_Position = transform * vec4(aPos, 1.0); 12 | TexCoord = vec2(aTexCoord.x, aTexCoord.y); 13 | } -------------------------------------------------------------------------------- /CODE/OpenGL/Transform/image/awesomeface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/OpenGL/Transform/image/awesomeface.png -------------------------------------------------------------------------------- /CODE/OpenGL/Transform/image/container.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/OpenGL/Transform/image/container.jpg -------------------------------------------------------------------------------- /CODE/Spectrum/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/Spectrum/.DS_Store -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum.xcodeproj/project.xcworkspace/xcuserdata/boone.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/Spectrum/Spectrum.xcodeproj/project.xcworkspace/xcuserdata/boone.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum.xcodeproj/xcuserdata/boone.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum.xcodeproj/xcuserdata/boone.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | LightSpectrum.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | LightSpectrum2.0.xcscheme 13 | 14 | orderHint 15 | 3 16 | 17 | Soectrum6.0.xcscheme 18 | 19 | orderHint 20 | 6 21 | 22 | Spectrum.xcscheme 23 | 24 | orderHint 25 | 0 26 | 27 | Spectrum2.0.xcscheme 28 | 29 | orderHint 30 | 1 31 | 32 | Spectrum3.0.xcscheme 33 | 34 | orderHint 35 | 3 36 | 37 | Spectrum4.0.xcscheme 38 | 39 | orderHint 40 | 4 41 | 42 | Spectrum5.0.xcscheme 43 | 44 | orderHint 45 | 5 46 | 47 | Spectrum6.0.xcscheme 48 | 49 | orderHint 50 | 6 51 | 52 | Test.xcscheme 53 | 54 | orderHint 55 | 2 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum2.0/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/Spectrum/Spectrum2.0/.DS_Store -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum2.0/spectrum.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | uniform vec4 ourColor; // 在OpenGL程序代码中设定这个变量 5 | 6 | void main() 7 | { 8 | FragColor = ourColor*vec4(1.0,1.0,1.0,0.5); 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum2.0/spectrum.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | 4 | void main() 5 | { 6 | gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); 7 | } 8 | -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum3.0/lamp.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | void main() 5 | { 6 | FragColor = vec4(0.8,0.6,0.3,1.0); // set alle 4 vector values to 1.0 7 | } 8 | -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum3.0/lamp.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | 4 | uniform mat4 model; 5 | uniform mat4 view; 6 | uniform mat4 projection; 7 | 8 | void main() 9 | { 10 | gl_Position = projection * view * model * vec4(aPos, 1.0); 11 | } -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum3.0/spectrum.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | 3 | out vec4 FragColor; 4 | 5 | uniform vec4 ourColor; 6 | 7 | uniform float u_hue=121.0; 8 | uniform float u_saturation=0.82; 9 | uniform float u_value=1.0; 10 | uniform float u_contrast=0.0; 11 | 12 | vec3 rgbtohsv(vec3 rgb) 13 | { 14 | float R = rgb.x; 15 | float G = rgb.y; 16 | float B = rgb.z; 17 | vec3 hsv; 18 | float max1 = max(R, max(G, B)); 19 | float min1 = min(R, min(G, B)); 20 | if (R == max1) 21 | { 22 | hsv.x = (G - B) / (max1 - min1); 23 | } 24 | if (G == max1) 25 | { 26 | hsv.x = 2.0 + (B - R) / (max1 - min1); 27 | } 28 | if (B == max1) 29 | { 30 | hsv.x = 4.0 + (R - G) / (max1 - min1); 31 | } 32 | hsv.x = hsv.x * 60.0; 33 | if (hsv.x < 0.0) 34 | { 35 | hsv.x = hsv.x + 360.0; 36 | } 37 | hsv.z = max1; 38 | hsv.y = (max1 - min1) / max1; 39 | return hsv; 40 | } 41 | vec3 hsvtorgb(vec3 hsv) 42 | { 43 | float R; 44 | float G; 45 | float B; 46 | if (hsv.y == 0.0) 47 | { 48 | R = G = B = hsv.z; 49 | } 50 | else 51 | { 52 | hsv.x = hsv.x / 60.0; 53 | int i = int(hsv.x); 54 | float f = hsv.x - float(i); 55 | float a = hsv.z * (1.0 - hsv.y); 56 | float b = hsv.z * (1.0 - hsv.y * f); 57 | float c = hsv.z * (1.0 - hsv.y * (1.0 - f)); 58 | if (i == 0) 59 | { 60 | R = hsv.z; 61 | G = c; 62 | B = a; 63 | } 64 | else if (i == 1) 65 | { 66 | R = b; 67 | G = hsv.z; 68 | B = a; 69 | } 70 | else if (i == 2) 71 | { 72 | R = a; 73 | G = hsv.z; 74 | B = c; 75 | } 76 | else if (i == 3) 77 | { 78 | R = a; 79 | G = b; 80 | B = hsv.z; 81 | } 82 | else if (i == 4) 83 | { 84 | R = c; 85 | G = a; 86 | B = hsv.z; 87 | } 88 | else 89 | { 90 | R = hsv.z; 91 | G = a; 92 | B = b; 93 | } 94 | } 95 | return vec3(R, G, B); 96 | } 97 | void main() 98 | { 99 | 100 | vec4 pixColor = ourColor; 101 | vec3 hsv; 102 | hsv.xyz = rgbtohsv(pixColor.rgb); 103 | hsv.x += u_hue; 104 | hsv.x = mod(hsv.x, 360.0); 105 | hsv.y *= u_saturation; 106 | hsv.z *= u_value; 107 | vec3 f_color = hsvtorgb(hsv); 108 | f_color = ((f_color - 0.5) * max(u_contrast+1.0, 0.0)) + 0.5; 109 | 110 | FragColor = vec4(f_color, pixColor.a); 111 | 112 | //FragColor = ourColor*vec4(1.0,1.0,1.0,0.5); 113 | } 114 | 115 | -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum3.0/spectrum.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | 4 | void main() 5 | { 6 | gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); 7 | } 8 | 9 | -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum4.0/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/Spectrum/Spectrum4.0/.DS_Store -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum4.0/shader/point.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | 3 | out vec4 FragColor; 4 | 5 | uniform vec4 ourColor; 6 | 7 | uniform float u_hue=0.0; 8 | uniform float u_saturation=1.0; 9 | uniform float u_value=1.0; 10 | uniform float u_contrast=0.0; 11 | 12 | vec3 rgbtohsv(vec3 rgb) 13 | { 14 | float R = rgb.x; 15 | float G = rgb.y; 16 | float B = rgb.z; 17 | vec3 hsv; 18 | float max1 = max(R, max(G, B)); 19 | float min1 = min(R, min(G, B)); 20 | if (R == max1) 21 | { 22 | hsv.x = (G - B) / (max1 - min1); 23 | } 24 | if (G == max1) 25 | { 26 | hsv.x = 2.0 + (B - R) / (max1 - min1); 27 | } 28 | if (B == max1) 29 | { 30 | hsv.x = 4.0 + (R - G) / (max1 - min1); 31 | } 32 | hsv.x = hsv.x * 60.0; 33 | if (hsv.x < 0.0) 34 | { 35 | hsv.x = hsv.x + 360.0; 36 | } 37 | hsv.z = max1; 38 | hsv.y = (max1 - min1) / max1; 39 | return hsv; 40 | } 41 | vec3 hsvtorgb(vec3 hsv) 42 | { 43 | float R; 44 | float G; 45 | float B; 46 | if (hsv.y == 0.0) 47 | { 48 | R = G = B = hsv.z; 49 | } 50 | else 51 | { 52 | hsv.x = hsv.x / 60.0; 53 | int i = int(hsv.x); 54 | float f = hsv.x - float(i); 55 | float a = hsv.z * (1.0 - hsv.y); 56 | float b = hsv.z * (1.0 - hsv.y * f); 57 | float c = hsv.z * (1.0 - hsv.y * (1.0 - f)); 58 | if (i == 0) 59 | { 60 | R = hsv.z; 61 | G = c; 62 | B = a; 63 | } 64 | else if (i == 1) 65 | { 66 | R = b; 67 | G = hsv.z; 68 | B = a; 69 | } 70 | else if (i == 2) 71 | { 72 | R = a; 73 | G = hsv.z; 74 | B = c; 75 | } 76 | else if (i == 3) 77 | { 78 | R = a; 79 | G = b; 80 | B = hsv.z; 81 | } 82 | else if (i == 4) 83 | { 84 | R = c; 85 | G = a; 86 | B = hsv.z; 87 | } 88 | else 89 | { 90 | R = hsv.z; 91 | G = a; 92 | B = b; 93 | } 94 | } 95 | return vec3(R, G, B); 96 | } 97 | void main() 98 | { 99 | 100 | vec4 pixColor = ourColor; 101 | vec3 hsv; 102 | hsv.xyz = rgbtohsv(pixColor.rgb); 103 | hsv.x += u_hue; 104 | hsv.x = mod(hsv.x, 360.0); 105 | hsv.y *= u_saturation; 106 | hsv.z *= u_value; 107 | vec3 f_color = hsvtorgb(hsv); 108 | f_color = ((f_color - 0.5) * max(u_contrast+1.0, 0.0)) + 0.5; 109 | 110 | FragColor = vec4(f_color, pixColor.a); 111 | 112 | //FragColor = ourColor*vec4(1.0,1.0,1.0,0.5); 113 | } 114 | 115 | -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum4.0/shader/point.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | 4 | void main() 5 | { 6 | gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); 7 | } 8 | 9 | -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum4.0/shader/spectrum.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | 3 | out vec4 FragColor; 4 | 5 | uniform vec4 ourColor; 6 | 7 | uniform float u_hue=121.0; 8 | uniform float u_saturation=0.82; 9 | uniform float u_value=1.0; 10 | uniform float u_contrast=0.0; 11 | 12 | vec3 rgbtohsv(vec3 rgb) 13 | { 14 | float R = rgb.x; 15 | float G = rgb.y; 16 | float B = rgb.z; 17 | vec3 hsv; 18 | float max1 = max(R, max(G, B)); 19 | float min1 = min(R, min(G, B)); 20 | if (R == max1) 21 | { 22 | hsv.x = (G - B) / (max1 - min1); 23 | } 24 | if (G == max1) 25 | { 26 | hsv.x = 2.0 + (B - R) / (max1 - min1); 27 | } 28 | if (B == max1) 29 | { 30 | hsv.x = 4.0 + (R - G) / (max1 - min1); 31 | } 32 | hsv.x = hsv.x * 60.0; 33 | if (hsv.x < 0.0) 34 | { 35 | hsv.x = hsv.x + 360.0; 36 | } 37 | hsv.z = max1; 38 | hsv.y = (max1 - min1) / max1; 39 | return hsv; 40 | } 41 | vec3 hsvtorgb(vec3 hsv) 42 | { 43 | float R; 44 | float G; 45 | float B; 46 | if (hsv.y == 0.0) 47 | { 48 | R = G = B = hsv.z; 49 | } 50 | else 51 | { 52 | hsv.x = hsv.x / 60.0; 53 | int i = int(hsv.x); 54 | float f = hsv.x - float(i); 55 | float a = hsv.z * (1.0 - hsv.y); 56 | float b = hsv.z * (1.0 - hsv.y * f); 57 | float c = hsv.z * (1.0 - hsv.y * (1.0 - f)); 58 | if (i == 0) 59 | { 60 | R = hsv.z; 61 | G = c; 62 | B = a; 63 | } 64 | else if (i == 1) 65 | { 66 | R = b; 67 | G = hsv.z; 68 | B = a; 69 | } 70 | else if (i == 2) 71 | { 72 | R = a; 73 | G = hsv.z; 74 | B = c; 75 | } 76 | else if (i == 3) 77 | { 78 | R = a; 79 | G = b; 80 | B = hsv.z; 81 | } 82 | else if (i == 4) 83 | { 84 | R = c; 85 | G = a; 86 | B = hsv.z; 87 | } 88 | else 89 | { 90 | R = hsv.z; 91 | G = a; 92 | B = b; 93 | } 94 | } 95 | return vec3(R, G, B); 96 | } 97 | void main() 98 | { 99 | 100 | vec4 pixColor = ourColor; 101 | vec3 hsv; 102 | hsv.xyz = rgbtohsv(pixColor.rgb); 103 | hsv.x += u_hue; 104 | hsv.x = mod(hsv.x, 360.0); 105 | hsv.y *= u_saturation; 106 | hsv.z *= u_value; 107 | vec3 f_color = hsvtorgb(hsv); 108 | f_color = ((f_color - 0.5) * max(u_contrast+1.0, 0.0)) + 0.5; 109 | 110 | FragColor = vec4(f_color, pixColor.a); 111 | 112 | //FragColor = ourColor*vec4(1.0,1.0,1.0,0.5); 113 | } 114 | 115 | -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum4.0/shader/spectrum.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | 4 | void main() 5 | { 6 | gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); 7 | } 8 | 9 | -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum4.0/shader/wave.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | 3 | out vec4 FragColor; 4 | 5 | uniform vec4 ourColor; 6 | 7 | uniform float u_hue=0.0; 8 | uniform float u_saturation=1.0; 9 | uniform float u_value=1.0; 10 | uniform float u_contrast=0.0; 11 | 12 | vec3 rgbtohsv(vec3 rgb) 13 | { 14 | float R = rgb.x; 15 | float G = rgb.y; 16 | float B = rgb.z; 17 | vec3 hsv; 18 | float max1 = max(R, max(G, B)); 19 | float min1 = min(R, min(G, B)); 20 | if (R == max1) 21 | { 22 | hsv.x = (G - B) / (max1 - min1); 23 | } 24 | if (G == max1) 25 | { 26 | hsv.x = 2.0 + (B - R) / (max1 - min1); 27 | } 28 | if (B == max1) 29 | { 30 | hsv.x = 4.0 + (R - G) / (max1 - min1); 31 | } 32 | hsv.x = hsv.x * 60.0; 33 | if (hsv.x < 0.0) 34 | { 35 | hsv.x = hsv.x + 360.0; 36 | } 37 | hsv.z = max1; 38 | hsv.y = (max1 - min1) / max1; 39 | return hsv; 40 | } 41 | vec3 hsvtorgb(vec3 hsv) 42 | { 43 | float R; 44 | float G; 45 | float B; 46 | if (hsv.y == 0.0) 47 | { 48 | R = G = B = hsv.z; 49 | } 50 | else 51 | { 52 | hsv.x = hsv.x / 60.0; 53 | int i = int(hsv.x); 54 | float f = hsv.x - float(i); 55 | float a = hsv.z * (1.0 - hsv.y); 56 | float b = hsv.z * (1.0 - hsv.y * f); 57 | float c = hsv.z * (1.0 - hsv.y * (1.0 - f)); 58 | if (i == 0) 59 | { 60 | R = hsv.z; 61 | G = c; 62 | B = a; 63 | } 64 | else if (i == 1) 65 | { 66 | R = b; 67 | G = hsv.z; 68 | B = a; 69 | } 70 | else if (i == 2) 71 | { 72 | R = a; 73 | G = hsv.z; 74 | B = c; 75 | } 76 | else if (i == 3) 77 | { 78 | R = a; 79 | G = b; 80 | B = hsv.z; 81 | } 82 | else if (i == 4) 83 | { 84 | R = c; 85 | G = a; 86 | B = hsv.z; 87 | } 88 | else 89 | { 90 | R = hsv.z; 91 | G = a; 92 | B = b; 93 | } 94 | } 95 | return vec3(R, G, B); 96 | } 97 | void main() 98 | { 99 | 100 | vec4 pixColor = ourColor; 101 | vec3 hsv; 102 | hsv.xyz = rgbtohsv(pixColor.rgb); 103 | hsv.x += u_hue; 104 | hsv.x = mod(hsv.x, 360.0); 105 | hsv.y *= u_saturation; 106 | hsv.z *= u_value; 107 | vec3 f_color = hsvtorgb(hsv); 108 | f_color = ((f_color - 0.5) * max(u_contrast+1.0, 0.0)) + 0.5; 109 | 110 | FragColor = vec4(f_color, pixColor.a); 111 | 112 | //FragColor = ourColor*vec4(1.0,1.0,1.0,0.5); 113 | } 114 | 115 | -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum4.0/shader/wave.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | 4 | void main() 5 | { 6 | gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); 7 | } 8 | 9 | -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum5.0/spectrum.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | 3 | out vec4 FragColor; 4 | 5 | uniform vec4 ourColor; 6 | 7 | uniform float u_hue=0.0; 8 | uniform float u_saturation=1.0; 9 | uniform float u_value=1.0; 10 | uniform float u_contrast=0.0; 11 | 12 | vec3 rgbtohsv(vec3 rgb) 13 | { 14 | float R = rgb.x; 15 | float G = rgb.y; 16 | float B = rgb.z; 17 | vec3 hsv; 18 | float max1 = max(R, max(G, B)); 19 | float min1 = min(R, min(G, B)); 20 | if (R == max1) 21 | { 22 | hsv.x = (G - B) / (max1 - min1); 23 | } 24 | if (G == max1) 25 | { 26 | hsv.x = 2.0 + (B - R) / (max1 - min1); 27 | } 28 | if (B == max1) 29 | { 30 | hsv.x = 4.0 + (R - G) / (max1 - min1); 31 | } 32 | hsv.x = hsv.x * 60.0; 33 | if (hsv.x < 0.0) 34 | { 35 | hsv.x = hsv.x + 360.0; 36 | } 37 | hsv.z = max1; 38 | hsv.y = (max1 - min1) / max1; 39 | return hsv; 40 | } 41 | vec3 hsvtorgb(vec3 hsv) 42 | { 43 | float R; 44 | float G; 45 | float B; 46 | if (hsv.y == 0.0) 47 | { 48 | R = G = B = hsv.z; 49 | } 50 | else 51 | { 52 | hsv.x = hsv.x / 60.0; 53 | int i = int(hsv.x); 54 | float f = hsv.x - float(i); 55 | float a = hsv.z * (1.0 - hsv.y); 56 | float b = hsv.z * (1.0 - hsv.y * f); 57 | float c = hsv.z * (1.0 - hsv.y * (1.0 - f)); 58 | if (i == 0) 59 | { 60 | R = hsv.z; 61 | G = c; 62 | B = a; 63 | } 64 | else if (i == 1) 65 | { 66 | R = b; 67 | G = hsv.z; 68 | B = a; 69 | } 70 | else if (i == 2) 71 | { 72 | R = a; 73 | G = hsv.z; 74 | B = c; 75 | } 76 | else if (i == 3) 77 | { 78 | R = a; 79 | G = b; 80 | B = hsv.z; 81 | } 82 | else if (i == 4) 83 | { 84 | R = c; 85 | G = a; 86 | B = hsv.z; 87 | } 88 | else 89 | { 90 | R = hsv.z; 91 | G = a; 92 | B = b; 93 | } 94 | } 95 | return vec3(R, G, B); 96 | } 97 | void main() 98 | { 99 | 100 | vec4 pixColor = ourColor; 101 | vec3 hsv; 102 | hsv.xyz = rgbtohsv(pixColor.rgb); 103 | hsv.x += u_hue; 104 | hsv.x = mod(hsv.x, 360.0); 105 | hsv.y *= u_saturation; 106 | hsv.z *= u_value; 107 | vec3 f_color = hsvtorgb(hsv); 108 | f_color = ((f_color - 0.5) * max(u_contrast+1.0, 0.0)) + 0.5; 109 | 110 | FragColor = vec4(f_color, pixColor.a); 111 | 112 | //FragColor = ourColor*vec4(1.0,1.0,1.0,0.5); 113 | } 114 | 115 | -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum5.0/spectrum.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | 4 | void main() 5 | { 6 | gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); 7 | } 8 | 9 | -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum6.0/spectrum.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | 3 | out vec4 FragColor; 4 | 5 | uniform vec4 ourColor; 6 | 7 | uniform float u_hue=121.0; 8 | uniform float u_saturation=2.0; 9 | uniform float u_value=1.0; 10 | uniform float u_contrast=1.0; 11 | 12 | vec3 rgbtohsv(vec3 rgb) 13 | { 14 | float R = rgb.x; 15 | float G = rgb.y; 16 | float B = rgb.z; 17 | vec3 hsv; 18 | float max1 = max(R, max(G, B)); 19 | float min1 = min(R, min(G, B)); 20 | if (R == max1) 21 | { 22 | hsv.x = (G - B) / (max1 - min1); 23 | } 24 | if (G == max1) 25 | { 26 | hsv.x = 2.0 + (B - R) / (max1 - min1); 27 | } 28 | if (B == max1) 29 | { 30 | hsv.x = 4.0 + (R - G) / (max1 - min1); 31 | } 32 | hsv.x = hsv.x * 60.0; 33 | if (hsv.x < 0.0) 34 | { 35 | hsv.x = hsv.x + 360.0; 36 | } 37 | hsv.z = max1; 38 | hsv.y = (max1 - min1) / max1; 39 | return hsv; 40 | } 41 | vec3 hsvtorgb(vec3 hsv) 42 | { 43 | float R; 44 | float G; 45 | float B; 46 | if (hsv.y == 0.0) 47 | { 48 | R = G = B = hsv.z; 49 | } 50 | else 51 | { 52 | hsv.x = hsv.x / 60.0; 53 | int i = int(hsv.x); 54 | float f = hsv.x - float(i); 55 | float a = hsv.z * (1.0 - hsv.y); 56 | float b = hsv.z * (1.0 - hsv.y * f); 57 | float c = hsv.z * (1.0 - hsv.y * (1.0 - f)); 58 | if (i == 0) 59 | { 60 | R = hsv.z; 61 | G = c; 62 | B = a; 63 | } 64 | else if (i == 1) 65 | { 66 | R = b; 67 | G = hsv.z; 68 | B = a; 69 | } 70 | else if (i == 2) 71 | { 72 | R = a; 73 | G = hsv.z; 74 | B = c; 75 | } 76 | else if (i == 3) 77 | { 78 | R = a; 79 | G = b; 80 | B = hsv.z; 81 | } 82 | else if (i == 4) 83 | { 84 | R = c; 85 | G = a; 86 | B = hsv.z; 87 | } 88 | else 89 | { 90 | R = hsv.z; 91 | G = a; 92 | B = b; 93 | } 94 | } 95 | return vec3(R, G, B); 96 | } 97 | void main() 98 | { 99 | 100 | vec4 pixColor = ourColor; 101 | vec3 hsv; 102 | hsv.xyz = rgbtohsv(pixColor.rgb); 103 | hsv.x += u_hue; 104 | hsv.x = mod(hsv.x, 360.0); 105 | hsv.y *= u_saturation; 106 | hsv.z *= u_value; 107 | vec3 f_color = hsvtorgb(hsv); 108 | f_color = ((f_color - 0.5) * max(u_contrast+1.0, 0.0)) + 0.5; 109 | 110 | FragColor = vec4(f_color, pixColor.a); 111 | 112 | //FragColor = ourColor*vec4(1.0,1.0,1.0,0.5); 113 | } 114 | 115 | -------------------------------------------------------------------------------- /CODE/Spectrum/Spectrum6.0/spectrum.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | 4 | void main() 5 | { 6 | gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); 7 | } 8 | 9 | -------------------------------------------------------------------------------- /CODE/Spectrum/Test/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/Spectrum/Test/.DS_Store -------------------------------------------------------------------------------- /CODE/Spectrum/Test/spectrum.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | 3 | out vec4 FragColor; 4 | 5 | uniform vec4 ourColor; 6 | 7 | uniform float u_hue=121.0; 8 | uniform float u_saturation=1.0; 9 | uniform float u_value=1.0; 10 | uniform float u_contrast=0.0; 11 | 12 | vec3 rgbtohsv(vec3 rgb) 13 | { 14 | float R = rgb.x; 15 | float G = rgb.y; 16 | float B = rgb.z; 17 | vec3 hsv; 18 | float max1 = max(R, max(G, B)); 19 | float min1 = min(R, min(G, B)); 20 | if (R == max1) 21 | { 22 | hsv.x = (G - B) / (max1 - min1); 23 | } 24 | if (G == max1) 25 | { 26 | hsv.x = 2.0 + (B - R) / (max1 - min1); 27 | } 28 | if (B == max1) 29 | { 30 | hsv.x = 4.0 + (R - G) / (max1 - min1); 31 | } 32 | hsv.x = hsv.x * 60.0; 33 | if (hsv.x < 0.0) 34 | { 35 | hsv.x = hsv.x + 360.0; 36 | } 37 | hsv.z = max1; 38 | hsv.y = (max1 - min1) / max1; 39 | return hsv; 40 | } 41 | vec3 hsvtorgb(vec3 hsv) 42 | { 43 | float R; 44 | float G; 45 | float B; 46 | if (hsv.y == 0.0) 47 | { 48 | R = G = B = hsv.z; 49 | } 50 | else 51 | { 52 | hsv.x = hsv.x / 60.0; 53 | int i = int(hsv.x); 54 | float f = hsv.x - float(i); 55 | float a = hsv.z * (1.0 - hsv.y); 56 | float b = hsv.z * (1.0 - hsv.y * f); 57 | float c = hsv.z * (1.0 - hsv.y * (1.0 - f)); 58 | if (i == 0) 59 | { 60 | R = hsv.z; 61 | G = c; 62 | B = a; 63 | } 64 | else if (i == 1) 65 | { 66 | R = b; 67 | G = hsv.z; 68 | B = a; 69 | } 70 | else if (i == 2) 71 | { 72 | R = a; 73 | G = hsv.z; 74 | B = c; 75 | } 76 | else if (i == 3) 77 | { 78 | R = a; 79 | G = b; 80 | B = hsv.z; 81 | } 82 | else if (i == 4) 83 | { 84 | R = c; 85 | G = a; 86 | B = hsv.z; 87 | } 88 | else 89 | { 90 | R = hsv.z; 91 | G = a; 92 | B = b; 93 | } 94 | } 95 | return vec3(R, G, B); 96 | } 97 | void main() 98 | { 99 | 100 | vec4 pixColor = ourColor; 101 | vec3 hsv; 102 | hsv.xyz = rgbtohsv(pixColor.rgb); 103 | hsv.x += u_hue; 104 | hsv.x = mod(hsv.x, 360.0); 105 | hsv.y *= u_saturation; 106 | hsv.z *= u_value; 107 | vec3 f_color = hsvtorgb(hsv); 108 | f_color = ((f_color - 0.5) * max(u_contrast+1.0, 0.0)) + 0.5; 109 | 110 | FragColor = vec4(f_color, pixColor.a); 111 | 112 | //FragColor = ourColor*vec4(1.0,1.0,1.0,0.5); 113 | } 114 | 115 | 116 | -------------------------------------------------------------------------------- /CODE/Spectrum/Test/spectrum.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | 4 | void main() 5 | { 6 | gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); 7 | } 8 | 9 | 10 | -------------------------------------------------------------------------------- /CODE/Test/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/Test/.DS_Store -------------------------------------------------------------------------------- /CODE/Test/3D_Circular/spectrum.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | uniform vec4 ourColor; // 在OpenGL程序代码中设定这个变量 5 | 6 | void main() 7 | { 8 | FragColor = ourColor; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /CODE/Test/3D_Circular/spectrum.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | 4 | uniform mat4 model; 5 | uniform mat4 view; 6 | uniform mat4 projection; 7 | uniform mat4 transform; 8 | 9 | void main() 10 | { 11 | gl_Position = projection * view * model * transform * vec4(aPos, 1.0); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /CODE/Test/Circular2.0/spectrum.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | uniform vec4 ourColor; // 在OpenGL程序代码中设定这个变量 5 | 6 | void main() 7 | { 8 | FragColor = ourColor*vec4(0.8,0.8,0.8,1.0); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /CODE/Test/Circular2.0/spectrum.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | 4 | void main() 5 | { 6 | gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); 7 | } 8 | -------------------------------------------------------------------------------- /CODE/Test/PCM1.0/main.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // main.cpp 3 | // PCM1.0 4 | // 5 | // Created by boone on 2018/7/6. 6 | // Copyright © 2018年 boone. All rights reserved. 7 | // 8 | 9 | #define OLD_FILE_PATH "/Users/boone/Desktop/Music/Seve.pcm" 10 | #define VOL_FILE_PATH "/Users/boone/Desktop/Music/Seve.txt" 11 | 12 | #include 13 | 14 | using namespace std; 15 | 16 | int total = 0; 17 | 18 | int volume_adjust(short * in_buf, short * out_buf, float in_vol) 19 | { 20 | 21 | cout<<"原始数值:"<<*in_buf<<" "; 22 | 23 | int i, tmp; 24 | 25 | // in_vol[0, 100] 26 | float vol = in_vol - 98; 27 | 28 | if(-98=2) 39 | vol = 40; //这个值可以根据你的实际情况去调整 40 | 41 | tmp = (*in_buf)*vol; // 上面所有关于vol的判断,其实都是为了此处*in_buf乘以一个倍数,你可以根据自己的需要去修改 42 | 43 | // 下面的code主要是为了溢出判断 44 | if(tmp > 32767) 45 | tmp = 32767; 46 | else if(tmp < -32768) 47 | tmp = -32768; 48 | *out_buf = tmp; 49 | 50 | cout<<"处理后数据:"<<(float)*out_buf/10000<<"当前长度:"<<++total<0) 70 | { 71 | volume_adjust(&s16In, &s16Out, volume); 72 | fwrite(&s16Out, 2, 1, fp_vol); 73 | } 74 | } 75 | 76 | fclose(fp); 77 | fclose(fp_vol); 78 | } 79 | 80 | int main(void) 81 | { 82 | pcm_volume_control(100); 83 | return 0; 84 | } 85 | -------------------------------------------------------------------------------- /CODE/Test/PCM2.0/main.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // main.cpp 3 | // PCM2.0 4 | // 5 | // Created by boone on 2018/7/6. 6 | // Copyright © 2018年 boone. All rights reserved. 7 | // 8 | 9 | 10 | #define OLD_FILE_PATH "/Users/boone/Desktop/Music/16k.pcm" //PCM源文件 11 | #define NEW_FILE_PATH "/Users/boone/Desktop/Music/new.pcm" //PCM解析后数据输出 12 | 13 | #include 14 | 15 | using namespace std; 16 | 17 | int volume_output(short * in_buf, short * out_buf) 18 | { 19 | 20 | cout<<"原始数值:"<<*in_buf< 32767) 30 | temp = 32767; 31 | else if(temp < -32768) 32 | temp = -32768; 33 | 34 | *out_buf = temp; //输出解码PCM得到的数据 35 | 36 | cout<<"获取的数值:"<<*out_buf<0) 54 | { 55 | volume_output(&pcm_In, &pcm_Out); //从PCM中获取的数据经过处理后输出 56 | 57 | fwrite(&pcm_Out, 2, 1, fp_new); //以同样的方式写入文件 58 | } 59 | } 60 | 61 | fclose(fp); 62 |   63 | fclose(fp_new); 64 | } 65 | 66 | int main(void) 67 | { 68 | pcm_read_write(); 69 | return 0; 70 | } 71 | -------------------------------------------------------------------------------- /CODE/Test/PCM3.0/main.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // main.cpp 3 | // PCM3.0 解码效率低 卡顿十分严重 4 | // 5 | // Created by boone on 2018/8/9. 6 | // Copyright © 2018年 boone. All rights reserved. 7 | // 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | using namespace std; 14 | 15 | struct wav_struct 16 | { 17 | unsigned long file_size; //文件大小 18 | unsigned short channel; //通道数 19 | unsigned long frequency; //采样频率 20 | unsigned long Bps; //Byte率 21 | unsigned short sample_num_bit; //一个样本的位数 22 | unsigned long data_size; //数据大小 23 | unsigned char *data; //音频数据 24 | }; 25 | 26 | int main(int argc, char **argv) 27 | { 28 | fstream fs; 29 | wav_struct WAV; 30 | 31 | fs.open("/Users/boone/Desktop/Music/Seve.wav", ios::binary | ios::in); 32 | 33 | fs.seekg(0, ios::end); //用c++常用方法获得文件大小 34 | WAV.file_size = fs.tellg(); 35 | 36 | fs.seekg(0x14); 37 | fs.read((char*)&WAV.channel, sizeof(WAV.channel)); 38 | 39 | fs.seekg(0x18); 40 | fs.read((char*)&WAV.frequency, sizeof(WAV.frequency)); 41 | 42 | fs.seekg(0x1c); 43 | fs.read((char*)&WAV.Bps, sizeof(WAV.Bps)); 44 | 45 | fs.seekg(0x22); 46 | fs.read((char*)&WAV.sample_num_bit, sizeof(WAV.sample_num_bit)); 47 | 48 | fs.seekg(0x28); 49 | fs.read((char*)&WAV.data_size, sizeof(WAV.data_size)); 50 | 51 | WAV.data = new unsigned char[WAV.data_size]; 52 | 53 | 54 | fs.seekg(0x2c); 55 | fs.read((char *)WAV.data, sizeof(char)*WAV.data_size); 56 | 57 | cout << "文件大小为 :" << WAV.file_size << endl; 58 | cout << "音频通道数 :" << WAV.channel << endl; 59 | cout << "采样频率 :" << WAV.frequency << endl; 60 | cout << "Byte率 :" << WAV.Bps << endl; 61 | cout << "样本位数 :" << WAV.sample_num_bit << endl; 62 | cout << "音频数据大小:" << WAV.data_size << endl; 63 | cout << "最后10个数据:" << endl; 64 | 65 | for (unsigned long i =0; i 11 | #include 12 | #include 13 | 14 | using namespace std; 15 | 16 | /* r=log2(N) */ 17 | void FFT(Complex *TD, Complex *FD, int r) 18 | { 19 | // const int count = 1 << r; 20 | // int csz = sizeof(Complex)*count; 21 | // Complex* W = (Complex*)malloc(csz / 2); 22 | // Complex* X1 = (Complex*)malloc(csz); 23 | // Complex* X2 = (Complex*)malloc(csz); 24 | // Complex* X = NULL; 25 | // 26 | // int i, j, k; 27 | // int dist, p; 28 | // double f = PI_X2 / count; 29 | // double a = 0; 30 | // for (i = 0; i < count / 2; ++i) 31 | // { 32 | // W[i] = Complex(cos(a), -sin(a)); 33 | // a += f; 34 | // } 35 | // 36 | // for (i = 0; i < count; ++i) 37 | // { 38 | // X1[i] = TD[i]; 39 | // } 40 | // 41 | // for (k = 0; k < r; ++k) 42 | // { 43 | // for (j = 0; j < (1 << k); ++j) 44 | // { 45 | // dist = 1 << (r - k); 46 | // for (i = 0; i < dist / 2; ++i) 47 | // { 48 | // p = j * dist; 49 | // X2[i + p] = X1[i + p] + X1[i + p + dist / 2]; 50 | // X2[i + p + dist / 2] = (X1[i + p] - X1[i + p + dist / 2])* W[i * (1 << k)]; 51 | // } 52 | // } 53 | // X = X1; 54 | // X1 = X2; 55 | // X2 = X; 56 | // } 57 | 58 | // for (j = 0; j < count; ++j) 59 | // { 60 | // p = 0; 61 | // for (i = 0; i < r; ++i) 62 | // { 63 | // if (j&(1 << i)) 64 | // { 65 | // p += 1 << (r - i - 1); 66 | // } 67 | // } 68 | // FD[j] = X1[p]; 69 | // } 70 | // 71 | // free(W); 72 | // free(X1); 73 | // free(X2); 74 | 75 | 76 | for (int j=0; j1.0){ 80 | FD[j].real=1.0; 81 | }else{ 82 | FD[j].real=TD[j].real; 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /CODE/Test/Spectrum3.0/FFT.h: -------------------------------------------------------------------------------- 1 | // 2 | // FFT.h 3 | // FFT 4 | // 5 | // Created by boone on 2018/7/17. 6 | // Copyright © 2018年 boone. All rights reserved. 7 | // 8 | 9 | #ifndef FFT_h 10 | #define FFT_h 11 | 12 | #include "Complex.h" 13 | 14 | #ifndef CONST_PI 15 | #define CONST_PI 16 | const double PI = 3.14159265358979; 17 | const double PI_X2 = 2 * PI; 18 | #endif 19 | 20 | /* r=log2(N) */ 21 | extern void FFT(Complex *TD, Complex *FD, int r); 22 | 23 | 24 | #endif /* FFT_h */ 25 | -------------------------------------------------------------------------------- /CODE/Test/Test.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CODE/Test/Test.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CODE/Test/Test.xcodeproj/project.xcworkspace/xcuserdata/boone.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/Test/Test.xcodeproj/project.xcworkspace/xcuserdata/boone.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /CODE/Test/Test.xcodeproj/xcuserdata/boone.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /CODE/Test/Test.xcodeproj/xcuserdata/boone.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | 3D_Circular.xcscheme 8 | 9 | orderHint 10 | 12 11 | 12 | 3D_Circular2.0.xcscheme 13 | 14 | orderHint 15 | 14 16 | 17 | Circular.xcscheme 18 | 19 | orderHint 20 | 11 21 | 22 | Circular2.0.xcscheme 23 | 24 | orderHint 25 | 13 26 | 27 | PCM1.0.xcscheme 28 | 29 | orderHint 30 | 0 31 | 32 | PCM2.0.xcscheme 33 | 34 | orderHint 35 | 2 36 | 37 | PCM3.0.xcscheme 38 | 39 | orderHint 40 | 15 41 | 42 | Spectrum.xcscheme 43 | 44 | orderHint 45 | 8 46 | 47 | Spectrum2.0.xcscheme 48 | 49 | orderHint 50 | 10 51 | 52 | Spectrum3.0.xcscheme 53 | 54 | orderHint 55 | 9 56 | 57 | Spectrum4.0.xcscheme 58 | 59 | orderHint 60 | 12 61 | 62 | Sphere.xcscheme 63 | 64 | orderHint 65 | 13 66 | 67 | Test.xcscheme 68 | 69 | orderHint 70 | 1 71 | 72 | Wave.xcscheme 73 | 74 | orderHint 75 | 2 76 | 77 | Waveform.xcscheme 78 | 79 | orderHint 80 | 3 81 | 82 | Waveform2.0.xcscheme 83 | 84 | orderHint 85 | 4 86 | 87 | Waveform3.0.xcscheme 88 | 89 | orderHint 90 | 5 91 | 92 | Waveform4.0.xcscheme 93 | 94 | orderHint 95 | 6 96 | 97 | Waveform5.0.xcscheme 98 | 99 | orderHint 100 | 7 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /CODE/Test/Test/main.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // main.cpp 3 | // Spectrum3.0 4 | // 引入FFTW进行测试 5 | // 6 | // Created by boone on 2018/7/18. 7 | // Copyright © 2018年 boone. All rights reserved. 8 | // 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | using namespace std; 15 | 16 | int main() 17 | { 18 | int n,m; 19 | cin>>n>>m; 20 | int num[n]; 21 | for (int i=0; i>num[i]; 23 | } 24 | float res =0; 25 | int sum=0; 26 | int sum2=0; 27 | for (int i=0; i 12 | 13 | #include 14 | 15 | using namespace std; 16 | 17 | void drawLint() 18 | { 19 | glClearColor (0.8, 0.8, 0.8, 0.8); 20 | glClear (GL_COLOR_BUFFER_BIT); 21 | 22 | glLineWidth(2);//设置线段宽度 23 | glBegin(GL_LINES); 24 | glColor3f(1.0,0.0,0.0); 25 | 26 | short pcm_In = 0; 27 | int size = 0; 28 | float xstart=-1.0; 29 | float ystart=0.0; 30 | float xend=0.0; 31 | float yend=0.0; 32 | float temp = 0.0; 33 | 34 | FILE *fp = fopen(OLD_FILE_PATH, "rb+"); //为读写打开一个二进制文件 即pcm文件 35 | 36 | while(!feof(fp)) 37 | { 38 | size = fread(&pcm_In, 2, 1, fp); //pcm中每个数据大小为2字节,每次读取1个数据 39 | if(size>0) 40 | { 41 | //确定绘制波形的折线两点坐标 42 | xstart=xstart+0.00003; 43 | ystart=temp; 44 | xend=xstart+0.00003; 45 | 46 | //------------------------------------------------------------------------------------------------------------------------- 47 | yend=(float)pcm_In/10000; //short类型除以一个数要么是0要么是大于一的整数,所以坐标变换要注意先转为float 48 | 49 | //绘制折线 50 | glVertex2f(xstart,ystart); 51 | glVertex2f(xend,yend); 52 | 53 | cout< 12 | 13 | #include 14 | 15 | using namespace std; 16 | 17 | void drawLint() 18 | { 19 | glClearColor (0.8, 0.8, 0.8, 0.8); 20 | glClear (GL_COLOR_BUFFER_BIT); 21 | 22 | glLineWidth(2);//设置线段宽度 23 | glBegin(GL_LINES); 24 | glColor3f(0.3,0.6,0.8); 25 | 26 | short pcm_In = 0; 27 | int size = 0; 28 | float xstart=-1.0; 29 | float ystart=0.0; 30 | float xend=0.0; 31 | float yend=0.0; 32 | float temp = 0.0; 33 | 34 | FILE *fp = fopen(OLD_FILE_PATH, "rb+"); //为读写打开一个二进制文件 即pcm文件 35 | 36 | while(!feof(fp)) 37 | { 38 | size = fread(&pcm_In, 2, 1, fp); //pcm中每个数据大小为2字节,每次读取1个数据 39 | if(size>0) 40 | { 41 | //确定绘制波形的折线两点坐标 42 | xstart=xstart+0.0000001; 43 | ystart=temp; 44 | xend=xstart+0.0000001; 45 | 46 | //------------------------------------------------------------------------------------------------------------------------- 47 | yend=(float)pcm_In/32768; //short类型除以一个数要么是0要么是大于一的整数,所以坐标变换要注意先转为float 48 | 49 | printf("%f ",yend); 50 | //绘制折线 51 | glVertex2f(xstart,ystart); 52 | glVertex2f(xend,yend); 53 | 54 | temp=yend; //终点作为下一次的起点 55 | } 56 | } 57 | 58 | fclose(fp); 59 | 60 | glEnd(); 61 | } 62 | 63 | int main(void) 64 | { 65 | GLFWwindow* window; 66 | 67 | /* Initialize the library */ 68 | if (!glfwInit()) 69 | return -1; 70 | 71 | /* Create a windowed mode window and its OpenGL context */ 72 | window = glfwCreateWindow(800, 800, "Visualize Music ", NULL, NULL); 73 | if (!window) 74 | { 75 | glfwTerminate(); 76 | return -1; 77 | } 78 | 79 | /* Make the window's context current */ 80 | glfwMakeContextCurrent(window); 81 | 82 | /* Loop until the user closes the window */ 83 | while (!glfwWindowShouldClose(window)) 84 | { 85 | 86 | /*your draw*/ 87 | // drawPoint(); 88 | drawLint(); 89 | 90 | /* Swap front and back buffers */ 91 | glfwSwapBuffers(window); 92 | 93 | /* Poll for and process events */ 94 | glfwPollEvents(); 95 | } 96 | 97 | glfwTerminate(); 98 | return 0; 99 | } 100 | 101 | 102 | -------------------------------------------------------------------------------- /CODE/Test/Waveform3.0/3D_Circular2.0/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/Test/Waveform3.0/3D_Circular2.0/.DS_Store -------------------------------------------------------------------------------- /CODE/Test/Waveform3.0/3D_Circular2.0/spectrum.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | uniform vec4 ourColor; // 在OpenGL程序代码中设定这个变量 5 | 6 | void main() 7 | { 8 | FragColor = ourColor; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /CODE/Test/Waveform3.0/3D_Circular2.0/spectrum.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | 4 | uniform mat4 model; 5 | uniform mat4 view; 6 | uniform mat4 projection; 7 | uniform mat4 transform; 8 | 9 | void main() 10 | { 11 | gl_Position = projection * view * model * transform * vec4(aPos, 1.0); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /CODE/Test/Waveform5.0/spectrum.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | uniform vec4 ourColor; // 在OpenGL程序代码中设定这个变量 5 | 6 | void main() 7 | { 8 | FragColor = ourColor*vec4(1.0,1.0,1.0,1.0); 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /CODE/Test/Waveform5.0/spectrum.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | 4 | void main() 5 | { 6 | gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); 7 | } 8 | -------------------------------------------------------------------------------- /CODE/include/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/include/.DS_Store -------------------------------------------------------------------------------- /CODE/include/glm-0.9.6.3.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/CODE/include/glm-0.9.6.3.rar -------------------------------------------------------------------------------- /CODE/include/glm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(NAME glm_dummy) 2 | 3 | file(GLOB ROOT_SOURCE *.cpp) 4 | file(GLOB ROOT_INLINE *.inl) 5 | file(GLOB ROOT_HEADER *.hpp) 6 | file(GLOB ROOT_TEXT ../*.txt) 7 | file(GLOB ROOT_NAT ../util/glm.natvis) 8 | 9 | file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp) 10 | file(GLOB_RECURSE CORE_INLINE ./detail/*.inl) 11 | file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp) 12 | 13 | file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp) 14 | file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl) 15 | file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp) 16 | 17 | file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp) 18 | file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl) 19 | file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp) 20 | 21 | source_group("Text Files" FILES ${ROOT_TEXT}) 22 | source_group("Core Files" FILES ${CORE_SOURCE}) 23 | source_group("Core Files" FILES ${CORE_INLINE}) 24 | source_group("Core Files" FILES ${CORE_HEADER}) 25 | source_group("GTC Files" FILES ${GTC_SOURCE}) 26 | source_group("GTC Files" FILES ${GTC_INLINE}) 27 | source_group("GTC Files" FILES ${GTC_HEADER}) 28 | source_group("GTX Files" FILES ${GTX_SOURCE}) 29 | source_group("GTX Files" FILES ${GTX_INLINE}) 30 | source_group("GTX Files" FILES ${GTX_HEADER}) 31 | 32 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) 33 | 34 | if(GLM_TEST_ENABLE) 35 | add_executable(${NAME} ${ROOT_TEXT} ${ROOT_NAT} 36 | ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} 37 | ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} 38 | ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} 39 | ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}) 40 | endif(GLM_TEST_ENABLE) 41 | 42 | #add_library(glm STATIC glm.cpp) 43 | #add_library(glm_shared SHARED glm.cpp) 44 | -------------------------------------------------------------------------------- /CODE/include/glm/common.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/common.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_common.hpp" 36 | -------------------------------------------------------------------------------- /CODE/include/glm/detail/_fixes.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/_fixes.hpp 29 | /// @date 2011-02-21 / 2011-11-22 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #include 34 | 35 | //! Workaround for compatibility with other libraries 36 | #ifdef max 37 | #undef max 38 | #endif 39 | 40 | //! Workaround for compatibility with other libraries 41 | #ifdef min 42 | #undef min 43 | #endif 44 | 45 | //! Workaround for Android 46 | #ifdef isnan 47 | #undef isnan 48 | #endif 49 | 50 | //! Workaround for Android 51 | #ifdef isinf 52 | #undef isinf 53 | #endif 54 | 55 | //! Workaround for Chrone Native Client 56 | #ifdef log2 57 | #undef log2 58 | #endif 59 | 60 | -------------------------------------------------------------------------------- /CODE/include/glm/detail/intrinsic_exponential.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_exponential.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /CODE/include/glm/detail/intrinsic_geometric.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_geometric.hpp 25 | /// @date 2009-05-08 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #pragma once 30 | 31 | #include "setup.hpp" 32 | 33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 34 | # error "SSE2 instructions not supported or enabled" 35 | #else 36 | 37 | #include "intrinsic_common.hpp" 38 | 39 | namespace glm{ 40 | namespace detail 41 | { 42 | //length 43 | __m128 sse_len_ps(__m128 x); 44 | 45 | //distance 46 | __m128 sse_dst_ps(__m128 p0, __m128 p1); 47 | 48 | //dot 49 | __m128 sse_dot_ps(__m128 v1, __m128 v2); 50 | 51 | // SSE1 52 | __m128 sse_dot_ss(__m128 v1, __m128 v2); 53 | 54 | //cross 55 | __m128 sse_xpd_ps(__m128 v1, __m128 v2); 56 | 57 | //normalize 58 | __m128 sse_nrm_ps(__m128 v); 59 | 60 | //faceforward 61 | __m128 sse_ffd_ps(__m128 N, __m128 I, __m128 Nref); 62 | 63 | //reflect 64 | __m128 sse_rfe_ps(__m128 I, __m128 N); 65 | 66 | //refract 67 | __m128 sse_rfa_ps(__m128 I, __m128 N, __m128 eta); 68 | 69 | }//namespace detail 70 | }//namespace glm 71 | 72 | #include "intrinsic_geometric.inl" 73 | 74 | #endif//GLM_ARCH 75 | -------------------------------------------------------------------------------- /CODE/include/glm/detail/intrinsic_integer.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_integer.hpp 25 | /// @date 2009-05-11 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #pragma once 30 | 31 | #include "glm/glm.hpp" 32 | 33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 34 | # error "SSE2 instructions not supported or enabled" 35 | #else 36 | 37 | namespace glm{ 38 | namespace detail 39 | { 40 | __m128i _mm_bit_interleave_si128(__m128i x); 41 | __m128i _mm_bit_interleave_si128(__m128i x, __m128i y); 42 | 43 | }//namespace detail 44 | }//namespace glm 45 | 46 | #include "intrinsic_integer.inl" 47 | 48 | #endif//GLM_ARCH 49 | -------------------------------------------------------------------------------- /CODE/include/glm/detail/intrinsic_matrix.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_common.hpp 25 | /// @date 2009-06-05 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #pragma once 30 | 31 | #include "setup.hpp" 32 | 33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 34 | # error "SSE2 instructions not supported or enabled" 35 | #else 36 | 37 | #include "intrinsic_geometric.hpp" 38 | 39 | namespace glm{ 40 | namespace detail 41 | { 42 | void sse_add_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]); 43 | 44 | void sse_sub_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]); 45 | 46 | __m128 sse_mul_ps(__m128 m[4], __m128 v); 47 | 48 | __m128 sse_mul_ps(__m128 v, __m128 m[4]); 49 | 50 | void sse_mul_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]); 51 | 52 | void sse_transpose_ps(__m128 const in[4], __m128 out[4]); 53 | 54 | void sse_inverse_ps(__m128 const in[4], __m128 out[4]); 55 | 56 | void sse_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out[4]); 57 | 58 | __m128 sse_det_ps(__m128 const m[4]); 59 | 60 | __m128 sse_slow_det_ps(__m128 const m[4]); 61 | 62 | }//namespace detail 63 | }//namespace glm 64 | 65 | #include "intrinsic_matrix.inl" 66 | 67 | #endif//GLM_ARCH 68 | -------------------------------------------------------------------------------- /CODE/include/glm/detail/intrinsic_trigonometric.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_trigonometric.hpp 25 | /// @date 2009-06-09 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #pragma once 30 | 31 | #include "setup.hpp" 32 | 33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 34 | # error "SSE2 instructions not supported or enabled" 35 | #else 36 | 37 | namespace glm{ 38 | namespace detail 39 | { 40 | 41 | }//namespace detail 42 | }//namespace glm 43 | 44 | #include "intrinsic_trigonometric.inl" 45 | 46 | #endif//GLM_ARCH 47 | -------------------------------------------------------------------------------- /CODE/include/glm/detail/intrinsic_trigonometric.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_trigonometric.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /CODE/include/glm/detail/intrinsic_vector_relational.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_vector_relational.hpp 25 | /// @date 2009-06-09 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #pragma once 30 | 31 | #include "setup.hpp" 32 | 33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 34 | # error "SSE2 instructions not supported or enabled" 35 | #else 36 | 37 | namespace glm{ 38 | namespace detail 39 | { 40 | 41 | }//namespace detail 42 | }//namespace glm 43 | 44 | #include "intrinsic_vector_relational.inl" 45 | 46 | #endif//GLM_ARCH 47 | -------------------------------------------------------------------------------- /CODE/include/glm/detail/precision.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/precision.hpp 29 | /// @date 2013-04-01 / 2013-04-01 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | namespace glm 36 | { 37 | enum precision 38 | { 39 | highp, 40 | mediump, 41 | lowp, 42 | defaultp = highp 43 | }; 44 | }//namespace glm 45 | -------------------------------------------------------------------------------- /CODE/include/glm/detail/type_half.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/type_half.hpp 29 | /// @date 2008-08-17 / 2011-09-20 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "setup.hpp" 36 | 37 | namespace glm{ 38 | namespace detail 39 | { 40 | typedef short hdata; 41 | 42 | GLM_FUNC_DECL float toFloat32(hdata value); 43 | GLM_FUNC_DECL hdata toFloat16(float const & value); 44 | 45 | }//namespace detail 46 | }//namespace glm 47 | 48 | #include "type_half.inl" 49 | -------------------------------------------------------------------------------- /CODE/include/glm/detail/type_mat.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/type_mat.inl 29 | /// @date 2011-06-15 / 2011-06-15 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | -------------------------------------------------------------------------------- /CODE/include/glm/detail/type_vec.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/type_vec.inl 29 | /// @date 2011-06-15 / 2011-06-15 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | -------------------------------------------------------------------------------- /CODE/include/glm/detail/type_vec4_avx.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/type_tvec4_avx.inl 29 | /// @date 2014-12-01 / 2014-12-01 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm{ 34 | namespace detail 35 | { 36 | 37 | }//namespace detail 38 | 39 | 40 | 41 | }//namespace glm 42 | -------------------------------------------------------------------------------- /CODE/include/glm/detail/type_vec4_avx2.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/type_tvec4_avx2.inl 29 | /// @date 2014-12-01 / 2014-12-01 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm{ 34 | namespace detail 35 | { 36 | 37 | }//namespace detail 38 | 39 | 40 | 41 | }//namespace glm 42 | -------------------------------------------------------------------------------- /CODE/include/glm/exponential.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/exponential.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_exponential.hpp" 36 | -------------------------------------------------------------------------------- /CODE/include/glm/geometric.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/geometric.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_geometric.hpp" 36 | -------------------------------------------------------------------------------- /CODE/include/glm/gtc/type_precision.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtc_swizzle 28 | /// @file glm/gtc/swizzle.inl 29 | /// @date 2009-06-14 / 2011-06-15 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /CODE/include/glm/gtc/vec1.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtc_vec1 28 | /// @file glm/gtc/vec1.inl 29 | /// @date 2013-03-16 / 2013-03-16 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/extend.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_extend 28 | /// @file glm/gtx/extend.hpp 29 | /// @date 2006-01-07 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_extend GLM_GTX_extend 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Extend a position from a source to a position at a defined length. 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../glm.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_extend extension included") 49 | #endif 50 | 51 | namespace glm 52 | { 53 | /// @addtogroup gtx_extend 54 | /// @{ 55 | 56 | /// Extends of Length the Origin position using the (Source - Origin) direction. 57 | /// @see gtx_extend 58 | template 59 | GLM_FUNC_DECL genType extend( 60 | genType const & Origin, 61 | genType const & Source, 62 | typename genType::value_type const Length); 63 | 64 | /// @} 65 | }//namespace glm 66 | 67 | #include "extend.inl" 68 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/gradient_paint.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_gradient_paint 28 | /// @file glm/gtx/gradient_paint.inl 29 | /// @date 2009-03-06 / 2013-04-09 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER T radialGradient 37 | ( 38 | tvec2 const & Center, 39 | T const & Radius, 40 | tvec2 const & Focal, 41 | tvec2 const & Position 42 | ) 43 | { 44 | tvec2 F = Focal - Center; 45 | tvec2 D = Position - Focal; 46 | T Radius2 = pow2(Radius); 47 | T Fx2 = pow2(F.x); 48 | T Fy2 = pow2(F.y); 49 | 50 | T Numerator = (D.x * F.x + D.y * F.y) + sqrt(Radius2 * (pow2(D.x) + pow2(D.y)) - pow2(D.x * F.y - D.y * F.x)); 51 | T Denominator = Radius2 - (Fx2 + Fy2); 52 | return Numerator / Denominator; 53 | } 54 | 55 | template 56 | GLM_FUNC_QUALIFIER T linearGradient 57 | ( 58 | tvec2 const & Point0, 59 | tvec2 const & Point1, 60 | tvec2 const & Position 61 | ) 62 | { 63 | tvec2 Dist = Point1 - Point0; 64 | return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist); 65 | } 66 | }//namespace glm 67 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/handed_coordinate_space.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_handed_coordinate_space 28 | /// @file glm/gtx/handed_coordinate_space.inl 29 | /// @date 2005-12-21 / 2009-02-19 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER bool rightHanded 37 | ( 38 | tvec3 const & tangent, 39 | tvec3 const & binormal, 40 | tvec3 const & normal 41 | ) 42 | { 43 | return dot(cross(normal, tangent), binormal) > T(0); 44 | } 45 | 46 | template 47 | GLM_FUNC_QUALIFIER bool leftHanded 48 | ( 49 | tvec3 const & tangent, 50 | tvec3 const & binormal, 51 | tvec3 const & normal 52 | ) 53 | { 54 | return dot(cross(normal, tangent), binormal) < T(0); 55 | } 56 | }//namespace glm 57 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/log_base.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_log_base 28 | /// @file glm/gtx/log_base.hpp 29 | /// @date 2008-10-24 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_log_base GLM_GTX_log_base 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Logarithm for any base. base can be a vector or a scalar. 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../glm.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_log_base extension included") 49 | #endif 50 | 51 | namespace glm 52 | { 53 | /// @addtogroup gtx_log_base 54 | /// @{ 55 | 56 | //! Logarithm for any base. 57 | //! From GLM_GTX_log_base. 58 | template 59 | GLM_FUNC_DECL genType log( 60 | genType x, 61 | genType base); 62 | 63 | //! Logarithm for any base. 64 | //! From GLM_GTX_log_base. 65 | template class vecType> 66 | GLM_FUNC_DECL vecType sign( 67 | vecType const & x, 68 | vecType const & base); 69 | 70 | /// @} 71 | }//namespace glm 72 | 73 | #include "log_base.inl" 74 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/log_base.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_log_base 28 | /// @file glm/gtx/log_base.inl 29 | /// @date 2008-10-24 / 2014-11-25 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER genType log(genType const & x, genType const & base) 37 | { 38 | assert(x != genType(0)); 39 | return glm::log(x) / glm::log(base); 40 | } 41 | 42 | template class vecType> 43 | GLM_FUNC_QUALIFIER vecType log(vecType const & x, vecType const & base) 44 | { 45 | return glm::log(x) / glm::log(base); 46 | } 47 | }//namespace glm 48 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/matrix_cross_product.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_matrix_cross_product 28 | /// @file glm/gtx/matrix_cross_product.inl 29 | /// @date 2005-12-21 / 2005-12-21 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER tmat3x3 matrixCross3 37 | ( 38 | tvec3 const & x 39 | ) 40 | { 41 | tmat3x3 Result(T(0)); 42 | Result[0][1] = x.z; 43 | Result[1][0] = -x.z; 44 | Result[0][2] = -x.y; 45 | Result[2][0] = x.y; 46 | Result[1][2] = x.x; 47 | Result[2][1] = -x.x; 48 | return Result; 49 | } 50 | 51 | template 52 | GLM_FUNC_QUALIFIER tmat4x4 matrixCross4 53 | ( 54 | tvec3 const & x 55 | ) 56 | { 57 | tmat4x4 Result(T(0)); 58 | Result[0][1] = x.z; 59 | Result[1][0] = -x.z; 60 | Result[0][2] = -x.y; 61 | Result[2][0] = x.y; 62 | Result[1][2] = x.x; 63 | Result[2][1] = -x.x; 64 | return Result; 65 | } 66 | 67 | }//namespace glm 68 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/mixed_product.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_mixed_product 28 | /// @file glm/gtx/mixed_product.hpp 29 | /// @date 2007-04-03 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_mixed_product GLM_GTX_mixed_producte 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Mixed product of 3 vectors. 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../glm.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_mixed_product extension included") 49 | #endif 50 | 51 | namespace glm 52 | { 53 | /// @addtogroup gtx_mixed_product 54 | /// @{ 55 | 56 | /// @brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension) 57 | template 58 | GLM_FUNC_DECL T mixedProduct( 59 | tvec3 const & v1, 60 | tvec3 const & v2, 61 | tvec3 const & v3); 62 | 63 | /// @} 64 | }// namespace glm 65 | 66 | #include "mixed_product.inl" 67 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/mixed_product.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_mixed_product 28 | /// @file glm/gtx/mixed_product.inl 29 | /// @date 2007-04-03 / 2008-09-17 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER T mixedProduct 37 | ( 38 | tvec3 const & v1, 39 | tvec3 const & v2, 40 | tvec3 const & v3 41 | ) 42 | { 43 | return dot(cross(v1, v2), v3); 44 | } 45 | }//namespace glm 46 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/normal.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_normal 28 | /// @file glm/gtx/normal.hpp 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// @see gtx_extented_min_max (dependence) 34 | /// 35 | /// @defgroup gtx_normal GLM_GTX_normal 36 | /// @ingroup gtx 37 | /// 38 | /// @brief Compute the normal of a triangle. 39 | /// 40 | /// need to be included to use these functionalities. 41 | /////////////////////////////////////////////////////////////////////////////////// 42 | 43 | #pragma once 44 | 45 | // Dependency: 46 | #include "../glm.hpp" 47 | 48 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 49 | # pragma message("GLM: GLM_GTX_normal extension included") 50 | #endif 51 | 52 | namespace glm 53 | { 54 | /// @addtogroup gtx_normal 55 | /// @{ 56 | 57 | //! Computes triangle normal from triangle points. 58 | //! From GLM_GTX_normal extension. 59 | template 60 | GLM_FUNC_DECL tvec3 triangleNormal( 61 | tvec3 const & p1, 62 | tvec3 const & p2, 63 | tvec3 const & p3); 64 | 65 | /// @} 66 | }//namespace glm 67 | 68 | #include "normal.inl" 69 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/normal.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_normal 28 | /// @file glm/gtx/normal.inl 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER tvec3 triangleNormal 37 | ( 38 | tvec3 const & p1, 39 | tvec3 const & p2, 40 | tvec3 const & p3 41 | ) 42 | { 43 | return normalize(cross(p1 - p2, p1 - p3)); 44 | } 45 | }//namespace glm 46 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/normalize_dot.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_normalize_dot 28 | /// @file glm/gtx/normalize_dot.inl 29 | /// @date 2007-09-28 / 2008-10-07 30 | /// @author Christophe Riccio 31 | ////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template class vecType> 36 | GLM_FUNC_QUALIFIER T normalizeDot(vecType const & x, vecType const & y) 37 | { 38 | return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); 39 | } 40 | 41 | template class vecType> 42 | GLM_FUNC_QUALIFIER T fastNormalizeDot(vecType const & x, vecType const & y) 43 | { 44 | return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y)); 45 | } 46 | }//namespace glm 47 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/number_precision.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_number_precision 28 | /// @file glm/gtx/number_precision.inl 29 | /// @date 2007-05-10 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/optimum_pow.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_optimum_pow 28 | /// @file glm/gtx/optimum_pow.inl 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER genType pow2(genType const & x) 37 | { 38 | return x * x; 39 | } 40 | 41 | template 42 | GLM_FUNC_QUALIFIER genType pow3(genType const & x) 43 | { 44 | return x * x * x; 45 | } 46 | 47 | template 48 | GLM_FUNC_QUALIFIER genType pow4(genType const & x) 49 | { 50 | return (x * x) * (x * x); 51 | } 52 | }//namespace glm 53 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/orthonormalize.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_orthonormalize 28 | /// @file glm/gtx/orthonormalize.inl 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER tmat3x3 orthonormalize(tmat3x3 const & m) 37 | { 38 | tmat3x3 r = m; 39 | 40 | r[0] = normalize(r[0]); 41 | 42 | T d0 = dot(r[0], r[1]); 43 | r[1] -= r[0] * d0; 44 | r[1] = normalize(r[1]); 45 | 46 | T d1 = dot(r[1], r[2]); 47 | d0 = dot(r[0], r[2]); 48 | r[2] -= r[0] * d0 + r[1] * d1; 49 | r[2] = normalize(r[2]); 50 | 51 | return r; 52 | } 53 | 54 | template 55 | GLM_FUNC_QUALIFIER tvec3 orthonormalize(tvec3 const & x, tvec3 const & y) 56 | { 57 | return normalize(x - y * dot(y, x)); 58 | } 59 | }//namespace glm 60 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/perpendicular.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_perpendicular 28 | /// @file glm/gtx/perpendicular.hpp 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// @see gtx_projection (dependence) 34 | /// 35 | /// @defgroup gtx_perpendicular GLM_GTX_perpendicular 36 | /// @ingroup gtx 37 | /// 38 | /// @brief Perpendicular of a vector from other one 39 | /// 40 | /// need to be included to use these functionalities. 41 | /////////////////////////////////////////////////////////////////////////////////// 42 | 43 | #pragma once 44 | 45 | // Dependency: 46 | #include "../glm.hpp" 47 | #include "../gtx/projection.hpp" 48 | 49 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 50 | # pragma message("GLM: GLM_GTX_perpendicular extension included") 51 | #endif 52 | 53 | namespace glm 54 | { 55 | /// @addtogroup gtx_perpendicular 56 | /// @{ 57 | 58 | //! Projects x a perpendicular axis of Normal. 59 | //! From GLM_GTX_perpendicular extension. 60 | template 61 | GLM_FUNC_DECL vecType perp( 62 | vecType const & x, 63 | vecType const & Normal); 64 | 65 | /// @} 66 | }//namespace glm 67 | 68 | #include "perpendicular.inl" 69 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/perpendicular.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_perpendicular 28 | /// @file glm/gtx/perpendicular.inl 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER vecType perp 37 | ( 38 | vecType const & x, 39 | vecType const & Normal 40 | ) 41 | { 42 | return x - proj(x, Normal); 43 | } 44 | }//namespace glm 45 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/polar_coordinates.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_polar_coordinates 28 | /// @file glm/gtx/polar_coordinates.inl 29 | /// @date 2007-03-06 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER tvec3 polar 37 | ( 38 | tvec3 const & euclidean 39 | ) 40 | { 41 | T const Length(length(euclidean)); 42 | tvec3 const tmp(euclidean / Length); 43 | T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z)); 44 | 45 | return tvec3( 46 | atan(xz_dist, tmp.y), // latitude 47 | atan(tmp.x, tmp.z), // longitude 48 | xz_dist); // xz distance 49 | } 50 | 51 | template 52 | GLM_FUNC_QUALIFIER tvec3 euclidean 53 | ( 54 | tvec2 const & polar 55 | ) 56 | { 57 | T const latitude(polar.x); 58 | T const longitude(polar.y); 59 | 60 | return tvec3( 61 | cos(latitude) * sin(longitude), 62 | sin(latitude), 63 | cos(latitude) * cos(longitude)); 64 | } 65 | 66 | }//namespace glm 67 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/projection.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_projection 28 | /// @file glm/gtx/projection.hpp 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_projection GLM_GTX_projection 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Projection of a vector to other one 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../geometric.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_projection extension included") 49 | #endif 50 | 51 | namespace glm 52 | { 53 | /// @addtogroup gtx_projection 54 | /// @{ 55 | 56 | /// Projects x on Normal. 57 | /// 58 | /// @see gtx_projection 59 | template 60 | GLM_FUNC_DECL vecType proj(vecType const & x, vecType const & Normal); 61 | 62 | /// @} 63 | }//namespace glm 64 | 65 | #include "projection.inl" 66 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/projection.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_projection 28 | /// @file glm/gtx/projection.inl 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER vecType proj(vecType const & x, vecType const & Normal) 37 | { 38 | return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal; 39 | } 40 | }//namespace glm 41 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/raw_data.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_raw_data 28 | /// @file glm/gtx/raw_data.inl 29 | /// @date 2008-11-19 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/scalar_relational.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_scalar_relational 28 | /// @file glm/gtx/scalar_relational.hpp 29 | /// @date 2013-02-04 / 2013-02-04 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_scalar_relational GLM_GTX_scalar_relational 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Extend a position from a source to a position at a defined length. 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../glm.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_extend extension included") 49 | #endif 50 | 51 | namespace glm 52 | { 53 | /// @addtogroup gtx_scalar_relational 54 | /// @{ 55 | 56 | 57 | 58 | /// @} 59 | }//namespace glm 60 | 61 | #include "scalar_relational.inl" 62 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/std_based_type.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_std_based_type 28 | /// @file glm/gtx/std_based_type.inl 29 | /// @date 2008-06-08 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/transform.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_transform 28 | /// @file glm/gtx/transform.inl 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER tmat4x4 translate( 37 | tvec3 const & v) 38 | { 39 | return translate( 40 | tmat4x4(1.0f), v); 41 | } 42 | 43 | template 44 | GLM_FUNC_QUALIFIER tmat4x4 rotate( 45 | T angle, 46 | tvec3 const & v) 47 | { 48 | return rotate( 49 | tmat4x4(1), angle, v); 50 | } 51 | 52 | template 53 | GLM_FUNC_QUALIFIER tmat4x4 scale( 54 | tvec3 const & v) 55 | { 56 | return scale( 57 | tmat4x4(1.0f), v); 58 | } 59 | 60 | }//namespace glm 61 | -------------------------------------------------------------------------------- /CODE/include/glm/gtx/type_aligned.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtc_type_aligned 28 | /// @file glm/gtc/type_aligned.inl 29 | /// @date 2014-11-23 / 2014-11-23 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /CODE/include/glm/integer.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/integer.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_integer.hpp" 36 | -------------------------------------------------------------------------------- /CODE/include/glm/matrix.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/matrix.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_matrix.hpp" 36 | -------------------------------------------------------------------------------- /CODE/include/glm/packing.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/packing.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_packing.hpp" 36 | -------------------------------------------------------------------------------- /CODE/include/glm/trigonometric.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/trigonometric.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_trigonometric.hpp" 36 | -------------------------------------------------------------------------------- /CODE/include/glm/vec2.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/vec2.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/type_vec2.hpp" 36 | -------------------------------------------------------------------------------- /CODE/include/glm/vec3.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/vec3.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/type_vec3.hpp" 36 | -------------------------------------------------------------------------------- /CODE/include/glm/vec4.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/vec4.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/type_vec4.hpp" 36 | -------------------------------------------------------------------------------- /CODE/include/glm/vector_relational.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/vector_relational.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_vector_relational.hpp" 36 | -------------------------------------------------------------------------------- /Learning_diary.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/Learning_diary.docx -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenGL 2 | ## A Learning diary of OpenGL 3 | ### Learning Base: https://learnopengl-cn.github.io/ 4 | 5 | OpenGL Music spectrogram: 6 | ![image](https://github.com/xiaobooo/OpenGL/blob/master/pic/Spectrum4.0.png) 7 | ![image](https://github.com/xiaobooo/OpenGL/blob/master/pic/Spectrum5.0.png) 8 | -------------------------------------------------------------------------------- /pic/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/pic/.DS_Store -------------------------------------------------------------------------------- /pic/Spectrum4.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/pic/Spectrum4.0.png -------------------------------------------------------------------------------- /pic/Spectrum5.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/pic/Spectrum5.0.png -------------------------------------------------------------------------------- /说明文档.pages: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobooo/OpenGL/d1a9fd03f95b3e6a49751c80a2983dc57aed20d5/说明文档.pages --------------------------------------------------------------------------------