Jump to content


Want to do multiple viewport but failed...


11 replies to this topic

#1 kennyurge

    Member

  • Members
  • PipPip
  • 30 posts

Posted 29 March 2006 - 04:54 AM

I already did the walkthrough and i need to do another small viewport at the side of the main window, at the reshape function there, i set up my 1st viewport and the projection, then in the display function, i set the gluLookAt here because the camera position will be changed all the time. Then now i start set my 2nd viewport in the display function after the 1st gluLookAt, with the projection style and the camera postion(the gluLookAt). but the result is...i can't get anything in my display window now, just.....BLACK.......with nothin....all my object gone.....Can someone please help me and tell me which part i did it wrongly?


GLvoid ReSizeGLScene(GLsizei width, GLsizei height)		// Resize And Initialize The GL Window

{

	if (height==0)										// Prevent A Divide By Zero By

	{

		height=1;										// Making Height Equal One

	}

	

	winWidth = width;

	winHeight = height;


	glViewport(0,0,width,height);						// Reset The Current Viewport


	glMatrixMode(GL_PROJECTION);						// Select The Projection Matrix

	glLoadIdentity();									// Reset The Projection Matrix


	// Calculate The Aspect Ratio Of The Window

	gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,500.0f);


	glMatrixMode(GL_MODELVIEW);							// Select The Modelview Matrix

	glLoadIdentity();									// Reset The Modelview Matrix


}


int DrawGLScene(GLvoid)									// Here's Where We Do All The Drawing

{

	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);	// Clear Screen And Depth Buffer

	glLoadIdentity();									// Reset The Current Modelview Matrix


//NEW//////////////////NEW//////////////////NEW//////////////////NEW////////////////


	//gluLookAt(0,4.0f,150.0f, 0,3,0.0f, 0,1,0);


	gluLookAt(objCamera.mPos.x,  objCamera.mPos.y,  objCamera.mPos.z,	

			  objCamera.mView.x, objCamera.mView.y, objCamera.mView.z,	

			  objCamera.mUp.x,   objCamera.mUp.y,   objCamera.mUp.z);


// At here, set the second viewport at the right upper part

	glMatrixMode(GL_PROJECTION);

	glLoadIdentity();


	glViewport(winWidth/2, winHeight/2, winWidth/2, winHeight/2);


	glOrtho(0, winWidth, 0, winHeight, -3, 3);;


	glMatrixMode(GL_MODELVIEW);

	glLoadIdentity();


	gluLookAt(0.0, 50.0, 50.0, 0.0, 2.5, 50.0, 0.0, 1.0, 0.0);

.......

......

......

.....




#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 4979 posts
  • LocationBellevue, WA

Posted 29 March 2006 - 05:17 AM

I can't see anything obviously wrong, except the -3, 3 parameters to glOrtho seem a little suspicious given that the camera is at (0, 50, 50)....try expanding those near and far planes to something like 50 or 100. Also, where are you clearing the second viewport? If you've drawn into that area in the first viewport, you probably need to clear the depth buffer again for the second one.
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 kennyurge

    Member

  • Members
  • PipPip
  • 30 posts

Posted 29 March 2006 - 05:28 AM

Reedbeta said:

I can't see anything obviously wrong, except the -3, 3 parameters to glOrtho seem a little suspicious given that the camera is at (0, 50, 50)....try expanding those near and far planes to something like 50 or 100. Also, where are you clearing the second viewport? If you've drawn into that area in the first viewport, you probably need to clear the depth buffer again for the second one.

Do you mean before I set the 2nd viewport i need to place this line of code?

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);	// Clear Screen And Depth Buffer

	glLoadIdentity();			

to clear the buffer again?

I know there's something wrong with the glOrtho.....but....I think if this is the problem...then aren't it should be the right upper part will be blank or black then the original viewport can still c sth there?

Thanks for ur help and analysis...:worthy:

#4 kennyurge

    Member

  • Members
  • PipPip
  • 30 posts

Posted 29 March 2006 - 05:37 AM

kennyurge said:

Do you mean before I set the 2nd viewport i need to place this line of code?

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);	// Clear Screen And Depth Buffer

	glLoadIdentity();			

to clear the buffer again?

