Hi everybody. I'm trying to plot a 4-point bezier curve with moveable control-points on a DrawingPanel using AnalyticCurve. All is well as long as my FunctionX and FunctionY are in terms only of t and literals, but I am not able to employ any model variables (which would be tracking the control points I wish to manipulate). I've tried to employ custom functions instead, but that doesn't work for me either (EjsS_5.3_180211).
Please: can anybody advise on an appropriate approach to the above problem? I've thought that a custom element might hold the answer, but I'm not able to figure out how to implement that either. Any pointers to source code dealing with similar issues would be equally welcome. Thank you sincerely in anticipation.
Thank you for responding. I've abandoned the idea of using AnalyticCurve for this, and decided to use a Trail instead (solution attached). A custom function borrowed from https://gist.github.com/atomizer/1049745 implements de Casteljau's algorithm. Of course I'll be interested to know whether there is a way to do this sort of thing with either AnalyticCurve or Custom drawing elements.
Hi Mark, i read your source. i may not be able to help much with regards to 4 point Bézier curve but i do have a source here with analyticCurve generated from a functionField.
You perhaps can tinker the codes here to get slider a and b to be Points on the plottingPanel for a fixed curve fit.
Thank you very much for sharing, lookang. I'm not finding the time to study your example as rigorously as I'd like to, but I can see that I will learn a lot from this when I do. For now, the big insight is that your FunctionY-s are referring to functions which return strings. That hadn't occurred to me, but makes sense. Thanks again.