# HG changeset patch # User Rik # Date 1391738709 28800 # Node ID 92ec75319e736981fa93c1800aff24c5d23b876c # Parent 07ca8b9f8cab4ca5a29c52efaa9249613a943bd3 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. diff -r 07ca8b9f8cab -r 92ec75319e73 scripts/plot/draw/surfl.m --- 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');