I know there's something wrong with the glOrtho.....but....I think if this is the problem...then aren't it should be the right upper part will be blank or black then the original viewport can still c sth there?

Thanks for ur help and analysis...:worthy:


I tried put the glClear again before i set the 2nd viewport...but still the same result.
Actually what i want is the right upper part will be the top view of the whole scene of my game, and it will show the current position of the user. Then the main viewport will be the user camera view and walking through the buildings and objects and enemies....

Sigh...even that simple 2nd viewport things suffer me up.....:wallbash:

#5 Mjolnir

    Member

  • Members
  • PipPip
  • 42 posts

Posted 29 March 2006 - 06:49 AM

Try this:

int DrawGLScene(GLvoid)

{

	glClear(GL_COLOR_BUFFER_BIT);

	glLoadIdentity();


        ...


	glViewport(winWidth/2, winHeight/2, winWidth/2, winHeight/2);

	glOrtho(0, winWidth, 0, winHeight, -3, 3);

        

        glClear (GL_DEPTH_BUFFER_BIT);

        ...

Clear the screen once, then clear the depth buffer before drawing EACH viewport (but AFTER setting it up!)

#6 kennyurge

    Member

  • Members
  • PipPip
  • 30 posts

Posted 29 March 2006 - 08:45 AM

Mjolnir said:

Try this:

int DrawGLScene(GLvoid)

{

	glClear(GL_COLOR_BUFFER_BIT);

	glLoadIdentity();


        ...


	glViewport(winWidth/2, winHeight/2, winWidth/2, winHeight/2);

	glOrtho(0, winWidth, 0, winHeight, -3, 3);

        

        glClear (GL_DEPTH_BUFFER_BIT);

        ...

Clear the screen once, then clear the depth buffer before drawing EACH viewport (but AFTER setting it up!)

After I change the code to be like this....the output......strange....there's something come out....but is the displayFont that I used in the program and it should be well align, but now it all mess up together...other than that...I can't see anything too....

int DrawGLScene(GLvoid)									// Here's Where We Do All The Drawing

{

	glClear(GL_COLOR_BUFFER_BIT);	// Clear Screen And Depth Buffer

	glLoadIdentity();									// Reset The Current Modelview Matrix


//NEW//////////////////NEW//////////////////NEW//////////////////NEW////////////////


	//gluLookAt(0,4.0f,150.0f, 0,3,0.0f, 0,1,0);


	gluLookAt(objCamera.mPos.x,  objCamera.mPos.y,  objCamera.mPos.z,	

			  objCamera.mView.x, objCamera.mView.y, objCamera.mView.z,	

			  objCamera.mUp.x,   objCamera.mUp.y,   objCamera.mUp.z);



// At here, set the second viewport at the right upper part

	glMatrixMode(GL_PROJECTION);

	glLoadIdentity();


	glViewport(winWidth/2, winHeight/2, winWidth/2, winHeight/2);


	glOrtho(0, winWidth, 0, winHeight, -50, 50);


	glClear(GL_DEPTH_BUFFER_BIT);	// Clear Screen And Depth Buffer


	glMatrixMode(GL_MODELVIEW);

	glLoadIdentity();


	gluLookAt(0.0, 50.0, 50.0, 0.0, 2.5, 50.0, 0.0, 1.0, 0.0);



Anyway...there's progress...I will still keep trying this and when I success, I'll llet you guys know about it.
Meantime...if anyone know what is the problem..Please teach me and help me troubleshoot it..I still left 2 big module not yet done and I hope can finish this as soon as possible... Thanks!:worthy: :yes:

#7 kennyurge

    Member

  • Members
  • PipPip
  • 30 posts

Posted 29 March 2006 - 11:03 AM

I think is my concept error...what i mean is...I not really understand how it runs...:blush:

Let me comfirm...I know this :

"glClear(GL_COLOR_BUFFER_BIT). It will clear the entire screen. Because we only want to clear the screen BEFORE ALL viewports are drawn, and before each viewport is drawn, we need to clear before the main loop that draws all viewports! Also notice that we are not clearing the depth buffer at the moment. It will be cleared on it's own before drawing each scene! It's VERY important that you clear the screen once, and then clear the depth buffer before drawing each viewport."
(found from net)

Question:
1)Before drawing each viewport...which command draw the viewport? is it glViewport? If yes, then why the glClear(GL_DEPTH_BUFFER_BIT) write after glViewport and not before glViewport?

//Should place here??

glClear(GL_DEPTH_BUFFER_BIT);   //Then it's "before" the glViewport


glViewport(_,_,_,_);


//or should be at here?

glClear(GL_DEPTH_BUFFER_BIT);   //Then it's "after" the glViewport

2)is it the correct way that the 1st viewport(glViewport) should be written in reshape function?then because of the camera will change all the time-->therefore write in display function? If yes, then why in the display function only will clear the color buffer once and not placing the glClear(GL_COLOR_BUFFER_BIT) in the reshape function?

Sorry if i asked stupid question but I really done some reading but just confuse with it:wacko:

Here, I post again my code...

GLvoid ReSizeGLScene(GLsizei width, GLsizei height)		// Resize And Initialize The GL Window

{

	if (height==0)										// Prevent A Divide By Zero By

	{

		height=1;										// Making Height Equal One

	}

	

	winWidth = width;

	winHeight = height;


	glViewport(0,0,width,height);						// Reset The Current Viewport


	glMatrixMode(GL_PROJECTION);						// Select The Projection Matrix

	glLoadIdentity();									// Reset The Projection Matrix


	// Calculate The Aspect Ratio Of The Window

	gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,500.0f);


	glMatrixMode(GL_MODELVIEW);							// Select The Modelview Matrix

	glLoadIdentity();									// Reset The Modelview Matrix


}


