[R] distance to eye in persp()

Robin Hankin 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 
()  function
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  
to white
(as though viewed through fog).

Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743

More information about the R-help mailing list