I made a macro awhile back to do this. It uses the same method that Chris uses. You just find the components of the angle and set it to the X and Y position of what you're trying to move.

Here is a more flexible example

Attachment: CirclePath.qtz
Description: application/quartzcomposer



Sam Soffes

On Apr 6, 2008, at 3:32 PM, Christopher Wright wrote:
I would like to make a patch that can move an object around a certain
path -- in my first case, a circle. I'm having trouble figuring out
the best way to do this since there doesn't seem to be any sort of
existing patches that deal with paths. The way I envision using it is
that it based on inputs of a center point (x1, y1) and radius (r), it
will provide outputs (x2, y2) that follow the circumference of the
specified circle at a speed controlled by a variable rate. Is this the
kind of thing I'll have to program in Objective C, or can this be
achieved using the existing patches?

Without knowing more details, I'm pretty sure you can perform this without resorting to writing a custom plugin.

Initially, I'd recommend using the _javascript_ patch, the Math patch, or the math _expression_ patch.  You could also experiment with the Timeline patch too.

The equations for getting the output position would be something like this:

x = r  *cos(theta) + x1
y = r * sin(theta) + y1

Where r is the radius, x1 and y1 are the center points, and theta is the current angle (you could multiply this by the variable rate to change its speed around the circle).  Theta should be attached to something like system time, patch time, or the output of some other time-marking patch (stop watch, timeline, etc).

Here's a simple composition that demonstratesthe above:
<CirclePath.qtz>


Hope this helps, let me know if I completely misunderstood what you're trying to accomplish.

--
[ christopher wright ]
[EMAIL PROTECTED]
http://kineme.net/

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/sam%40samsoffes.com

This email sent to [EMAIL PROTECTED]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to