int DrawGLScene(GLvoid)									// Here's Where We Do All The Drawing

{

	

	glClear(GL_COLOR_BUFFER_BIT);	// Clear Screen And Depth Buffer

	glLoadIdentity();									// Reset The Current Modelview Matrix


	glMatrixMode(GL_PROJECTION);						// Select The Projection Matrix

	glLoadIdentity();									// Reset The Projection Matrix

	glViewport(0,0,winWidth,winHeight);						// Reset The Current Viewport




	// Calculate The Aspect Ratio Of The Window

	gluPerspective(45.0f,(GLfloat)winWidth/(GLfloat)winHeight,0.1f,500.0f);


	glMatrixMode(GL_MODELVIEW);							// Select The Modelview Matrix

	glLoadIdentity();									// Reset The Modelview Matrix



	//gluLookAt(0,4.0f,150.0f, 0,3,0.0f, 0,1,0);


	gluLookAt(objCamera.mPos.x,  objCamera.mPos.y,  objCamera.mPos.z,	

			  objCamera.mView.x, objCamera.mView.y, objCamera.mView.z,	

			  objCamera.mUp.x,   objCamera.mUp.y,   objCamera.mUp.z);

	glClear(GL_DEPTH_BUFFER_BIT);	// Clear Screen And Depth Buffer


// At here, set the second viewport at the right upper part

	glMatrixMode(GL_PROJECTION);

	glLoadIdentity();


	glViewport(winWidth/2, winHeight/2, winWidth/2, winHeight/2);


	glOrtho(0, winWidth, 0, winHeight, -50, 50);



	glMatrixMode(GL_MODELVIEW);

	glLoadIdentity();


	gluLookAt(0.0, 50.0, 50.0, 0.0, 2.5, 50.0, 0.0, 1.0, 0.0);

	glClear(GL_DEPTH_BUFFER_BIT);	// Clear Screen And Depth Buffer



Draw_Grid();

Draw_BoundingBox();	

....

...

...}


Thanks again~:worthy:

#8 Mjolnir

    Member

  • Members
  • PipPip
  • 42 posts

Posted 29 March 2006 - 11:43 AM

1) As long as you clear it before the actual DRAWING, you're fine ;)

2) Anything other than maintaining those size variables in ReSizeGLScene seems redundant to me now that you've rearranged it.
Code looks fine now, but you'll want to draw the 'big' scene after the 1st 'glClear(GL_DEPTH_BUFFER_BIT)', right?
Also, isn't it 'glOrtho(0, winWidth/2, winHeight/2, 0, -50.0f, 50.0f)' that you're after?

#9 kennyurge

    Member

  • Members
  • PipPip
  • 30 posts

Posted 29 March 2006 - 01:17 PM

