Rotating Balls [Ben Beaumont]
Richmond Mathewson
richmondmathewson at gmail.com
Thu Sep 3 04:44:48 EDT 2009
Ben Beaumont gave a most stimulating talk last night about the jazzy new
visual effectsin RR 4. At one point he showed us a simulation of a solar
system featuring a sun and
4 or 5 planets in orbit about it. The particularly fancy bit was that the
side of a planet
facing towards the sun was always 'lit'. Ben Beaumont claimed that this
effect was
a bit difficult.
. . . I went back to my lodgings and jumped into a good, hot bath . . .
Bingo: all one has to do is set up a sequence of numbers round a circle like
this:
repeat with XYZ = 0 to 6.28 step 0.05
put (cos(XYZ) * 150) into KOZ
put (cos(XYZ - 1.54) * 150) into KOZ2
put (sine(XYZ) * 150) into SIGN
put (sine(XYZ - 1.54) * 150) into SIGN2
then one sets up a circular graphic of, say, 300,300 with a linear
fillGradient of black
to green/blue/red and sets the following:
set the fillGradient["to"] to (KOZ + 400),(SIGN + 400)
set the fillGradient["from"] to (KOZ2 + 400),(SIGN2 + 400)
end repeat
[ mind you, this might be complete rubbish as I haven't tried it yet . . .]
More information about the use-livecode
mailing list