Bug 202 - persp box occlusion bug
Summary: persp box occlusion bug
Alias: None
Product: R
Classification: Unclassified
Component: Graphics (show other bugs)
Version: old
Hardware: All Linux
: P5 normal
Assignee: R-core
Depends on:
Reported: 1999-06-02 18:02 UTC by Jitterbug compatibility account
Modified: 2011-04-11 07:40 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Jitterbug compatibility account 1999-06-02 18:02:03 UTC
From: wsi@gcal.ac.uk
Full_Name: Bill Simpson
Version: 64.1
OS: linux
Submission from: (NULL) (

Bug in persp() bounding box:
If the surface being plotted extends below the lower z-axis boundary, the box
drawn with the wrong occlusion. The box is shown as being occluded by the
even though it should be in front of the surface.

The box is correct for surface extending above the box. Problem is only for
surface extending below the box.

This exhibits the bug:

std<-rep(seq(-32,32,8),9)/1000 * 60
cf<-rep(seq(-32,32,8),rep(9,9))/1000 *60 
persp(std,cf,dp, xlim=c(-2,2), ylim=c(-2,2), zlim=c(0,5),theta=-40,    
box=TRUE,ltheta=-120, lphi=120,
d=1.5, shade=.7)

Comment 1 Jitterbug compatibility account 2000-02-28 23:19:00 UTC
 The persp algorithm does not apply the occlusion rules to the frame, 
which is always plotted first. 
A bug, but not very simple to fix.
Comment 2 Jitterbug compatibility account 2000-02-28 23:20:17 UTC
Audit (from Jitterbug):
Wed Jun 30 19:31:18 1999	pd	moved from incoming to Graphics
Thu Jul 01 18:19:48 1999	pd	changed notes
Sun Feb 20 10:07:11 2000	ripley	changed notes
Mon Feb 28 17:17:51 2000	pd	changed notes
Mon Feb 28 17:18:28 2000	pd	changed notes
Mon Feb 28 17:19:35 2000	pd	changed notes
Mon Feb 28 17:20:17 2000	pd	changed notes
Comment 3 Brian Ripley 2011-04-11 07:40:52 UTC
In fact the box is plotted twice, but edges of faces facing backwards
are plotted first.

The problem is that the *lim were chosen so that the surface was not
entirely within the box.  The help page now warns about that.