Renderer problem in Eclipse
in
Integration and Hardware
•
2 years ago
I am facing an issue with the rendering of rotated objects in applets from within Eclipse. It seems as if the wrong renderer P2D is used, even though the program is initialized with Java2D.
My test program simply rotates three close-by lines. In Processing this is rendered correctly with the default renderer (Java2D). When using P2D, the lines jump and are not parallel all the time (both with smooth() and without).
In Eclipse this always happens, whether using P2D or Java2D. Only when starting it as application, it works as expected.
Any ideas, why?
My test program simply rotates three close-by lines. In Processing this is rendered correctly with the default renderer (Java2D). When using P2D, the lines jump and are not parallel all the time (both with smooth() and without).
In Eclipse this always happens, whether using P2D or Java2D. Only when starting it as application, it works as expected.
Any ideas, why?
- import processing.core.PApplet;
- public class RotateTest extends PApplet {
- float rot = PI / 4;
- public void setup() {
- size(250, 250, JAVA2D);
- smooth();
- stroke(140);
- }
- public void draw() {
- background(255);
- drawTest();
- }
- public void drawTest() {
- rot = rot + 0.01f;
- translate(width / 2, height / 2);
- rotate(rot);
- line(4, -1, 102, -1);
- line(4, +1, 102, +1);
- line(4, +3, 102, +3);
- }
- public void keyPressed() {
- println("renderer=" + g.getClass().getName());
- }
- }
2