In short, I have a 3Dmax file I exported and wanted to simply display it. I had to remove textures… all stuff that might make it complicated.
So far I’ve done this… (its not working)
#include <glut.h>
#include "my_modeldata.h"
GLfloat gfPosX = 0.0;//they control animation
GLfloat gfDeltaX = .0001;//determins the rate of change
void Draw()
{
glClear(GL_COLOR_BUFFER_BIT);
glEnableClientState(GL_VERTEX_ARRAY);
glDrawArrays(GL_TRIANGLE_STRIP,0,4);
glVertexPointer(3,GL_FLOAT,0,vertArray);
//"vertArray" is my exported object
//from 3Dmax
glutPostRedisplay();
glutSwapBuffers();//double buffering
}
void Init()
{ glClearColor(0.0,0.0,0.0,0.0);//background
glMatrixMode(GL_PROJECTION);//??do research on it
glLoadIdentity();
glOrtho(0.0, 1.0,0.0,1.0,-1.0,1.0);
glEnableClientState(GL_NORMAL_ARRAY);
}
int main()
{
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(250, 250);
glutInitWindowPosition(250, 250);
glutCreateWindow("ANIMATION AND LIGHTING");
Init();
glutDisplayFunc(Draw);
glutMainLoop();
return 0;
}
#define TRIANGLECOUNT 1024
#define VERTEXCOUNT 3072
//this is my header file with my 3d max object.
float vertArray[] = {
0.7,0,1.2,.............