Workflow for using bezier curves with Core Animation
I recently worked on a project that made extensive use of Core Animation. The results were quite good. Ideally, I would have used layers and bezier curves for the motion.
Does anyone have a good workflow for creating the data points to th开发者_如何学Pythonen use when creating a curve? I got lost a bit with the control points. Conceptually, I do understand what is going on.
Is there a 3rd party software that will let you visually create a Bezier curve and then export it to a text file to include in source code?
This is probably not as straightforward as you're looking for, but OmniGraffle exports its scenes in XML assuming you don't compress them. If you know Python, or some other scripting language with xml support, ts pretty straightforward to parse the XML to get at the bezier values therein. I am using this approach to generate CoreAnimation bezier paths and it works well.
So, roughly what I'm doing:
Create a reference rectangle in OmniGraffle the same pixel size as your Display
Draw some bezier curves.
Save the file as XML (make sure compression is off-in a palette somewhere)
- Using python/XML parse the curve data out of the saved scene file
- Save out a nicer curve-only xml file resource for your App to read.
- Write code in your app to load the XML and create CoreAnimation curves using the bezier values from the file
Free http://inkscape.org/ has XML editing capabilites compatible with SVG format http://www.w3.org/Graphics/SVG/
It allows drawing bezier and export their parameters.
精彩评论