From 4684239efa63dc1b2c1cbe37ef7d3062029f5532 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 20 Feb 2017 00:05:40 -0800 Subject: Import Upstream version 3b1 --- solid.scm | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) (limited to 'solid.scm') 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 -- cgit v1.2.3