home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky alt.3d:1765 comp.graphics:14113 comp.graphics.animation:1721 rec.games.programmer:5489
- Organization: Sophomore, Mathematics, Carnegie Mellon, Pittsburgh, PA
- Path: sparky!uunet!spool.mu.edu!uwm.edu!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!news.sei.cmu.edu!bb3.andrew.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!ps1o+
- Newsgroups: alt.3d,comp.graphics,comp.graphics.animation,rec.games.programmer
- Message-ID: <EfLzbQu00iV3Q154w6@andrew.cmu.edu>
- Date: Fri, 22 Jan 1993 08:42:52 -0500
- From: Philip John Stroffolino <ps1o+@andrew.cmu.edu>
- Subject: Re: 3D mapping
- In-Reply-To: <C14433.8r@cs.mcgill.ca>
- References: <C14433.8r@cs.mcgill.ca>
- Lines: 30
-
- Here's a method that will produce a 3d mapping:
-
- let d represent depth, (d>=0)
- let h represent horizontal position, -(1+d) <= h <= (1+d)
- let v represent height
-
- m := 1/(1+d)
- x := m*h
- y := m*(d+v)
-
- output: square centered at (0,0) with side length 2; {(-1,-1) to (+1,+1)}
-
-
- test demo: plots a grid of points, 3d style
-
- v:=-1; {plot grid as viewed from above}
- for d:=0 to max step .25 do {max should be bigger than 5}
- begin
- m:=1/(1+d);
- for x:=-(1+d) to (1+d) step .25 do
- begin
- x:=m*h;
- y:=m*(d+v);
- plot ((x+1)*HalfScreenWith,(1-y)*HalfScreenHeight); {scale to window}
- end;
- end;
-
-
-
- - Phil -
-