[R] distance to eye in persp()

From: Robin Hankin <r.hankin_at_noc.soton.ac.uk>
Date: Mon 19 Sep 2005 - 18:08:33 EST


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/ camera?

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 from
the x,y,z point to the camera? I want this so I can plot clouds of points
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

R-help@stat.math.ethz.ch mailing list
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Wed Sep 21 03:07:30 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:20 EST