Any suggestions for a good approach to implementing a zoomable 'keyframe' based curve editor? Essentially, something akin to the functionality of the graph editor in animation packages such as Maya. (see here).

I can see how to get started on something simple using Locators, but the ability to zoom and pan on long time ranges is something that looks tricky to me, and I suspect starting out with the right concept in the first place will save a lot of headaches...any ideas much appreciated.


You seem to be under the impression that writing an interface like that in Mathematica takes a lot of time. In fact Mathematica is a very good tool for rapid prototyping of such interfaces, and it's often fruitful not to think about how much time one could potentially waste and just try it.

I believe that your question about zoom and panning has already been answered here. The key to both zooming and panning is to control PlotRange. This can be done in different ways. Below is a very simple example and the link provides more advanced methods. I'm using LocatorPane as was suggested in the comments. Interpolate finds the curve that ties the locators together:

    InterpolatingPolynomial[pts, x], {x, offset, offset + width},
    PlotRange -> {{offset, offset + width}, {0, 10}}
  LocatorAutoCreate -> True
 {{offset, 0, "Offset"}, 0, 50},
 {{width, 10, "Width"}, 1, 50},
 Initialization :> (
   pts = {{0, 0}};



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.