[R] distance to eye in persp()
r.hankin at noc.soton.ac.uk
Mon Sep 19 10:08:33 CEST 2005
the manpage for persp() has a wonderful section where a the trans3d
is used with points() and lines() to add red dots and a green sinusoid
to the Mexican hat surface.
Does anyone have a way to tell what distance a point is from the eye/
Take the following line:
lines (trans3d(x, y=10, z= 6 + sin(x), pm = res), col = 3)
Is there a function like trans3d() that returns a vector of distances
the x,y,z point to the camera? I want this so I can plot clouds of
with the further ones in smaller plotsizes, and perhaps even fading
(as though viewed through fog).
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
More information about the R-help