PDA

View Full Version : about separate bar of different views



01-17-2003, 08:03 AM
How can I use OpenGL Command to draw a separate bar to separate different windows shown on the view? (i draw different views using different viewport in the same window, but i want to separate it by a line)

I've tried GL_LINES, but it doesn't appear on the screen.

thanks for your kindly help.

Coconut
01-17-2003, 08:06 AM
Originally posted by gentlement:
How can I use OpenGL Command to draw a separate bar to separate different windows shown on the view? (i draw different views using different viewport in the same window, but i want to separate it by a line)

I've tried GL_LINES, but it doesn't appear on the screen.

thanks for your kindly help.

It is hard to guess what the problem is without more information.
Maybe your bars are outside the viewport?
Maybe the depth test failed?

01-17-2003, 08:17 AM
well...i mean, i use 2 quads to separate the 2 views

does this works fine?
glBegin(GL_LINES);
glVertex2f(width/2, height);
glVertex2f(width/2, .0);
glEng();

I don't know because glVertex seems drawing with the 3D space coordinate while...i need a bar according to the coordinate on the "screen"

Coconut
01-17-2003, 08:45 AM
Originally posted by gentlement:


I don't know because glVertex seems drawing with the 3D space coordinate while...i need a bar according to the coordinate on the "screen"



Yes. The standard way is to set your projection matrix using gluOrtho2D.

Coconut
01-17-2003, 08:47 AM
Originally posted by gentlement:
well...i mean, i use 2 quads to separate the 2 views

does this works fine?
glBegin(GL_LINES);
glVertex2f(width/2, height);
glVertex2f(width/2, .0);
glEng();

I don't know because glVertex seems drawing with the 3D space coordinate while...i need a bar according to the coordinate on the "screen"



http://www.opengl.org/developers/faqs/technical/transformations.htm#tran0030

01-17-2003, 08:57 AM
Excellent.
Thanks so much =)