Line widths

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?



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);

You might get better results using something like this:

– Tom

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?


glDisable( GL_CULL_FACE );

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