Mjolnir said:

1) As long as you clear it before the actual DRAWING, you're fine ;)

2) Anything other than maintaining those size variables in ReSizeGLScene seems redundant to me now that you've rearranged it.
Code looks fine now, but you'll want to draw the 'big' scene after the 1st 'glClear(GL_DEPTH_BUFFER_BIT)', right?
Also, isn't it 'glOrtho(0, winWidth/2, winHeight/2, 0, -50.0f, 50.0f)' that you're after?

...........:blush:
I not really understand what u mean...:blush: :blush:
do u mean the reshape function already contains glViewport and I did it again in display function (after the 1st gluLookAt) is redundant?
ya, the 1st glViewport will show the big scene(the walkthrough of the buildings in game) and the 2nd viewport will show the top view of the whole scene to let user know where is the user's current position.

:blush: I still not really familiar with openGL so the glOrtho maybe set wrongly...even the parameters for gluLookAt I also not sure whether it's right or wrong....In my mind is that I want to do seperate viewport 1st(means the 1st viewport will show the walkthrough-->the 1st player view, like Counter Strike) and for the 2nd viewport...even it will only show the blank screen will be fine...bcoz i can adjust the parameters after that.

And~please allow my venture request...Can you please correct me from the code(i mean...correct my code and 'code' it) so that i will clearly know which part i need to be changed.
If can~:blush: my codes are ready for you to have a look....I can send it to you if you don't mind..:blush: :blush:

#10 Mjolnir

    Member

  • Members
  • PipPip
  • 42 posts

Posted 29 March 2006 - 03:14 PM

All I can do is show you a sample: stick this into Lesson3.cpp (as I see you're starting from NeHe code ;))

// Modified Lesson3 Code For kennyurge

...

UINT winWidth, winHeight;
...
GLUquadricObj *quadric;

GLvoid ReSizeGLScene(GLsizei width, GLsizei height)
{
	if (height==0)
	{
		height=1;
        }

	winWidth = width;
	winHeight = height;
}

int InitGL(GLvoid)
{
	glShadeModel(GL_SMOOTH);
	glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
	glClearDepth(1.0f);
	glEnable(GL_DEPTH_TEST);
	glDepthFunc(GL_LEQUAL);
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

	quadric=gluNewQuadric();

	return TRUE;										// Initialization Went OK
}

int DrawGLScene(GLvoid)
{
	glClear(GL_COLOR_BUFFER_BIT); // Clear The Color Buffer

	glViewport(0, 0, winWidth, winHeight); // Setup The Back Viewport
	glMatrixMode(GL_PROJECTION); // Setup Its Projection
	glLoadIdentity();
	gluPerspective(45.0, (GLfloat)(winWidth)/(GLfloat)(winHeight), 0.1f, 500.0); 

	glMatrixMode(GL_MODELVIEW); // Switch To Modelview
	glLoadIdentity();
	glClear(GL_DEPTH_BUFFER_BIT); // Clear The Depth Buffer

		glTranslatef(-1.0f,0.0f,-10.0f); // Do Some Drawing
		glRotatef(45,1.0f,0.0f,0.0f);

		glColor3f(255.0f, 0.0f, 0.0f);
		glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); // Wire...
			gluSphere(quadric,3.0f,32,32);
		glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); // And Back To Solid

	////////////////////////////////////////////////////// On To The 2nd Viewport

	// Setup The TopRight Viewport
	glViewport(winWidth/2, winHeight/2, winWidth/2, winHeight/2);
	glMatrixMode(GL_PROJECTION); // Setup Its Projection
	glLoadIdentity();
	glOrtho(0, winWidth/2, 0, winHeight/2, -50.0f, 50.0f);
	
	glMatrixMode(GL_MODELVIEW); // Switch To Modelview
	glLoadIdentity();
	glClear(GL_DEPTH_BUFFER_BIT); // Clear The Depth Buffer

		glColor3f(255.0f, 255.0f, 0.0f); // Just Fill it With A Quad
		glBegin(GL_QUADS);
			glVertex2i(winWidth/2, 0);
			glVertex2i(0, 0);
			glVertex2i(0, winHeight/2);
			glVertex2i(winWidth/2, winHeight/2);
		glEnd();

		glColor3f(0.0f, 0.0f, 100.0f); // And A Tri Inside
		glBegin(GL_TRIANGLES);
			glVertex2i(50, 150);
			glVertex2i(10, 40);
			glVertex2i(300, 50);
		glEnd();
	
	return TRUE;
}

