PDA

View Full Version : Line widths



dodgyposse
01-09-2002, 11:06 PM
I am writing a space trading simulation,
and have written some code to draw a tractor
beam between two objects.

Basically, it takes the delta vector between the two, fragments it into N pieces, and to the end point of each subvector, adds a little randomness.

I am drawing several of these for the beam,
and wanted them to be of different widths.

Strangely, even though I am specifying line widths of 100.0, the line seems to have a maximum thickness of around 5 to 10 pixels.

i.e glLineWidth( 100.0)

Is this the video card doing this?

Does anyone know a way around this?

Thanks
Del

dd

NitroGL
01-09-2002, 11:49 PM
Yeah, it's the card that's doing it (more likely the drivers though), I don't think you can get around it though.

You can get the max line width by doing:
float maxlinewidth;
glGetFloatv(GL_LINE_WIDTH_RANGE, &maxlinewidth);

Tom Nuydens
01-10-2002, 12:19 AM
You might get better results using something like this: http://www.b500.com/~hplus/laserbolt/

-- Tom

dodgyposse
01-11-2002, 05:21 AM
Ok, I've implemented that technique....
don't you have to know whether the object is to your left or right in order for this to work correctly?

i.e the left end of the bolt and right end will be on the wrong side of the centre bolt

Also, there is a situation, where the camera position means you can't see the central quad, as the texture coordinates are wound anti clockwise instead of clockwise????

how do I get round that?

i.e there some mode of texturing, which makes the texture visible on both sides of the quad?


dd

jwatte
01-11-2002, 09:05 AM
glDisable( GL_CULL_FACE );

Make sure to turn it back on when you want to draw single-sided again :-)