|
Using the LineAttributes to implement Antialiasing |
|
|
The LineAttributes object defines all rendering state that can be set as a
component object of a Shape3D node.The line attributes that can be defined
are:
- Pattern
- Antialiasing (enabled or disabled)
- Width (in pixels)
This program illustrates antialiasing by the LineAttributes.
public class AntialiasingExample extends JFrame {
public AntialiasingExample() {
...
}
public BranchGroup createSceneGraph() {
BranchGroup objRoot = new BranchGroup();
...
objRoot.addChild(new Shape3D(createGeometry(),createAppearance()));
...
return objRoot;
}
private Geometry createGeometry(){
...
}
private Appearance createAppearance(){
Appearance appear=new Appearance();
LineAttributes la=new LineAttributes();
// Enable line antialiasing
la.setLineAntialiasingEnable(true);
appear.setLineAttributes(la);
return appear;
}
public static void main(String[] args){
...
}
}
|
Related Tips
|
Page 1 of 0 ( 0 comments )
You can share your information about this topic using the form below!
Please do not post your questions with this form! Thanks.