I am using Maple 6 (SIX). I am trying to develop a visual example where an object by animating the rotation of a surface around a sphere that can be run below.
I cannot get the animation (through a sequence) to work.
Does anybody have any ideas how to get this to work? I am sure it worked one time!
restart: with(plots):with(plottools): f:=(x,y)->(x^2-y^2)/5 -5; n:=40: a := plot3d( f(x,y), x=-5..5,y=-5..5 ): c := sphere([0,0,0], 2): display3d( [c,a], axes=NONE, light=[0,0,1,1,1], scaling=CONSTRAINED, orientation=[70,80], style=PATCHNOGRID); display3d( seq( plot3d ( f(x,y), x=-5..5, y=-5..5, scaling=CONSTRAINED, axes=NONE, orientation=[60+i*720/n,70], shading=ZHUE ), i=0..n-1 ), insequence=true ); display3d( seq( plot3d( {f(x,y),c }, x=-5..5,y=-5..5, style=PATCHNOGRID, axes=NONE, light=[0,0,1,1,1], orientation=[60+i*720/n,70], shading=ZHUE ), i=0..n-1 ), insequence=true );
You may try the following:
> restart; > with(plots): > with(plottools): > f:=(x,y)->(x^2-y^2)/5-5: > n:=40: > a:=plot3d( > f(x,y), > x=-5..5,y=-5..5, > style=PATCHNOGRID, > shading=ZHUE > ): > c:=sphere([0,0,0],2): > display3d( > [a,c], > orientation=[70,80], > axes=NONE, > scaling=CONSTRAINED, > light=[45,45,1,1,1] > ); > s:=NULL: > for i to n do > s:=s,display3d( > [a,c], > orientation=[70+(i-1)*720/n,80] > ) > od: > display3d( > [s], > axes=NONE, > scaling=CONSTRAINED, > light=[45,45,1,1,1], > insequence=true > );
I believe the problem is that plot3d doesn’t understand sphere. You’ll need to use display to combine the plot3d of f and the sphere; possibly by:
display(seq(display(c, plot3d(f(x, y), x=-5..5, y=-5..5);
Then you can use the animation on the combined sequence:
PF := (i,n)-> plot3d( f(x,y), x=-5..5,y=-5..5, style=PATCHNOGRID, axes=NONE, light=[0,0,1,1,1], orientation=[60+i*720/n,70], shading=ZHUE): display(seq(display(c, PF(i, n)), i=0..n-1), insequence=true);
Try this as the last line:
>display3d( seq( display3d( [c,a], axes=NONE, light=[0,0,1,1,1], scaling=CONSTRAINED, orientation=[60+i*720/n,70], style=PATCHNOGRID),i=0..n-1), insequence=true );
(display returns a plot object, just like plot3d.)
Your c is a plot structure, not an algebraic expression in x and y, so you don’t want to put it into the plot3d command. What you want is something like
> display(seq(display({c,plot3d(...)}), i=0..n-1), insequence=true);