Xeno Motion
Below are examples illustrating Xeno motion. As you can see from the background animated gif emoticon and angry bush face example code I am not happy with your homework performance last week. I am expecting to be blown away by some Jacko-Xeno action on Monday..... DO NOT DISAPPOINT ME!
Xeno A
Download project here
An example of Xeno movement:
where I am = where I am + (a portion of the distance to where I am going)
or
x = x + (diff_x * rate);
Look in the idle() method of the xenoRext class to see this in use
Xeno A (multi)
Download project here
Make multiple Xeno objects with different rates:
where I am = where I am + (a portion of the distance to where I am going)
or:
x = x + (diff_x * rate);
Look in the idle() method of the xenoRext class to see this in use
Xeno B
Download project here
Another example of Xeno, written a different way. This takes a percentage of where you are and adds it to a percentage of where it wants to go.
where I am = (90% * where I am) + (10% * where I am going)
or:
x = (0.9f * x) + (0.1f * target)
(percents must add up to 1.0f)
Look in the idle() method of the xenoRext class to see this in use
Xeno B (w/ trail)
Download project here
Same as above but with no background() refresh.
Homework
Study the Xeno. Know the Xeno. Love the Xeno. If Xeno A and B above don't make sense to you then re-write the idle() method in the xenoRect class so that it does make sense to you. Create a composition using xeno based motion. All the rules about the inclusion of Michael Jackson from last week still apply. EVERYONE BETTER COME IN WITH THIS ONE NEXT WEEK!