;; this file: ;; https://dataswamp.org/~incal/cl/general-base/polygon.lisp (require :cl-opengl) (load "math.lisp") (defun draw-polygon (ps r g b) (gl:begin :polygon) (gl:color r g b) (loop for (x y z) in ps do (gl:vertex x y z) ) (gl:end) ) (defun draw-polygon-test (&optional (num 3) (limit 2.0)) (dotimes (_ num) (let*((max 20) (offset 4) (num-verts (+ offset (random (- max offset)))) ) (dotimes (_ num-verts) (draw-polygon (list `(,(random-limit limit) ,(random-limit limit) ,(random-limit limit) )) (random-color-channel) (random-color-channel) (random-color-channel) )))))