The example code here for rgl does almost what I want. However my (x,y) are not in a rectangle but in a triangle that is half of the rectangle (x=0..1, y=0..1 and z is missing if x+y>1). My input
r - Adding Contour Lines to 3D Plots - Stack Overflow
3D R - Creating 3D Plots and Animations in R using rgl Package
3d volume matlab
plot - Plotting a 3D surface and a plane in R - Stack Overflow
ggplot2 - Contour plot using R - Stack Overflow
Field-dependent deep learning enables high-throughput whole-cell 3D super-resolution imaging
r - Adding Contour Lines to 3D Plots - Stack Overflow
From 3D Contour Plots to AI-Generated Art - Machine Learning Techniques
python - How to project filled contour onto a 3d surface plot - Stack Overflow