Hooray wrote in Fri Nov 03, 2017 12:00 am:As a matter of fact, I think Alant was the one to originally inspire development of this - and I am sure that he'll agree that you have already exceeded all expectations at this point anyway.
Alant wrote in Fri Nov 03, 2017 1:04 am: My code will be much less object orientated than yours, as I find OO code very difficult to follow.
Hooray wrote in Wed Nov 15, 2017 10:05 pm:... establishing some kind of separation for the various components of the PAR screen - for example, by splitting the two graphs into separate diagrams, i.e. coming up with helper classes for 2D plotting using X/Y axes and a set of points to be plotted.
var drawLine = func(layer,from,to) { # from and to as [x,y] vectors ...
var drawVSD = func(layer, geo1, geo2, resolution, orig) { # resolution as <pixels/sample>, orig as [x,y] vector
....
I love the idea of taking control of the arriving AI objects (freeing them from their pre-assigned route) and guide them according to the GCA instructions.Hooray wrote in Wed Nov 15, 2017 10:05 pm:Speaking in general, it would be a good thing to aim for to support independent instances of the GCA module, because that would also come in very handy when working out a GCA module to instantiate/control AI objects without requiring manual intervention (= scripted pilots & scripted controllers)
Wow ! At some point I will try that.Hooray wrote in Thu Nov 16, 2017 9:45 pm:Yeah, it is absolutely possible to create a scripted "pilot" module that controls AI objects.
So, the Plot2D class would return a layer (neither a window nor a canvas nor a root group). Then PAR class would create the window/canvas/root and instance a Plot2D.new() for his XY area and another for the XZ one.Hooray wrote in Thu Nov 16, 2017 9:45 pm:Basically, the first step would be splitting the PAR class module into separate classes/files ... For instance, you would start by adding a Plot2D class that has two axes, with each axis having an associated label and the whole Plot2D class taking a vector of data points.
var plot2D = {
new: func() {
var m = {parents:[canvas.Window, canvas.PropertyElement, plot2D ] };
m.x0 = 0;
m.y0 = 0;
m.create = func(root,size) {
m.size = size;
root.createChild("group");
};
m.setOrigin = func(x0, y0) {
m.x0 = x0;
m.y0 = y0;
};
m.plotGrid = func(dx=50, dy=80) {
var grid = m.createChild("path", "grid").setColor(0.25,0.25,0.25);
for(var x=m.x0; x<m.size.width; x+=dx){
grid.moveTo(x, m.y0).lineTo(x,m.size.height-2);
}
for(var y=m.y0; y>0; y-=dy){
grid.moveTo(2, y).lineTo(m.size.width-2,y);
}
};
return m;
...
me.graph = plot2D.new();
me.graph.create(m.root,m.size);
...
me.grid = me.graph.plotGrid(dx:me.hzGrid*me.XYscale, dy:me.vtGrid*me.Zscale);
Users browsing this forum: No registered users and 4 guests