Go Back   AC3D Forums > Technical > AC3D Developers
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 1st March 2005, 03:05 AM   #1
briandavis
Junior Member
Member
 
Join Date: Jul 2004
Posts: 10
Default 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
briandavis is offline   Reply With Quote
Old 1st March 2005, 03:41 AM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default

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
Andy is offline   Reply With Quote
Old 10th March 2005, 03:42 PM   #3
briandavis
Junior Member
Member
 
Join Date: Jul 2004
Posts: 10
Default

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
briandavis is offline   Reply With Quote
Old 15th March 2005, 03:14 AM   #4
Gernot
Member
Expert member
 
Gernot's Avatar
 
Join Date: Mar 2004
Location: Germany
Posts: 75
Default

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
Gernot is offline   Reply With Quote
Old 15th March 2005, 02:12 PM   #5
briandavis
Junior Member
Member
 
Join Date: Jul 2004
Posts: 10
Default

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
briandavis is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 09:27 AM.


AC3D Forum
(C) Inivis Limited 2020