LoginSignup
0
0

More than 5 years have passed since last update.

[GroovyとProcessing]正射影投影法

Posted at

正射影投影法で描画する。
Processing公式のサンプルは立方体を描画している。
今回は動画に沿って三角形を描画する。

動画リスト:LWJGLのチュートリアル
動画はココ

package episode015

import processing.core.PApplet

class DisplayTest extends PApplet {

    def void setup() {
        size(640, 480, P3D)
        frameRate(60)
    }

    def void draw() {
        background(0, 0, 0)

        // 正射影投影法
        ortho()
        // (0, 0)を中央へ
        translate(width / 2, height / 2, 0)

        noStroke()
        fill(255, 255, 255)
        triangle(320, 240, -320, 240, 320, -240)
    }

    def static void main(args) {
        PApplet.main('episode015.DisplayTest')
    }
}

grocessingGL015.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0