OpenGL Assimp Shader 加载3DMax模型
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 575246 2011-05-27 01:20 OGLModelarm_dif.png
文件 866022 2011-05-27 01:41 OGLModelarm_showroom_ddn.png
文件 1667518 2011-05-27 01:20 OGLModelarm_showroom_spec.png
文件 636275 2011-05-27 01:20 OGLModelody_dif.png
文件 859857 2011-05-27 01:42 OGLModelody_showroom_ddn.png
文件 1767209 2011-05-27 01:20 OGLModelody_showroom_spec.png
文件 5429685 2014-12-13 02:28 OGLModelBulb.obj
文件 3951 2016-12-16 17:45 OGLModelCamera.h
文件 5988 2011-05-27 01:42 OGLModelglass_ddn.png
文件 1303 2011-05-27 01:20 OGLModelglass_dif.png
文件 655217 2011-05-27 01:20 OGLModelhand_dif.png
文件 999651 2011-05-27 01:44 OGLModelhand_showroom_ddn.png
文件 1741615 2011-05-27 01:20 OGLModelhand_showroom_spec.png
文件 525264 2011-05-27 01:20 OGLModelhelmet_diff.png
文件 746785 2011-05-27 01:44 OGLModelhelmet_showroom_ddn.png
文件 1565316 2011-05-27 01:20 OGLModelhelmet_showroom_spec.png
文件 1179745 2011-05-27 01:21 OGLModelleg_dif.png
文件 1370738 2011-05-27 01:44 OGLModelleg_showroom_ddn.png
文件 1772341 2011-05-27 01:21 OGLModelleg_showroom_spec.png
文件 201 2015-08-12 11:01 OGLModelLICENSE.txt
文件 9063 2016-12-19 15:45 OGLModelmain.cpp
文件 3976 2016-12-19 14:55 OGLModelmesh.h
文件 7725 2016-12-19 15:00 OGLModelmodel.h
文件 2970628 2014-07-17 11:41 OGLModel
anosuit.blend
文件 1396 2014-12-22 11:25 OGLModel
anosuit.mtl
文件 1854853 2014-07-17 14:07 OGLModel
anosuit.obj
文件 7558 2016-12-19 14:55 OGLModelOGLModel.vcxproj
文件 1325 2016-12-19 14:55 OGLModelOGLModel.vcxproj.filters
文件 179 2016-12-19 15:44 OGLModelShaderlamp_fragement
文件 349 2016-12-19 15:44 OGLModelShaderlamp_vertex
............此处省略9个文件信息
// Std. Includes
#include
// GLEW
#define GLEW_STATIC
#include
// GLFW
#include
// GL includes
#include “Shader.h“
#include “Camera.h“
#include “Model.h“
// GLM Mathemtics
#include
#include
#include
// Other Libs
#include
#pragma comment(lib “./SOIL.lib“)
#pragma comment (lib “opengl32.lib“)
#pragma comment (lib “glew32s.lib“)
#pragma comment (lib “glfw3.lib“)
#pragma comment (lib “glfw3dll.lib“)
#pragma comment (lib “glew32mxs.lib“)
#pragma comment (lib “assimp.lib“)
// Properties
GLuint screenWidth = 800 screenHeight = 600;
// Function prototypes
void key_callback(GLFWwindow* window int key int scancode int action int mode);
void scroll_callback(GLFWwindow* window double xoffset double yoffset);
void mouse_callback(GLFWwindow* window double xpos double ypos);
void Do_Movement();
// Camera
Camera camera(glm::vec3(0.0f 0.0f 3.0f));
bool keys[1024];
GLfloat lastX = 400 lastY = 300;
bool firstMouse = true;
GLfloat deltaTime = 0.0f;
GLfloat lastframe = 0.0f;
// The MAIN function from here we start our application and run the Game loop
int main()
{
// Init GLFW
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR 3);
glfwWindowHint(GLFW_OPENGL_PROFILE GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_RESIZABLE GL_FALSE);
GLFWwindow* window = glfwCreateWindow(screenWidth screenHeight “LearnOpenGL“ nullptr nullptr); // Windowed
glfwMakeContextCurrent(window);
// Set the required callback functions
glfwSetKeyCallback(window key_callback);
glfwSetCursorPosCallback(window mouse_callback);
glfwSetScrollCallback(window scroll_callback);
// Options
//glfwSetInputMode(window GLFW_CURSOR GLFW_CURSOR_DISABLED);
// Initialize GLEW to setup the OpenGL Function pointers
glewExperimental = GL_TRUE;
glewInit();
// Define the viewport dimensions
glViewport(0 0 screenWidth screenHeight);
// Setup some OpenGL options
glEnable(GL_DEPTH_TEST);
// Setup and compile our shaders
Shader shader(“./Shader/obj_vertex“ “./Shader/obj_fragement“);
Shader lampShader(“./Shader/lamp_vertex“ “./Shader/lamp_fragement“);
// Load models
Model ourModel(“./nanosuit.obj“);
// Used a lamp object here. Find one yourself on the internet or create your own one ;) (or be oldschool and set the VBO and VAO yourselves)
//Model lightBulb(“./Bulb.obj“);
Model lightBulb(“./nanosuit.obj“);
// Draw in wireframe
//glPolygonMode(GL_FRONT_AND_BACK GL_LINE);
// Point light positions
glm::vec3 pointLightPositions[] = {
glm::vec3(2.3f -1.6f -3.0f)
glm::vec3(-1.7f 0.9f 1.0f)
};
// Game loop
while (!glfwWindowShouldClose(window))
{
// Set frame time
GLfloat currentframe = glfwGetTime();
deltaTime = currentframe - lastframe;
las
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 575246 2011-05-27 01:20 OGLModelarm_dif.png
文件 866022 2011-05-27 01:41 OGLModelarm_showroom_ddn.png
文件 1667518 2011-05-27 01:20 OGLModelarm_showroom_spec.png
文件 636275 2011-05-27 01:20 OGLModelody_dif.png
文件 859857 2011-05-27 01:42 OGLModelody_showroom_ddn.png
文件 1767209 2011-05-27 01:20 OGLModelody_showroom_spec.png
文件 5429685 2014-12-13 02:28 OGLModelBulb.obj
文件 3951 2016-12-16 17:45 OGLModelCamera.h
文件 5988 2011-05-27 01:42 OGLModelglass_ddn.png
文件 1303 2011-05-27 01:20 OGLModelglass_dif.png
文件 655217 2011-05-27 01:20 OGLModelhand_dif.png
文件 999651 2011-05-27 01:44 OGLModelhand_showroom_ddn.png
文件 1741615 2011-05-27 01:20 OGLModelhand_showroom_spec.png
文件 525264 2011-05-27 01:20 OGLModelhelmet_diff.png
文件 746785 2011-05-27 01:44 OGLModelhelmet_showroom_ddn.png
文件 1565316 2011-05-27 01:20 OGLModelhelmet_showroom_spec.png
文件 1179745 2011-05-27 01:21 OGLModelleg_dif.png
文件 1370738 2011-05-27 01:44 OGLModelleg_showroom_ddn.png
文件 1772341 2011-05-27 01:21 OGLModelleg_showroom_spec.png
文件 201 2015-08-12 11:01 OGLModelLICENSE.txt
文件 9063 2016-12-19 15:45 OGLModelmain.cpp
文件 3976 2016-12-19 14:55 OGLModelmesh.h
文件 7725 2016-12-19 15:00 OGLModelmodel.h
文件 2970628 2014-07-17 11:41 OGLModel
anosuit.blend
文件 1396 2014-12-22 11:25 OGLModel
anosuit.mtl
文件 1854853 2014-07-17 14:07 OGLModel
anosuit.obj
文件 7558 2016-12-19 14:55 OGLModelOGLModel.vcxproj
文件 1325 2016-12-19 14:55 OGLModelOGLModel.vcxproj.filters
文件 179 2016-12-19 15:44 OGLModelShaderlamp_fragement
文件 349 2016-12-19 15:44 OGLModelShaderlamp_vertex
............此处省略9个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)