I don't understand modelX/modelY

hello,

That’s a good point (no pun intended). Here you can use screenX and screenY and compare them to the mouse pos.
Another method is an off-screen PGraphics, like point B here: Selecting & Moving 3D Primitives - urgent - #3 by Chrisir

Another very good point!

In fact I asked this here: Pro-Question: place a point in 3D with mouse and
here P3D Formula : opposite of screenX and screenY is ...?

I still think this is solvable.

For example when you place a new cube, you could assume the same Z value as the previous cube. Then the new x and y should be calculable.

Chrisir