|
1st March 2005, 03:05 AM | #1 |
Junior Member
Member
Join Date: Jul 2004
Posts: 10
|
glLineWidth question
Hi,
I'm needing to render a scene in a 2:1 aspect ratio. The tricky part is that vertical lines must be twice as thick as horizontal lines. Diagonal lines would share the same basic rule (i.e. a line from (0, 0) to (3, 3) would take up an area of 6 x 3.) Is this possible with OpenGL? I've tried using glLineWidth(2), but this effects the overall width of the line. I've got the matrices set up properly so that (1, 1) is actually displayed at (2, 1). I just can't seem to get the line(s) to draw like I need them to. :? TIA, Brian |
1st March 2005, 03:41 AM | #2 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,565
|
The matricies won't affect the opengl line width. Neither will aspect ratios and viewport settings.
You'll probably need to draw rectangles/polygons to get a specific thickness. Andy |
10th March 2005, 03:42 PM | #3 |
Junior Member
Member
Join Date: Jul 2004
Posts: 10
|
Andy,
Thanks for the reply. I have solved the problem I was having by using a combination of glReadPixels, glPixelZoom, and glDrawPixels. I had originally been given the advice to use glCopyPixels, but that turned out to be really slow. - Brian |
15th March 2005, 03:14 AM | #4 |
Member
Expert member
Join Date: Mar 2004
Location: Germany
Posts: 75
|
glReadPixels and the like are on most hardware very slow - depends strongly on the driver. What exactly are you trying to do? Outlines?
__________________
www.GLBasic.com |
15th March 2005, 02:12 PM | #5 |
Junior Member
Member
Join Date: Jul 2004
Posts: 10
|
I've stumbled upon a workable solution to my problem using a combination of glReadPixels, glPixelZoom, and glDrawPixels. For whatever reason, copying directly to the front buffer using glPixelZoom is terribly slow. However, copying using glReadPixels, glPixelZoom, and glDrawPixels is substantially faster than the glCopyPixels method.
Not quite sure what the performance hit is from, but I have found a way around it. Thanks. Incidentally, my application is taking a pre-rendered buffer and adding 2D text to it. A post-rendering step then stretches the entire buffer 2:1. - Brian |
|
|