changeset 18434:92ec75319e73

surfl.m: normalize using dataaspectratio, not plotboxaspectratio. * surfl.m: Calculations of normals to surface now use dataaspectratio to determine length, rather than plotboxaspectratio. Modified %!demo to showcase surfl and the differences when using the light vector and material properties inputs to surfl.
author Rik <rik@octave.org>
date Thu, 06 Feb 2014 18:05:09 -0800
parents 07ca8b9f8cab
children e76d50d65278
files scripts/plot/draw/surfl.m
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/draw/surfl.m	Mon Feb 03 22:32:12 2014 -0800
+++ b/scripts/plot/draw/surfl.m	Thu Feb 06 18:05:09 2014 -0800
@@ -164,7 +164,7 @@
     endif
 
     vn = get (htmp, "vertexnormals");
-    dar = get (hax, "plotboxaspectratio");
+    dar = get (hax, "dataaspectratio");
     vn(:,:,1) *= dar(1);
     vn(:,:,2) *= dar(2);
     vn(:,:,3) *= dar(3);
@@ -206,8 +206,7 @@
 %! clf;
 %! [X,Y,Z] = sombrero ();
 %! colormap (copper (64));
-%! [az, el] = view ();
-%! surfl (X,Y,Z, [az+225,el], [0.2 0.6 0.4 25]);
+%! surfl (X,Y,Z, [62.50,30], [0.2 0.6 0.4 25]);
 %! shading interp;
 %! title ('surfl() with lighting vector and material properties');