HSPポータル
サイトマップ お問い合わせ


HSPTV!掲示板


未解決 解決 停止 削除要請

2011
0921
who世間話2解決


who

リンク

2011/9/21(Wed) 07:29:24|NO.41544

雨は嫌ですね〜。服がぬれると気持ち悪くなったり。歩くと水がはねて足につくし。


dim px,100 dim py,100 dim pt,100 #define Mt 3 Wt=0 *main redraw 1:await 20:redraw 0 color 0,0,0:boxf repeat 100 if pt(cnt)>0{ color pt(cnt),pt(cnt),pt(cnt) circle px(cnt)-(255-pt(cnt)),py(cnt)-(255-pt(cnt)),px(cnt)+(255-pt(cnt)),py(cnt)+(255-pt(cnt)),0 pt(cnt)-=5 } loop repeat 100 if Wt=0 & pt(cnt)<=0{ px(cnt)=rnd(640) py(cnt)=rnd(480) pt(cnt)=255 Wt=Mt break } loop Wt-- goto*main



この記事に返信する


KA

リンク

2011/9/21(Wed) 18:35:19|NO.41569

誰もいないので過去の産物を。

古き良き時代に、少年の夢を膨らませてくれた技術です。

雨上がりは・・・・。


;-----パラメーター----------------------------------------------- MS=4 ; 1 2 4 8 16 32 の何れか ;-----初期処理----------------------------------------------- BMPW=ginfo(11) : BMPH=ginfo(12) MW=BMPW/MS : MH=BMPH/MS if MS>8 : JP=8 : else : JP=MS ;-----初期テーブル-------------------------------------- dim NIJI,48 repeat 48 poke NIJI(cnt),2,limit((abs(((cnt+48)\48)-24)-8)*32,0,255) poke NIJI(cnt),1,limit((abs(((cnt+32)\48)-24)-8)*32,0,255) poke NIJI(cnt),0,limit((abs(((cnt+16)\48)-24)-8)*32,0,255) loop ;-----描画-------------------- repeat MH B=cnt repeat MW A=cnt repeat MS Z=NIJI((A+B)*JP\48) color peek(Z,0),peek(Z,1),peek(Z,2) Z=((BMPW*(MH-1-B)+A)*MS+cnt) repeat MS pset Z/BMPW+cnt,Z\BMPW loop loop loop loop stop

これだけじゃ何の意味も無いけど。



GENKI

リンク

2011/9/21(Wed) 21:22:46|NO.41576

雨上がりの空気って好きです。

;mm,kg,sec #include "d3m.hsp" #define global RIPPLE_DIV 15 // 波紋を何分割して描画するか(大きければ大きいほどなめらかな円に近づく) ;################################################################# ;「はずむ虹の輪」を参考 #module ;輪を描画 xy平面に描画します。 #deffunc m_d3circle int _x, int _y, int _z, int _r d3setlocal _x, _y, _z ;中心座標 d3initlineto repeat RIPPLE_DIV + 1 t = 2.0 * M_PI / RIPPLE_DIV * cnt d3lineto cos( t ) * _r, sin( t ) * _r loop return #global ;################################################################# ;カメラ基準座標 camx = 5000 : camy = 5000 : camz = 1500 ;波紋の管理用配列変数 dim r, 4, 500 ;xyrf *main redraw 1 : await 16 : redraw 0 : color : boxf : color 255, 255, 255 : pos 0,0 ct++ ;経過フレーム(経過時間) stick key : if key&128 : end ;ESC = END ; カメラ座標 d3setcam cos(0.01 * ct) * camx, sin(0.01 * ct) * camy, camz, 0, 0, 1000 ; 雨を描画 randomize 0 repeat 500 x = rnd(8000) - 4000 y = rnd(8000) - 4000 z = -rnd(8000) ;雨の直径と終端速度の関係 ;φ1.0(680cm/sec)、φ2.0(962cm/sec) ;(680cm/s*10) * (30ms/1000) = 204mm/フレーム ;(962cm/s*10) * (30ms/1000) = 288.6mm/フレーム ;288.6 - 204 = 84.6 v = -204 -rnd(85) z = (ct * v + z) \ 8000 + 8000 z0 = z - v ;残像を表示 ;雨ライン d3line x, y, z, x, y, z0 a = rnd(5) ;波紋の数に制限をかける。 ; if z0>8000 { ;これにするとすべての波紋を描画する。重い。 if (z0>8000)&(a<1) { r(0, rc) = x, y, 0, 30 rc++ if rc>=500 : rc = 0 ;一定個数以上の波紋を作らないようにしている。 } ;波の伝播速度=sqrt(g*h) ;g重力加速度、h深さ ;50cm/s = 15mm/フレーム if r(3, cnt) > 0 { r(2,cnt)+=15 color 255.0*r(3,cnt)/30, 255.0*r(3,cnt)/30, 255.0*r(3,cnt)/30 m_d3circle r(0, cnt), r(1, cnt), 0, r(2, cnt) d3setlocal 0,0,0, 1,0,0, 0,1,0, 0,0,1 ;元のグローバル座標系に戻す。m_d3circleの後には必ず必要。 r(3, cnt)-- color 255,255,255 } loop goto *main



ONION software Copyright 1997-2023(c) All rights reserved.