我有两个.obj文件(bunny_low.obj),(bunny_high.obj),我需要帮助来加载这两个obj文件
此外,我必须保留它,我的意思是它应该在头文件或源文件上?
这是代码
#include <iostream>
#ifdef WIN32
#include <windows.h>
#endif
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <math.h>
#ifdef __APPLE__
#include <GLUT/glut.h>
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/glut.h>
#include <GL/glu.h>
#include <GL/gl.h>
#endif
using namespace std;
#include "callbackFunctions.h"
int main(int argc, char * argv[]) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH|GLUT_RGB|GLUT_SINGLE);
glutInitWindowSize(640, 480);
glutInitWindowPosition(200, 100);
glutCreateWindow("Bunny");
glClearColor(0, 0, 0, 0);
glEnable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-0.4, 0.4, -0.4 * .48 / .64, 0.4 * .48 / .64, 2, 10);
gluLookAt( 0, 0, 5, 0, 0.2, 0, 0, 1, 0);
glutDisplayFunc(onDisplay);
glutMouseFunc(onMouse);
glutMotionFunc(onMouseMotion);
glutKeyboardFunc(onKeyboard);
glutMainLoop();
return 0;
}
由于