;; this file: ;; https://dataswamp.org/~incal/cl/general-base/triangle.lisp (require :cl-opengl) (load "math.lisp") (defun draw-triangle (x1 y1 x2 y2 x3 y3 r g b) (gl:begin :triangles) (gl:color r g b) (gl:vertex x1 y1) (gl:vertex x2 y2) (gl:vertex x3 y3) (gl:end) ) (defun draw-triangle-test (&optional (num 3) (limit 2.0)) (dotimes (_ num) (draw-triangle (random-limit limit) ; x1 y1 (random-limit limit) (random-limit limit) ; x2 y2 (random-limit limit) (random-limit limit) ; x3 y3 (random-limit limit) (random-color-channel) ; r g b (random-color-channel) (random-color-channel) )))