GLvoid KillGLWindow(GLvoid)
{
...


#11 kennyurge

    Member

  • Members
  • PipPip
  • 30 posts

Posted 29 March 2006 - 03:42 PM

Mjolnir said:

All I can do is show you a sample: stick this into Lesson3.cpp (as I see you're starting from NeHe code ;))

// Modified Lesson3 Code For kennyurge

...

UINT winWidth, winHeight;
...
GLUquadricObj *quadric;

GLvoid ReSizeGLScene(GLsizei width, GLsizei height)
{
	if (height==0)
	{
		height=1;
        }

	winWidth = width;
	winHeight = height;
}

int InitGL(GLvoid)
{
	glShadeModel(GL_SMOOTH);
	glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
	glClearDepth(1.0f);
	glEnable(GL_DEPTH_TEST);
	glDepthFunc(GL_LEQUAL);
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

	quadric=gluNewQuadric();

	return TRUE;										// Initialization Went OK
}

int DrawGLScene(GLvoid)
{
	glClear(GL_COLOR_BUFFER_BIT); // Clear The Color Buffer

	glViewport(0, 0, winWidth, winHeight); // Setup The Back Viewport
	glMatrixMode(GL_PROJECTION); // Setup Its Projection
	glLoadIdentity();
	gluPerspective(45.0, (GLfloat)(winWidth)/(GLfloat)(winHeight), 0.1f, 500.0); 

	glMatrixMode(GL_MODELVIEW); // Switch To Modelview
	glLoadIdentity();
	glClear(GL_DEPTH_BUFFER_BIT); // Clear The Depth Buffer

        gluLookAt(_,_,_,_,_,_,_,_,_);
/*
		glTranslatef(-1.0f,0.0f,-10.0f); // Do Some Drawing
		glRotatef(45,1.0f,0.0f,0.0f);

		glColor3f(255.0f, 0.0f, 0.0f);
		glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); // Wire...
			gluSphere(quadric,3.0f,32,32);
		glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); // And Back To Solid
*/

	////////////////////////////////////////////////////// On To The 2nd Viewport

	// Setup The TopRight Viewport
	glViewport(winWidth/2, winHeight/2, winWidth/2, winHeight/2);
	glMatrixMode(GL_PROJECTION); // Setup Its Projection
	glLoadIdentity();
	glOrtho(0, winWidth/2, 0, winHeight/2, -50.0f, 50.0f);
	
	glMatrixMode(GL_MODELVIEW); // Switch To Modelview
	glLoadIdentity();
	glClear(GL_DEPTH_BUFFER_BIT); // Clear The Depth Buffer
      
        gluLookAt(_,_,_,_,_,_,_,_,_);

	/*	glColor3f(255.0f, 255.0f, 0.0f); // Just Fill it With A Quad
		glBegin(GL_QUADS);
			glVertex2i(winWidth/2, 0);
			glVertex2i(0, 0);
			glVertex2i(0, winHeight/2);
			glVertex2i(winWidth/2, winHeight/2);
		glEnd();

		glColor3f(0.0f, 0.0f, 100.0f); // And A Tri Inside
		glBegin(GL_TRIANGLES);
			glVertex2i(50, 150);
			glVertex2i(10, 40);
			glVertex2i(300, 50);
		glEnd();
*/
	
	return TRUE;
}

GLvoid KillGLWindow(GLvoid)
{
...

Ohh...can i replace the drawing coding with two different gluLookAt position?
like setting two camera and each for one viewport?
By the way....how you know I refer to Nehe code???:blush: :blush: :blush:

#12 kennyurge

    Member

  • Members
  • PipPip
  • 30 posts

Posted 29 March 2006 - 04:14 PM

:wallbash: :wallbash: :wallbash: :wallbash: :wallbash:
Ialready combine your code and replace the drawing part with the gluLookAt and it still can't...still get the results that I posted before....not blank...but with some mess up text....

Do you think providing you the full coding will make you see clearer where is the problem?

I.....I............:sad:

desperate........:wallbash: :wallbash: :wallbash:

int DrawGLScene(GLvoid)									// Here's Where We Do All The Drawing

{

	glClear(GL_COLOR_BUFFER_BIT); // Clear The Color Buffer


	glViewport(0, 0, winWidth, winHeight); // Setup The Back Viewport

	glMatrixMode(GL_PROJECTION); // Setup Its Projection

	glLoadIdentity();

	gluPerspective(45.0, (GLfloat)(winWidth)/(GLfloat)(winHeight), 0.1f, 500.0); 


	glMatrixMode(GL_MODELVIEW); // Switch To Modelview

	glLoadIdentity();

	glClear(GL_DEPTH_BUFFER_BIT); // Clear The Depth Buffer

/*	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);	// Clear Screen And Depth Buffer


	glLoadIdentity();									// Reset The Current Modelview Matrix


	glMatrixMode(GL_PROJECTION);						// Select The Projection Matrix

	glLoadIdentity();									// Reset The Projection Matrix

	glViewport(0,0,winWidth,winHeight);						// Reset The Current Viewport




	// Calculate The Aspect Ratio Of The Window

	gluPerspective(45.0f,(GLfloat)winWidth/(GLfloat)winHeight,0.1f,500.0f);


	glMatrixMode(GL_MODELVIEW);							// Select The Modelview Matrix

	glLoadIdentity();									// Reset The Modelview Matrix

*/


	//gluLookAt(0,4.0f,150.0f, 0,3,0.0f, 0,1,0);


	gluLookAt(objCamera.mPos.x,  objCamera.mPos.y,  objCamera.mPos.z,	

			  objCamera.mView.x, objCamera.mView.y, objCamera.mView.z,	

			  objCamera.mUp.x,   objCamera.mUp.y,   objCamera.mUp.z);

/*	glClear(GL_DEPTH_BUFFER_BIT);	// Clear Screen And Depth Buffer


// At here, set the second viewport at the right upper part

	glMatrixMode(GL_PROJECTION);

	glLoadIdentity();


	glViewport(winWidth/2, winHeight/2, winWidth/2, winHeight/2);


	glOrtho(0, winWidth, 0, winHeight, -50, 50);



	glMatrixMode(GL_MODELVIEW);

	glLoadIdentity();


	gluLookAt(0.0, 50.0, 50.0, 0.0, 2.5, 50.0, 0.0, 1.0, 0.0);

	glClear(GL_DEPTH_BUFFER_BIT);	// Clear Screen And Depth Buffer

*/

	// Setup The TopRight Viewport

	glViewport(winWidth/2, winHeight/2, winWidth/2, winHeight/2);

	glMatrixMode(GL_PROJECTION); // Setup Its Projection

	glLoadIdentity();

	glOrtho(0, winWidth/2, 0, winHeight/2, -50.0f, 50.0f);

	

	glMatrixMode(GL_MODELVIEW); // Switch To Modelview

	glLoadIdentity();

	glClear(GL_DEPTH_BUFFER_BIT); // Clear The Depth Buffer


		gluLookAt(0.0, 50.0, 50.0, 0.0, 2.5, 50.0, 0.0, 1.0, 0.0);


Draw_Grid();

Draw_BoundingBox();	


glRasterPos3f(objCamera.mView.x, objCamera.mPos.y+20, objCamera.mView.z);

glPrint("X - %3.5f", objCamera.mPos.x);	// Print GL Text To The Screen


glRasterPos3f(objCamera.mView.x, objCamera.mPos.y+15, objCamera.mView.z);

glPrint("Y - %3.5f", objCamera.mPos.y);	// Print GL Text To The Screen


glRasterPos3f(objCamera.mView.x, objCamera.mPos.y+10, objCamera.mView.z);

glPrint("Z - %3.5f", objCamera.mPos.z);	// Print GL Text To The Screen



glRasterPos3f(objCamera.mView.x, objCamera.mPos.y+5, objCamera.mView.z);

glPrint("displayPart - %2.2f", displayPart);	// Print GL Text To The Screen

//The glPrint should display text on the screen and that's the text that messed up

.....

....

....

//after this will be the coding that rendering models which built with 3D modeling software ....


}

:surrender what to do~~~~





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users