• 大小: 989KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-13
  • 语言: 其他
  • 标签: opengl  

资源简介

http://blog.csdn.net/j0939115399/article/details/74656672

资源截图

代码片段和文件信息

/// @ref core
/// @file glm/core/dummy.cpp
///
/// GLM is a header only library. There is nothing to compile. 
/// dummy.cpp exist only a wordaround for CMake file.

/*
#define GLM_MESSAGES
#include 
#include 
#include 

struct material
{
glm::vec4 emission; // Ecm
glm::vec4 ambient; // Acm
glm::vec4 diffuse; // Dcm
glm::vec4 specular; // Scm
float shininess; // Srm
};

struct light
{
glm::vec4 ambient; // Acli
glm::vec4 diffuse; // Dcli
glm::vec4 specular; // Scli
glm::vec4 position; // Ppli
glm::vec4 halfVector; // Derived: Hi
glm::vec3 spotDirection; // Sdli
float spotExponent; // Srli
float spotCutoff; // Crli
// (range: [0.090.0] 180.0)
float spotCosCutoff; // Derived: cos(Crli)
// (range: [1.00.0]-1.0)
float constantAttenuation; // K0
float linearAttenuation; // K1
float quadraticAttenuation;// K2
};


// Sample 1
#include // glm::vec3
#include // glm::cross glm::normalize

glm::vec3 computeNormal

glm::vec3 const & a
glm::vec3 const & b
glm::vec3 const & c

{
return glm::normalize(glm::cross(c - a b - a));
}

typedef unsigned int GLuint;
#define GL_FALSE 0
void glUniformMatrix4fv(GLuint int int float*){}

// Sample 2
#include  // glm::vec3
#include  // glm::vec4 glm::ivec4
#include  // glm::mat4
#include  // glm::translate glm::rotate glm::scale glm::perspective
#include  // glm::value_ptr
void func(GLuint LocationMVP float Translate glm::vec2 const & Rotate)
{
glm::mat4 Projection = glm::perspective(45.0f 4.0f / 3.0f 0.1f 100.f);
glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.0f) glm::vec3(0.0f 0.0f -Translate));
glm::mat4 ViewRotateX = glm::rotate(ViewTranslate Rotate.y glm::vec3(-1.0f 0.0f 0.0f));
glm::mat4 View = glm::rotate(ViewRotateX Rotate.x glm::vec3(0.0f 1.0f 0.0f));
glm::mat4 Model = glm::scale(glm::mat4(1.0f) glm::vec3(0.5f));
glm::mat4 MVP = Projection * View * Model;
glUniformMatrix4fv(LocationMVP 1 GL_FALSE glm::value_ptr(MVP));
}

// Sample 3
#include // glm::vec2
#include // glm::packUnorm2x16
#include // glm::uint
#include // glm::i8vec2 glm::i32vec2
std::size_t const VertexCount = 4;
// Float quad geometry
std::size_t const PositionSizeF32 = VertexCount * sizeof(glm::vec2);
glm::vec2 const PositionDataF32[VertexCount] =
{
glm::vec2(-1.0f-1.0f)
glm::vec2( 1.0f-1.0f)
glm::vec2( 1.0f 1.0f)
glm::vec2(-1.0f 1.0f)
};
// Half-float quad geometry
std::size_t const PositionSizeF16 = VertexCount * sizeof(glm::uint);
glm::uint const PositionDataF16[VertexCount] =
{
glm::uint(glm::packUnorm2x16(glm::vec2(-1.0f -1.0f)))
glm::uint(glm::packUnorm2x16(glm::vec2( 1.0f -1.0f)))
glm::uint(glm::packUnorm2x16(glm::vec2( 1

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-07-07 11:54  opengl\
     目录           0  2017-07-07 11:54  opengl\build\
     目录           0  2017-07-24 13:01  opengl\build\include\
     目录           0  2017-07-07 12:32  opengl\build\include\GL\
     目录           0  2017-07-24 13:06  opengl\build\include\glm\
     文件          94  2017-01-05 05:42  opengl\build\include\glm\common.hpp
     目录           0  2017-07-24 13:01  opengl\build\include\glm\detail\
     文件        5823  2017-01-22 19:12  opengl\build\include\glm\detail\dummy.cpp
     文件       22879  2017-01-22 19:12  opengl\build\include\glm\detail\func_common.hpp
     文件       30092  2017-01-22 19:12  opengl\build\include\glm\detail\func_common.inl
     文件        6560  2017-01-22 19:12  opengl\build\include\glm\detail\func_common_simd.inl
     文件        5548  2017-01-22 19:12  opengl\build\include\glm\detail\func_exponential.hpp
     文件        4763  2017-01-22 19:12  opengl\build\include\glm\detail\func_exponential.inl
     文件         827  2017-01-22 19:12  opengl\build\include\glm\detail\func_exponential_simd.inl
     文件        4979  2017-01-22 19:12  opengl\build\include\glm\detail\func_geometric.hpp
     文件        8388  2017-01-22 19:12  opengl\build\include\glm\detail\func_geometric.inl
     文件        2693  2017-01-22 19:12  opengl\build\include\glm\detail\func_geometric_simd.inl
     文件       10319  2017-01-22 19:12  opengl\build\include\glm\detail\func_integer.hpp
     文件       15797  2017-01-22 19:12  opengl\build\include\glm\detail\func_integer.inl
     文件        1764  2017-01-22 19:12  opengl\build\include\glm\detail\func_integer_simd.inl
     文件        5403  2017-01-22 19:12  opengl\build\include\glm\detail\func_matrix.hpp
     文件       13591  2017-01-22 19:12  opengl\build\include\glm\detail\func_matrix.inl
     文件        2820  2017-01-22 19:12  opengl\build\include\glm\detail\func_matrix_simd.inl
     文件       10882  2017-01-05 05:42  opengl\build\include\glm\detail\func_packing.hpp
     文件        3026  2017-01-05 05:42  opengl\build\include\glm\detail\func_packing.inl
     文件         139  2017-01-05 05:42  opengl\build\include\glm\detail\func_packing_simd.inl
     文件        9645  2017-01-22 19:12  opengl\build\include\glm\detail\func_trigonometric.hpp
     文件        6099  2017-01-22 19:12  opengl\build\include\glm\detail\func_trigonometric.inl
     文件           0  2017-01-05 05:42  opengl\build\include\glm\detail\func_trigonometric_simd.inl
     文件        5905  2017-01-22 19:12  opengl\build\include\glm\detail\func_vector_relational.hpp
     文件        3215  2017-01-22 19:12  opengl\build\include\glm\detail\func_vector_relational.inl
............此处省略263个文件信息

评论

共有 条评论