Hi guys,
Think it might be a very late answer, but anyways by the brief look of your code, the error you're having might still be caused by initializing issue,
Frame canvas = new Frame();
Frame playGround = new Frame(canvas);
this.canvas = getApplicationData().getFrame("/canvas").copy();
Frame point1 = playGround;
Your former code above,
doing it in this sequence will never give you desired values to your 'playGround' and 'point1' variables.
because you passed an instance of canvas to playGround before it actually have some values. -> java is pass by value not pass by reference
And this is why we are not suggested to initialize field variables(class variables) at the same time we declare it.
simply, it should be like this,
// field variables
Frame canvas;
Frame playGround;
public void initialize() {
this.canvas = getApplicationData().getFrame("/canvas").copyWithRedundancy();
// I highly recommend you to use copyWithRedundancy() insteady of copy(). Former one copies transformation including redundancy information while later one only copies transformation.
playGround = new Frame(canvas);
}
I do not know how you fixed it, but if you're seeing the error message saying 'cannot map the command...',
your target frame is not having a path from the only genuine static frame that is World.
By the code 'new Frame(AbstractFrame parent)', the frame should have path to the parent frame unless your parent itself is also not having a correct path to World.
I'm just saying because this is the reason for your former code, and I do not know your revised code.
Just in case, for you to patch it up, .setParent(canvas) right before you modify transformation values might be a way also.
And few more tips you might want to know,
1. Use ObjectFrame for taught frames(points you actually taught), and use Frame for the ones you made in a program.
2. Use .copyWithRedundancy() to convert your ObjectFrame to a Frame.
3. Using setX/setY/setZ... will change your frame's value only relatively to the frame itself(which is relative to its parent's transformation/orientation) which means every frames must be set as a child of a frame which you want to use as a base; in your case I think it's Canvas.
When it comes that you need to transform your frame relatively to other frame or to World frame, refer to the code below instead,
point1.transform( World.Current.getRootFrame(), Transformation.ofTranslation( x, y, z ) )
// point1 will be transformed x/y/z relative to World
4. Try use arrays(if the number is set) or List(if the number varies) to make your code compact and iterable.