Path: utzoo!mnetor!uunet!husc6!bbn!uwmcsd1!ig!agate!ucbvax!AERO4.LARC.NASA.GOV!blbates From: blbates@AERO4.LARC.NASA.GOV (Bates TAD/HRNAB ms294 x2601) Newsgroups: comp.sys.sgi Subject: Re: stereo on iris Message-ID: <8802121301.AA11106@aero4.larc.nasa.gov> Date: 12 Feb 88 13:01:48 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 44 Interesting that you should pose that question now, I was just experimenting with that last week. Personally, I think lookat() is the best way to do it. I've got a program that I use to look at 3D grids, it rotates, magnifies, translates, and changes the perspective. I modified it slightly so that, in one buffer the object was drawn in RED with lookat() offset to the right about 1.0 and in the other buffer I draw in BLUE with lookat() offset to the left about 1.0. Then I swap buffers back & forth, and look at the screen with MAGENTA & CYAN filters. One thing I notice was that depending on how deep the object was I needed to adjust the field of view. With very deep objects, I needed a narrow view, with shallow objects, I could use a larger view. Usually, my field of view was less than 20 degrees. In FORTRAN: call getsiz(xlength,ylength) . . . totext=max(abs(xmax-xmin),abs(ymax-ymin),abs(zmax-zmin))*1.25 . . far=totext*1.5-viewpnt if(far.le.0) then far=totext*1.0e-4 endif near=-viewpnt if(near.ge.far.or.near.le.far*1.0e-3.or.near.le.0) then near=far*1.0e-2 endif call perspe(fovy,real(xlength)/real(ylength),near,far) if(red) then call lookat(viewpnt-totext,xpos-1.0,ypos,viewpnt,xpos,ypos,-900) else call lookat(viewpnt-totext,xpos+1.0,ypos,viewpnt,xpos,ypos,-900) endif I adjust xpos & ypos for translations and viewpnt for magnifications. If you are doing zbuffering near can't be 0.0 or < far*1.0e-3. The near to far ratio is not carved in stone, but the 0.0 is. I hope this is of some help, if you have any questions just ask. The RED and BLUE works ok, but I the stereo viewer would be better. You might try my way to test how things look and then get hard copy in the correct colors for the stereo viewer. Good luck. Brent L. Bates