Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best way to produce smooth random motion



The easiest way I've found to generate random numbers for seeding an animation is with the Javascript patch:

    if ( outputs[0] == null )
        outputs[0] = Math.random();

Anybody have a better way?

Considering you need to memorize the random number, I don't see any other solution.


Note that the random function of the JS patch is not deterministic, contrary to the Random Patch. This means you won't get the same sequence of random numbers from the point when the composition starts rendering. In your case, it seems that's what you're looking for.


________________________________________________________ Pierre-Olivier Latour email@hidden Quartz Composer Architect Graphics & Imaging Team

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden
References: 
 >Best way to produce smooth random motion (From: pete boardman <email@hidden>)
 >Re: Best way to produce smooth random motion (From: Pierre-Olivier Latour <email@hidden>)
 >Re: Best way to produce smooth random motion (From: Dave Hayden <email@hidden>)
 >Re: Best way to produce smooth random motion (From: David Coffin <email@hidden>)
 >Re: Best way to produce smooth random motion (From: Dave Hayden <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.