Hi, Darius,
I don't have the perfect answer to your query (perhaps Andreas will)
but here are some observations that may be useful:
(1) An easy way to achieve the effect you want, I think, would be to
capture your gradient-graced sphere as a SketchMorph. The reason is
that there is a special feature available only to SketchMorphs that
allows you to specify that their appearance not change as they
rotate. To do this:
* First create your object as an EllipseMorph with gradient fill, as before.
* Then obtain a SketchMorph from it using one of the new morph...
grab... commands from the desktop menu.
* Remove the transparent pixels surrounding the resulting SketchMorph
by using painting... erase pixels of color.. from its halo menu.
* The result is a SketchMorph of exactly the same size and shape and
appearance as your original.
* Go to the SketchMorph's halo menu, choose painting... set rotation
style... don't rotate.
Now you have a ball whose appearance will not change as you change
its heading from a Viewer or from running code.
(2) The intent of the rotation code is to take the *complete*
appearance of the object when facing in its "forward direction" and
to rotate it rigidly by the required number of degrees. That
"complete" appearance includes drop-shadow, gradient direction, etc.
What you are asking for is directly at odds with that. If you don't
want to use the SketchMorph trick outlined above, then the best
alternative I can think of is for you to give the object a ticking
textual script that serves to counteract the effect of the rotation
on the gradient direction. Though I couldn't immediately and without
careful thought write down a script that accomplished this, obviously
it must be possible, though perhaps strenuous. The script would
presumably have code of the form "Sphere costume fillStyle direction:
foo" or something similar.
(3) A further thought is: if you want the appearance to be
unchanged, perhaps you shouldn't be changing the heading in the first
place. An alternative is to forego the built-in heading-changing
feature such as "turn-by" and to do all your motion-related
computations more directly instead. Though this obviously has its
price, and the resulting scripts might be too obscure.
Hope these observations help, or at least don't hurt ;-)
Cheers,
-- Scott
At 4:13 PM -0800 1/14/04, Darius Clarke wrote:
>
>Rotating a eclipse 180¡ also rotates the gradient fill 180¡ as show
>in these clips.
>
>
>
>
>I'd like to keep the color side up and the shaded side down while
>rotating with a script.
>
>Perhaps saying this another way: Can I adjust the gradient angle
>with a eToy script?
>
>Thanks for your help.
>
>
>Cheers,
>Darius
>
>
>-----Original Message-----
>
> >Also:
> > - How can I keep the gradient oriented the same direction, even
> >when the player is rotoated?