summaryrefslogtreecommitdiffstats
path: root/solid.scm
diff options
context:
space:
mode:
Diffstat (limited to 'solid.scm')
-rw-r--r--solid.scm37
1 files changed, 25 insertions, 12 deletions
diff --git a/solid.scm b/solid.scm
index 8f99d83..990fa3d 100644
--- a/solid.scm
+++ b/solid.scm
@@ -487,15 +487,25 @@
(define nargs (length args))
(let ((color (and (>= nargs 1) (color->vrml-field (car args))))
(intensity (and (>= nargs 2) (cadr args)))
- (attenuation (and (>= nargs 3) (cadr (caddr args))))
- (radius (and (>= nargs 3) (caddr (caddr args)))))
+ (beamwidth (and (>= nargs 3) (car (caddr args))))
+ (cutoffangle (and (>= nargs 3) (cadr (caddr args))))
+ (attenuation (and (>= nargs 3) (caddr (caddr args))))
+ (radius (and (>= nargs 3) (cadddr (caddr args)))))
(replicate-for-strength
(or intensity 1)
(lambda (inten)
(sprintf #f
- "PointLight {location %s color %s intensity %g attenuation %s radius %g}\\n"
+ "PointLight {location %s color %s intensity %g%s}\\n"
(coordinates3string location)
- color intensity attenuation radius)))))
+ color
+ inten
+ (if attenuation
+ (sprintf #f
+ "\\n
+ attenuation %s radius %g"
+ attenuation
+ radius)
+ ""))))))
;;@args location direction color intensity beam
;;@args location direction color intensity
@@ -535,17 +545,20 @@
(or intensity 1)
(lambda (inten)
(sprintf #f
- "SpotLight {\\n
- location %s direction %s beamWidth %g cutOffAngle %g\\n
- color %s intensity %s attenuation %s radius %g}\\n"
+ "SpotLight {location %s direction %s color %s intensity %g%s}\\n"
(coordinates3string location)
direction
color
- intensity
- (and beamwidth (* pi/180 beamwidth))
- (and cutoffangle (* pi/180 cutoffangle))
- attenuation
- radius)))))
+ inten
+ (if beamwidth
+ (sprintf #f
+ "\\n
+ beamWidth %g cutOffAngle %g attenuation %s radius %g"
+ (* pi/180 beamwidth)
+ (* pi/180 cutoffangle)
+ attenuation
+ radius)
+ ""))))))
;;@subheading Object Primitives