glDrawArray (how do you code it?)

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.

extra note
<<In "glDrawArray" what should be the first and last count, I've looked I'm kinda confused and the definition is currently confusing at the moment>>

So far I've done this... (my window is just blank)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <glut.h>
#include "my_modeldata.h"


void Draw()
{
	glClear(GL_COLOR_BUFFER_BIT);
	
	glEnableClientState(GL_VERTEX_ARRAY);
	glVertexPointer(3,GL_FLOAT,0,vertArray);
	glDrawArrays(GL_TRIANGLE_STRIP,0,4);
	//"vertArray" is my exported object
	//from 3Dmax
		
	glutPostRedisplay();
	glutSwapBuffers();//double buffering
}

void Init()
{	glClearColor(1.0,0.0,0.0,1.0);//background
	
    glEnable(GL_DEPTH_TEST);
    glDepthFunc(GL_LEQUAL);
    glShadeModel(GL_FLAT);

    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(600,600); 
	glutInitWindowPosition(250, 250);
	glutCreateWindow("ANIMATION AND LIGHTING");
	Init();
	glutDisplayFunc(Draw);
	glutMainLoop();
	return 0;
}


1
2
3
4
5
6
7
8
9
10
11
#define TRIANGLECOUNT 1024
#define VERTEXCOUNT 3072


//this is my header file with my 3d max object.



float vertArray[] = {

0.7,0,1.2,.............
Topic archived. No new replies allowed.