Comment detail

ポリゴンを表示するプログラム (Nested Flatten)

cl-glfwを利用しています。付属のサンプルを少し改造しただけです。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
require '#:asdf)
(asdf:oos 'asdf:load-op '#:cl-glfw)
(asdf:oos 'asdf:load-op '#:cl-glfw-opengl)
(asdf:oos 'asdf:load-op '#:cl-glfw-glu)

(glfw:do-window ("A Polygon Example")
    ((gl:with-setup-projection
       (glu:perspective 45 4/3 0.1 50)))
  (gl:clear gl:+color-buffer-bit+)
  (gl:load-identity)
  (gl:translate-f 0 0 -5)
  (gl:rotate-f (* 10 (glfw:get-time)) 1 1 0)
  (gl:rotate-f (* 90 (glfw:get-time)) 0 0 1)
  (gl:with-begin gl:+line-loop+ ;+triangle-strip+
    (gl:color-3f 0 1 0) (gl:vertex-3f -1  1 0)
    (gl:color-3f 0 0 1) (gl:vertex-3f -1 -1 0)
    (gl:color-3f 0 1 0) (gl:vertex-3f -1  0 1)
    (gl:color-3f 0 1 0) (gl:vertex-3f -1  1 0)
    (gl:color-3f 1 0 0) (gl:vertex-3f  1  0 0)
    (gl:color-3f 0 1 0) (gl:vertex-3f -1  0 1)
    (gl:color-3f 1 0 0) (gl:vertex-3f  1  0 0)
    (gl:color-3f 0 0 1) (gl:vertex-3f -1 -1 0)))

Index

Feed

Other

Link

Pathtraq

loading...