Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!ucsd!ucbvax!AERO4.LARC.NASA.GOV!blbates From: blbates@AERO4.LARC.NASA.GOV ("Brent L. Bates AAD/TAB MS361 x42854") Newsgroups: comp.sys.sgi Subject: Re: transforming from screen to object coordinates Message-ID: <9007051214.AA28544@aero4.larc.nasa.gov> Date: 5 Jul 90 12:14:48 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 55 If I understand you correctly, I just started doing that recently. Below is some sample FORTRAN: ... integer*4 tranmatrix,xmice4,xwinlen,xwinorg,ymice4,ywinlen,ywinorg real scaleyz,xo,xoff,xtekscale,yo,yoff,ytekscale,zmin,zoom ... call getori(xwinorg,ywinorg) call getsiz(xwinlen,ywinlen) ... tranmatrix=genobj() call makeob(tranmatrix) call viewpo(0,xwinlen,0,ywinlen) call ortho(0.,xtekscale,0.,ytekscale,-.1,.1) call lookat(0.0,0.0,.1,0.0,0.0,0.0,0.0) call transl(xtekscale/2.0,ytekscale/2.0,0.0) call scale(zoom,zoom,1.0) call transl(-xtekscale/2.0,-ytekscale/2.0,0.0) call transl(xoff,yoff,0.0) call scale(scaleyz,scaleyz,1.0) call transl(0.0,-zmin,0.0) call closeo ... xmice4=getval(mousex)-xwinorg ymice4=getval(mousey)-ywinorg if(xmice4.lt.0) then xmice4=0 else if(xmice4.gt.xwinlen) then xmice4=xwinlen endif if(ymice4.lt.0) then ymice4=0 else if(ymice4.gt.ywinlen) then ymice4=ywinlen endif call mapw2(tranmatrix,xmice4,ymice4,xo,yo) xo and yo are the 2d world coordinates I hope this is what you are looking for. -- Brent L. Bates NASA-Langley Research Center M.S. 361 Hampton, Virginia 23665-5225 (804) 864-2854 E-mail: blbates@aero4.larc.nasa.gov or blbates@aero2.larc.nasa.gov