Question: How to project a fixed object illuminated by a moving point light source

The code below projects a torus illuminated by a point light source located at the origin onto an ellipsoid as the torus's centre moves along the x axis from [-0.8,0,0] to [0.8,0,0].

Ellipsoid := (1/32)*x^2+(1/18)*y^2+(1/12)*z^2 = 1:
EllipsoidTitle := Typesetting:-Typeset((1/32)*x^2+(1/18)*y^2+(1/12)*z^2 = 1):
DispEllipsoid := implicitplot3d(Ellipsoid, x = -10 .. 10, y = -10 .. 10, z = 1.25 .. 5, style = surface, color = yellow, grid = [30, 30, 30]):
TorusVorig := Vector([(1+.25*cos(v))*cos(u), (1+.25*cos(v))*sin(u), .6+.25*sin(v)]):

i := 0;

for x from -.8 by .1 to .81 do

i := i+1;

TorusV := `<,>`(x, 0, 0)+TorusVorig:

DispTorusV := plot3d(TorusV, u = 0 .. 2*Pi, v = 0 .. 2*Pi, shading = xyz):

NormTorusV := Normalize(TorusV, Euclidean):

Vadj := solve((1/32)*w^2*NormTorusV[1]^2+(1/18)*w^2*NormTorusV[2]^2+(1/12)*w^2*NormTorusV[3]^2 = 1, w):

if evalf(eval(Vadj[1]*NormTorusV[3], [u = Pi, v = Pi])) > 0 then

DispTorusVproj := plot3d(Vadj[1]*NormTorusV, u = 0 .. 2*Pi, v = 0 .. 2*Pi):

else

DispTorusVproj := plot3d(Vadj[2]*NormTorusV, u = 0 .. 2*Pi, v = 0 .. 2*Pi):

end if:

Disp[i] := display(DispTorusV, DispEllipsoid, DispTorusVproj, view = [-10 .. 10, -10 .. 10, 0 .. 5], scaling = constrained, Plot3Daxes, title = typeset("Project %1 onto %2 from a light at the origin", TorusV, EllipsoidTitle), titlefont = [Courier, bold, 14]):

end do:

display(seq(Disp[j], j = 1 .. i), insequence = true);

How can I plot the unmoving torus centred on the z axis projected onto the ellipsoid illuminated by a point light source moving on the x axis from [-0.8,0,0] to [0.8,0,0]?

Please Wait...