-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeometry-debug.lisp
26 lines (24 loc) · 1.33 KB
/
geometry-debug.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(in-package #:org.shirakumo.fraf.convex-covering)
(defvar *material-number*)
(defun make-material (diffuse-factor &key (name (prog1
(format NIL "material~d" *material-number*)
(incf *material-number*)))
alpha)
(apply #'make-instance 'org.shirakumo.fraf.wavefront:material
:name name
:diffuse-factor diffuse-factor
(when (and alpha (/= alpha 1))
(list :transmission-factor (- 1 alpha)))))
(defvar *mesh-number*)
(defun make-triangle-mesh (vertices faces
&key (name (prog1
(format NIL "mesh~d" *mesh-number*)
(incf *mesh-number*)))
diffuse-factor
(alpha 1)
(material (make-material diffuse-factor :alpha alpha)))
(make-instance 'org.shirakumo.fraf.wavefront:mesh :name name
:attributes '(:position)
:vertex-data vertices
:index-data faces
:material material))