Smooth wireframe

hi there,



i just wanted to ask if you could add a setSmooth(boolean) method to the WireframeState. when applying the state it would do a GL11.glEnable(GL11.GL_LINE_SMOOTH); that would enable drawing nicer wireframes ( i need that )



thanks

Created the issue, which is half the work in this case:



https://jme.dev.java.net/issues/show_bug.cgi?id=182



Will check this in after dinner unless someone knows a good reason not to.

Hm, on closer inspection, the lines just appear thicker, not very smooth at all. A quick search suggests modern Ati cards might not support this feature:



http://lists.apple.com/archives/mac-opengl/2003/Oct/msg00061.html



Ran it on an ATi X700 card here.

Here’s what it looks like on my card (normal and “smoothed”):







I also tried adding GL11.glHint(GL11.GL_LINE_SMOOTH_HINT, GL11.GL_NICEST); but it didn’t improve.



I doubt this was the effect you were after, right Sfera? Is it still worth checking this in for you if it doesn’t work on half of the cards out there? I have make a last check it doesn’t affect drawing a regular Line, then I could check it in.

well, you're right llama, that's not the effect i wanted to have. i tested it myself (nvidia geforce fx) and i got the same results - the line is just a bit thicker (effect which can be achieved by setting the line width).

well, at least we know now for sure  :smiley:



sorry for all this mess

Ah, this might require an Alphastate to look right! Let me try that first before we give up on this :slight_smile:



Seems to work. I'll update the screenshot and check in the changes.

Ok, I checked this in. See the new method setAntialiased in WireFrameState, and pay attention to the javadoc.







code I used for making this screenshot:



Sphere sphere1 = new Sphere("Sphere1", 33, 25, 15);
sphere1.setLocalTranslation(new Vector3f(-15, -10,-40));
sphere1.setModelBound(new BoundingBox());
sphere1.updateModelBound();
rootNode.attachChild(sphere1);