When using Bezier curves to approximate trajectories in path animation, it can be useful to query extreme points. This query can be used, for example, to test if an auto-generated path between two points exceeds a bound. For quadratic Beziers, there are three critical points in [0.1]; the endpoints and a possible third point where the derivative is zero. Four methods, tAtMinX(), tAtMaxX(), tAtMinY(), and tAtMaxY() were added to the IParametric Interface, although the only concrete implementation is currently for Bezier2.
The following screen shot illustrates an example of a quad. Bezier trajectory auto-generated between two endpoints. The red Knots indicate maximum y-value (y-down is positive in Flash) and the green Knots indicate minimum y-value.

In this case, tAtMinY() indicates the parameter value at the top of the trajectory from the point of view of the user. The Bezier2 class also has a working implementation of toString(), although some thought is required as to how it should be implemented for arbitrary parametric curves. The usual work in progress
As always, Singularity can be downloaded here. Experiment and have fun!
May 5, 2008
Posted by
algorithmist |
Flex, Math |
|
4 Comments
This question comes up a lot, mostly from the standpoint of creating lightweight app. managers in Flash CS3 that load independent portions of an application that are written in Flex. I’ve used this in the past for PureMVC applications that load other PureMVC apps, for example. The technique in the sample files is a quick hack, but hacks can be fun. No time for a full-on tutorial, so you’ll have to deconstruct it yourself. Pretty easy to figure out and you will probably be able to find the cleaner way to accomplish the task as well
The Flex -> Flash example shows how to create a simple Flex app. with a button that dispatches an event on click. The Flash CS3 Document class loads the .swf created by Flex and assigns a handler for the event. The handler manipulates the button and calls a public method defined in the Flex app’s SCRIPT block.
The same method can be used to load Flex into Flex and there are examples of both. The Flex -> Flex example shows a couple variations that may be of interest to you.
There is a README file with the code distribution. Download the files here and have fun!
April 30, 2008
Posted by
algorithmist |
Flash, Flex |
|
1 Comment
Interesting draft weekend. Thought my two teams (Cowboys and Falcons) did okay. Kind of surprised the boys did not take a receiver, but for a good draft pick, need must coincide with opportunity. The added 3rd- and 4th-round picks next year could be parlayed into a trade-up for a good receiver, so we’ll have to hope Glenn has at least one good year left. Nice to see the Falcons put the Vick era behind them. Not sure that Ryan is really a top first-round QB, but I hope it works out and hope to see the Falcons on the rebound this year.
April 28, 2008
Posted by
algorithmist |
General |
|
1 Comment
Although it’s been over 25 years since I touched a racket, I’ve decided to take up tennis as part of my general ‘get back in shape’ initiative
Just curious if there are any Flash/Flex tennis players in the D/FW area? Once I get my game back (interpretation - at least hold my own against an 8-year old), maybe we ought to have a Flash/Flex league or something. Might be a good way to network and keep in shape at the same time.
April 25, 2008
Posted by
algorithmist |
General |
|
No Comments
A brief mention of some recent 3D developments. Been following the Alternativa engine development for a while and their blog shows some very interesting demos. At a glance, it seems to be optimized for interactive gaming, whereas PV3D is being developed for very general usage. I could be way off on that - just a quick observation :) Check it out for yourself here.
Eduardo Dias da Costa pinged me about a 3D panoramic viewer, which you can see here. That’s it for now … back to work!
April 18, 2008
Posted by
algorithmist |
Flash, General |
3D |
2 Comments
A quick update from the underground (should be coming up for a bit of air in the near future). A new method has been added (and a small bug fix) in the quad. Bezier class. As always, Singularity can be downloaded here.
A preview of upcoming methods include Bezier y at x and a possible TechNote on easing with parametric curves.
April 15, 2008
Posted by
algorithmist |
Flex, Math |
|
No Comments
I’ve started a very large project that will keep me occupied 7 days as week for quite some time. Just a quick note to inform everyone that blog posts will be very sparse for quite a while. Thanks.
February 23, 2008
Posted by
algorithmist |
General |
|
3 Comments
This impressive work was created by Lessrain in Papervision 3D. I can really appreciate the effort that went into this one.
Check out the Red Bull Flight Lab.
February 20, 2008
Posted by
algorithmist |
Papervision 3D |
|
No Comments