We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hi guys, i wrote some code about a circle(or like the watch) to show the month, for example: at 6 o'clock is june, so at 12 o'clock is december, every thing is fine, until i realized the antialiasing, so i used OPENGL in the size(width, height, OPENGL), then i found the month-clock is broken at 3 o'clock. any idea?
import processing.opengl.*;
int radius, thickness;
PImage img;
PGraphics testPG;
void setup(){
size(displayWidth, displayHeight, OPENGL);
background(80);
}
void draw(){
testPG = createGraphics(displayWidth, displayHeight, OPENGL);
testPG.beginDraw();
testPG.noFill();
radius = 175;
thickness = 35;
elevation = 40;
testPG.strokeWeight(thickness);
testPG.arc(200, 200, radius, radius, -PI/2, month()*TWO_PI/12-PI/2);
testPG.endDraw();
img = testPG.get(0,0,displayWidth, displayHeight);
image(img, 0, 0);
}
Answers
Sorry I can't help you with the opengl problem, but image() will take a PImage or a PGraphcis object. You don't need to convert them.
I have to use the Image, because I have to add some SVG file on the foreground, without Image, the SVG files will just stay in the background.
What exactly do you mean with broken?
Does the following code fix your problem?
Btw.: If you want to run your applet in fullscreen mode, just add the following function to your sketch:
Hmm, i just have the Problem wenn december, it is jan, so everything looks fine