File: lighten.sci

package info (click to toggle)
scilab-plotlib 0.41-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,196 kB
  • sloc: xml: 3,308; makefile: 15
file content (27 lines) | stat: -rw-r--r-- 816 bytes parent folder | download | duplicates (2)
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
27
function lightenedSurface=lighten(theSurf,vect)

global currentSurf currentLightVect

currentSurf=theSurf;
currentLightVect=vect(:);

[nArgOut,vectInput]=check3dFun('lighten',theSurf,rand(5,1),rand(5,1));

if nArgOut==3

deff('[x,y,z]=lightenedSurface(u,v)',['global currentSurf currentLightVect';...
'[x,y,z]=currentSurf(u,v)';
'[xu,yu,zu,xv,yv,zv]=parametricDiffDeriv(currentSurf,u,v,x,y,z)';
'[n]=parametricNormals(xu(:)'',yu(:)'',zu(:)'',xv(:)'',yv(:)'',zv(:)'')';
'z=z(:)+%i*computeLight(-n,currentLightVect)']);
// Sign problem ? Where ? //
else

deff('[z]=lightenedSurface(u,v)',['global currentSurf currentLightVect';...
'[z]=currentSurf(u,v)';
'[zu,zv]=nonParametricDiffDeriv(currentSurf,u,v,z)';
'[n]=nonParametricNormals(zu(:)'',zv(:)'')';
'z=z(:)+%i*computeLight(n,currentLightVect)']);

end
endfunction