processingの課題でキャラクターを書かなければいけないのですが、髪の毛やリボンの書き方などがわかりません。髪の毛とかはlineを使えばいいのでしょうか?まず座標がわからないので、始めたい
processingの課題でキャラクターを書かなければいけないのですが、髪の毛やリボンの書き方などがわかりません。髪の毛とかはlineを使えばいいのでしょうか?まず座標がわからないので、始めたい 場所から線を引くことが出来ません。教科書も見ているのですが、それらしきことが書いてないのでわからないです。 分かりにくい文章で申し訳ないのですがよろしくお願いします。
Java・766閲覧・50
ベストアンサー
アンパンマンとかドラえもんぐらいだと'Processing アンパンマン'とかでググれば出てきますけどね。似てるかどうかは... 直線、多角形と円/楕円/円弧だけで描けるものにしておかないと苦労すること必至だと思いますけど、PPGが好きなら仕方ないです。頑張って下さい。 とりあえず、 > まず座標がわからないので Windowsであれば、「ペイント」でカーソル位置の座標が読み取れます。画像を表示して、読み取りたい位置にマウスを持っていけばいいです。 ペイントに限らず、多くのお絵かきソフトで同様の機能はあると思います。 http://vilab.org/cg2010/CG2010-02.pdf の最後では、「方眼紙に画を描いて」読み取れ、と言ってますね。昔々はPC上に絵を描くときの基本の1つではありました>方眼紙 最終手段は、点を一つ一つ打っていくことです。大きな画を描こうとすると死にますが... ---追記--- //PPG PImage mask_hear; PImage hear; PImage mask_eye; PImage eye; size(500,550); //髪マスク background(0); translate(width/2,height/2); noStroke(); arc(0,0,450,350,PI,2*PI,OPEN); fill(0); ellipse(0,0,480,140); triangle(0,-130,30,0,-30,0); fill(0); triangle(-80,-110,-170,0,-130,0); triangle(80,-110,170,0,130,0); mask_hear=get(); //髪パーツ resetMatrix(); translate(width/2,height/2); background(162,61,34); noFill(); stroke(0); strokeWeight(8); ellipse(0,0,480,140); triangle(0,-130,30,0,-30,0); triangle(-80,-110,-170,0,-130,0); triangle(80,-110,170,0,130,0); hear=get(); hear.mask(mask_hear); //目マスク background(0); fill(255); noStroke(); resetMatrix(); translate(width/2,height/2); translate(125,0); rotate(0.3); ellipse(0,0,200,190); mask_eye=get(); //目パーツ background(255); resetMatrix(); translate(width/2,height/2); translate(120,0); rotate(0.3); noStroke(); fill(250,187,192); ellipse(-15,5,160,160); fill(0); ellipse(-30,5,140,140); fill(255); ellipse(-55,-5,60,60); eye=get(); eye.mask(mask_eye); //リボン resetMatrix(); background(255); strokeWeight(3); translate(width/2,height/2); fill(162,61,34); stroke(0); strokeWeight(5); ellipse(0,-95,200,200); rotate(PI*(-25./180)); ellipse(0,-200,130,150); rotate(PI*(50./180)); ellipse(0,-200,130,150); //顔地 resetMatrix(); translate(width/2,height/2); fill(255,224,204); ellipse(0,0,450,350); //目貼り付け resetMatrix(); image(eye,0,0); translate(width,0); scale(-1,1); image(eye,0,0); //目輪郭線 resetMatrix(); translate(width/2,height/2); noFill(); stroke(0); strokeWeight(5); translate(125,0); rotate(0.3); ellipse(0,0,200,190); resetMatrix(); translate(width/2,height/2); scale(-1,1); translate(125,0); rotate(0.3); ellipse(0,0,200,190); //顔輪郭線/口 resetMatrix(); image(hear,0,0); noFill(); stroke(0); strokeWeight(5); translate(width/2,height/2); ellipse(0,0,450,350); arc(0,30,100,150,PI*(60./180),PI*(110./180)); リボンは、イラスト例をググると結構ウサギの耳みたいになってるのもあるようなのでそれっぽく手抜き。
1人がナイス!しています
PPGが指定課題とかいうことでなければまずはこの辺から始めるのが順当では。 //ジャスタウェイ from 銀魂 size(300,350); translate(width/2,100); scale(1,-1); pushMatrix(); translate(50,-30); rotate(PI*240/180); fill(250,203,161); rect(0,0,5,110); popMatrix(); pushMatrix(); scale(-1,1); translate(50,-30); rotate(PI*240/180); fill(250,203,161); rect(0,0,5,110); popMatrix(); fill(250,203,161); circle( 0,0,100); pushMatrix(); translate(-19,20); rotate(0.07); fill(255); ellipse(0,0,25,5); fill(0); ellipse(1,0,5,5); popMatrix(); pushMatrix(); scale(-1,1); translate(-19,20); rotate(0.07); fill(255); ellipse(0,0,25,5); fill(0); ellipse(1,0,5,5); popMatrix(); line( -5,5,5,5); fill(253,126,95); rect(-53,0,106,-200);
質問者からのお礼コメント
わざわざご丁寧にありがとうございました!!詳しく書いて下さりありがとうごさいます!勉強になりました!!
お礼日時:2020/5/28 0:55