https://processing.org/tutorials/p3d/
Nice tutorial.
If you really go 3D your size() command uses P3D as 3rd parameter. Do you have this?
Then you can draw e.g. a cube by having points not only in one plane/canvas but behind and in front of the canvas. Thus drawing e.g. a cube. Drawing in space instead of on a canvas.
Next: For example you could different views:
From top
From north
From east
From south
From west
Or all 360 degrees inbetween
In each view mouseX and mouseY signify a different plane (view from top: x/z plane; view from north: x/y; from east, y/z etc.)
Next
When drawing instead of drawing continuously with the mouse you could have a mode where you position your 3D cursor freely (using cursor keys and p/l e.g.) and then on return draw (store) a line from last point to 3D cursor position.
Remark
I just realized that you indeed plan to have a 2D canvas inside a 3D environment. I wasn’t reading precisely what you have written. Your description was correct. So most of my points are useless. Sorry for that.
Remark II
since I am not allowed to post a new post, I have to edit / extend this post
for the drawing in an ArrayList thing:
I advice to check if the new point was already recorded.
Because when you hold the mouse without moving it for a second, it will easily store 60 times the same point.
Something like this (in 3D, you can modify it for 2D and for your code):
// Minor
void addPointIfNew() {
boolean allowedToAddNewPoint=true; // default
if (canvas.size()>0) {
// get last point
Line3D l3D = canvas.get(canvas.size()-1);
// if 3D point is the same ignore it
if (l3D.x==cursor3D.x &&
l3D.y==cursor3D.y &&
l3D.z==cursor3D.z)
allowedToAddNewPoint=false; // deny
}//if
if (allowedToAddNewPoint) {
canvas.add(new Line3D(previousPoint.x, previousPoint.y, previousPoint.z,
cursor3D.x, cursor3D.y, cursor3D.z, lineWeightCurrent, cursor3D.colBox));
previousPoint = cursor3D.getPos();
}//if
}//func