Z-buffering Problems...
Glenn Randers-Pehrson, WMB
glennrp at BRL.ARPA
Fri Apr 22 22:36:29 AEST 1988
> From: zyda at NPS-CS.ARPA (michael zyda)
> Subject: Z-buffering Problems...
> IRIS 4D/70G Z-Buffering Problems...
>
> Problem: At the intersection of the sea and land you cannot
> rely on the Z-buffer to always draw the land over the water
> or even to consistently draw it the same.
>
> This solution is not very acceptable. Does anyone out there
> have similar experiences?"
>
Yes. On a 2500T, 3130, and 3030, I attempted to do a
hidden-line wireframe by drawing the filled polygons in a background color
and then drawing unfilled polygons. It did not work very well. I
complained to SGI and was told it was due to the resolution of the
geometry engine calculations. I think the exact quote was that "It
works as designed". [i.e. not necessarily as specified in the manual].
Here's a copy of my e-mail to SGI:
Glenn Randers-Pehrson <glennrp at brl.arpa>
Date: Thu, 3 Dec 87 12:21:54 EST
From: Glenn Randers-Pehrson (WMB) <glennrp at BRL.ARPA>
To: dave at sgi.com
Subject: polly()
Re: HOTLINE log 1824, 3 Dec 87
program pollytest
c demonstrates that poly() does not outline polygons properly
c in conjuntion with polf() in z-buffer mode. Tests polly()
c by Glenn Randers-Pehrson, which attempts to do this properly.
dimension square(3,4)
integer near,far
character*1 key
data near,far/x'c000',x'3fff'/
call ginit
call greset
call cursof
call setdep(near,far)
call ortho (0., 1.0, 0.0, 1.0, 1.0,-1.0)
call zbuffe(.true.)
call color(0)
call clear
do 200 mode=0,1
call zclear
kol=1
do 100 k=1,2
x=.025*k + .5*mode
y=.025*k + .1
z=k-1.5 + x*.01
square(1,1)=x
square(2,1)=y
square(3,1)=z+.01
square(1,2)=x+.3
square(2,2)=y
square(3,2)=z+.01
square(1,3)=x+.3
square(2,3)=y+.3
square(3,3)=z+.02
square(1,4)=x
square(2,4)=y+.3
square(3,4)=z
call color(kol)
call polf(4,square)
call color(3)
call cmov2(x,.5)
if(mode.eq.1)then
if(k.eq.1)call charst('polly()',7)
call color(2)
call polly(4,square)
else
if(k.eq.1)call charst('poly()',6)
call color(2)
call poly(4,square)
endif
kol=4
100 continue
200 continue
300 continue
read(*,'(a1)')key
call fhalt(1)
end
subroutine polly(n,xyz)
c FORTRAN version of poly() that uses zbuffer consistently
c with polf(), for use in making outlined polygons
c by Glenn Randers-Pehrson <glennrp at brl.arpa>
c U.S. Army Ballistic Research Laboratory
c Aberdeen Proving Ground, MD 21005-5066
dimension xyz(3,n)
dimension temp(3,2)
do 10 j=1,3
temp(j,1)=xyz(j,n)
10 continue
do 40 i=1,n
do 20 j=1,3
temp(j,2)=xyz(j,i)
20 continue
call polf(2,temp)
do 30 j=1,3
temp(j,1)=temp(j,2)
30 continue
40 continue
return
end
More information about the Comp.sys.sgi
mailing list