ガブガブ

個事記

ガブガブ

個事記

最近の記事

森乃央歩論1

ここnoteで異常な日録を発信している森乃央歩。彼(もしくは彼女)の日録にアクセスすると、整然と並んだ明朝体の群れがスクリーンの白を眩しく演出している。くろぐろとした白。ゴミ捨て場で置きっ放しにされたバケツの中に、ボウフラの群れを見つけた時の、あのゾゾゾとする感覚。 つまりあの得体の知れない、組み合い方がまったく分からないものと出くわした時の感じが、森乃央歩の日録にはあるのだ。もしこの日録が一般的な紙の本で読めるなら、こんな喩えにはならなかったと思う。インターネットは速くて

    • [p5.js] Geometric Trip With A Man.

      おじさんと一緒に幾何学トリップできます。スマホからどうぞ。 ※音、出ます。

      • [p5.js]wave.

        大きくなったり小さくなったりを周期的に繰り返す円の列。​ 剰余を使って周期的な数字の流れを作り、それを比較演算子でグループ分けする。 let dia = 40;for(let i = 0; i < 10; i += 1) {// だんだん大きく、だんだん小さく if(i % 6 <= 3 && i % 6 != 0) { dia += 20; }else{ dia -= 20; } circle(50 + (100 * i), h

        • [p5.js]ブロック崩しゲーム メモ書き⑤

          ブロックの数を増やして整列させる。 まずはJavaScriptのArrayクラスを使って、ブロックをまとめる。 let blocks = []; let blocks.push = new Block((200, 200), 30); let blocks.push = new Block((300, 300),30); let ... let... みたいな感じで。ただ、ブロック数ごとにコードを書くのは手間なので、 ループ関数(for)を利用する。 let bloc

        森乃央歩論1

          [p5.js]ブロック崩しゲーム メモ書き④

          次はブロックとボールの反射を計算する。 高校数学の知識はすべて失っているので、学びながら少しずつ進めていく。 求める反射ベクトルrは進行ベクトルvと同じ大きさ、入射角=反射角とする。 nは衝突面に対する法線ベクトル。下向きの矢印書き忘れた。 ベクトルは大きさ(長さ)と向きのことなので、座標上のどの位置にも置くことができる。vと同じ始点に移動させて右図を作る。 ベクトルの加法より、次の式が導ける。 r = v + 2n これをボールとブロック(ボール)の衝突に置き換

          [p5.js]ブロック崩しゲーム メモ書き④

          [p5.js]ブロック崩しゲーム メモ書き③

          ようやくブロックの作成へ。ここからは最初からclassを使って描画していく。ブロックはボール同様、円で描画する。 classで円の構造をつくって… class Block { constructor(_p, _r) { this.p = _p  // ブロック(中心)の位置ベクトル this.r = _r   // ブロックの半径 } インスタンス化。 let block = new Block( new Vec2(200, 150), 50); それ

          [p5.js]ブロック崩しゲーム メモ書き③

          [p5.js] ブロック崩しゲーム メモ書き②

          ここからは前回作ったボールの運動を、classという機能を使ってまとめていく。 let ballPx = 100; let ballPy = 200; 今はボールの位置を指定するのに、x, yそれぞれの変数を作って定義しているけど、これを1つの式にまとめることができる。 ballP(x, y) ←この構造をclassを使って作る。 上記のような構造とは、[ballP]という箱の中に[x成分]と[y成分]が独立して含まれている状態のこと。つまり、「変数ballPの中にさ

          [p5.js] ブロック崩しゲーム メモ書き②

          [p5.js]ブロック崩しゲーム メモ書き①

          JavaScriptのライブラリ[p5.js]を使ってブロック崩しゲームを作成。 参考は ボールを描画 function setup() { createCanvas(400, 400);}function draw() { // 位置ベクトルの成分 let ballPx = 100; let ballPy = 200; background(220); circle(ballPx, ballPy, 30)} setup()とdraw()という関数(function

          [p5.js]ブロック崩しゲーム メモ書き①

          Skellig cp13 翻訳メモ

          "You're unhappy," she said. I stood there looking up at her. "The baby's back in the hospital." I said. She sighed. She gazed at a bird that was wheeling high above. "It looks like she's going to bloody die," I said. She sighed again. "Woul

          Skellig cp13 翻訳メモ

          Skellig cp12 翻訳メモ

          Dr. Death was there when I got home. He was in the kitchen with Mum and Dad. He had the baby on his knee and he was fastening he undershirt up. He winked at me when I came in. Dad poked me in the ribs. I saw how flat Mum's face was. ぼくが家に

          Skellig cp12 翻訳メモ

          Skellig cp11 翻訳メモ

          Next morning, Dad said he could hardly move. He was all bent over. He said his back was killing him. He was stiff as a blinking board. "Where's those aspirin?" he yelled down the stairs. Mum laughed. "All this exercise'll do him good," she

          Skellig cp11 翻訳メモ

          Skellig cp10 翻訳メモ

          I tried to stay awake that night, but it was hopeless. I was dreaming straight away. I dreamed that the baby was in the blackbird's nest in Mina's garden. The blackbird fed her on flies and spiders and she got stronger and stronger until sh

          Skellig cp10 翻訳メモ

          Skellig cp9 翻訳メモ

          I saw Mina again later that evening. I was in the little front garden with Dad. We stood there in the thistles and dandelions. He was telling me as usual how wonderful it would be-- flowers here and a tree there and a bench under the fron

          Skellig cp9 翻訳メモ

          Skellig cp8 翻訳メモ

          When he came down from his bath, Dad started moaning that there was no bread and there was no eggs, and in the end he said, "I know. Let's have take-out, eh?" It was like a light went on in my head. He had the menu from the Chinese round t

          Skellig cp8 翻訳メモ

          Skellig cp7 翻訳メモ

          I leaned over the tea chests and shined the flashlight and there he was. He hadn't moved. He opened his eyes and closed them again. "You again," he said, in his cracked, squeaky voice. "What you doing there?" I whispered. He sighed, like he

          Skellig cp7 翻訳メモ

          Skellig cp6 翻訳メモ

          At home, there was a hole in the floor where Ernie's toilet had been. It was filled with new cement. The plywood screen had gone. Ernie's old gas fire had been taken away and there was just a square black gap behind the hearth. The floor wa

          Skellig cp6 翻訳メモ