Original Post
🔒 Locked
[java] 2D drawing with Java3D
Advertisement
Java has the Java2D API. I don't know how well that interacts with Java3D, though.
Indeed there is. What you have to do is create a class that extends Canvas3D and use that instead of the default Canvas3D class. Once you have done that you can override various methods, with the one you want in this case being postRender(). This gets called every frame after everything else in the scene has been rendered.
For example:
For example:
public MyCanvas3D(GraphicsConfiguration gcfg) { super(gcfg,false); } public void postRender() { if (g2 == null) { g2 = this.getGraphics2D(); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); } drawStuff(g2); g2.flush(true); }Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement