Hi, I have a quick question that I can’t find the answer to… Is there a way to make the lines look nice using the glLines method, or some other method? Even when I set the glLineWidth to .5f or .1f it looks very blocky. Also it doesn’t change size as it gets further from the camera. Sorry if this is a stupid question, I can’t find the answer and am hoping someone can point me in the right direction to a simple and obvious solution. -sj
try this:
gl.glHint(GL.GL_LINE_SMOOTH_HINT, GL.GL_NICEST);
docu: http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/hint.html
Thanks Emzic,
this combo of enablings/hints seems to look the best.
gl.glEnable(GL.GL_LINE_SMOOTH);
gl.glHint(GL.GL_LINE_SMOOTH_HINT, GL.GL_NICEST);
gl.glEnable(GL.GL_BLEND);
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
gl.glLineWidth(.5f);
However, I can’t figure out a good way to get the lines to look correct at different distances. glLines seems to keep the width the same no matter what the distance from the camera. That is, I think that what I really want is a super-thin textured cylinder…
-sj
yes, a line will always have the same thickness no matter at what distance it is drawn. this is true for points as well.
with glPointparameter, it is possible to change the pointsize in proportion to de distance.
example
float linear[] = {0.0f, 0.12f, 0.0f};
gl.glPointParameterfv(GL.GL_POINT_DISTANCE_ATTENUATION, linear, 0);
This is not possible with lines.
Stupid question from me, if a cilinder is textured, do you stil see the lines?