» codelab : http://codelab.fr/accueil » Forum : Processing : http://codelab.fr/processing » Texte sur courbes ? Projet : http://codelab.fr/3363 Ceci est la version imprimable d'un sujet du forum, pour retourner à la version complète : Texte sur courbes ? Projet |
y0m-y0m — 2012-05-06 11:06:53 |
Bonjour à toutes et à tous de la communauté ! void setup() { size(1000, 1000); background(255); smooth(); noLoop(); } void draw() { noFill(); beginShape(); vertex(55.845,812.53); bezierVertex(71.55,814.415,77.833,828.55,77.833,835.4599999999999); bezierVertex(77.833,842.3699999999999,73.122,852.4189999999999,55.845,863.4129999999999); endShape(); noFill(); beginShape(); vertex(55.845,800.28); bezierVertex(77.519,801.223,93.851,814.098,93.22399999999999,833.891); bezierVertex(92.59499999999998,853.6759999999999,75.948,865.928,55.84499999999999,879.746); endShape(); noFill(); beginShape(); vertex(55.845,785.833); bezierVertex(80.65899999999999,788.347,107.672,802.478,111.44200000000001,822.895); endShape(); } Et c'est là que je suis... bloqué ! |
y0m-y0m — 2012-05-06 23:03:41 |
Bonsoir! void setup() { size(1000, 1000); background(0); smooth(); noLoop(); stroke( 0, 51, 255 ); strokeWeight(1); } void draw() { noFill(); bezier(285, 220, 260, 210, 290, 305, 215, 402); stroke(255); fill(255); int steps = 5; for (int i = 0; i <= steps; i++) { float t = i / float(steps); float x = bezierPoint(285, 260, 290, 215, t); float y = bezierPoint(220, 210, 305, 402, t); float tx = bezierTangent(285, 260, 290, 215, t); float ty = bezierTangent(220, 210, 305, 402, t); float a = atan2(ty, tx); a -= HALF_PI; line(x, y, cos(a)*-12 + x, sin(a)*-12 + y); ellipse(x, y, 2, 2); } } j'ai essayé de trouver un bout de code pour faire |
emoc — 2012-05-14 11:11:58 |
Bonjour y0m-y0m et bienvenue, |
cgiles — 2012-05-14 12:05:19 |
reste plus qu'a stoker tes points dans un tableau, tes angles aussi, et les utiliser pour placer des caractère : |