Skip to content
Prev 147848 / 398500 Next

question on rgl.surface

On 21/06/2008 2:48 PM, Mark Kimpel wrote:
You used open3d(), so you should use surface3d(), not rgl.surface(). 
The *3d functions interact with each other differently than the lower 
level rgl.* functions, and it's usually not a good idea to mix them.

You could get what you want with quads3d, by working out the corners of 
the rectangle you want:

quads3d(0, range(d3.mat[,2])[c(1:2,2:1)], range(d3.mat[,3])[c(1,1,2,2)], 
col="grey", alpha=0.3)

quads3d(range(d3.mat[,1])[c(1:2,2:1)], 0, range(d3.mat[,3])[c(1,1,2,2)], 
col="grey", alpha=0.3)

(This will look strange after your rgl.surface() call, but would 
otherwise be fine.)

There's also the grid3d() function if you want lines on the grids, e.g.

grid3d("x", at=list(x=0))
grid3d("y", at=list(y=0))
You want to change your viewpoint so that the screen is displayed as if 
it is closer to you.  The middle mouse button normally controls that, or 
you can increase the par3d("FOV") value from the default of 30.

Duncan Murdoch