home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / alt / 3d / 1765 < prev    next >
Encoding:
Internet Message Format  |  1993-01-22  |  1.2 KB

  1. Xref: sparky alt.3d:1765 comp.graphics:14113 comp.graphics.animation:1721 rec.games.programmer:5489
  2. Organization: Sophomore, Mathematics, Carnegie Mellon, Pittsburgh, PA
  3. 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+
  4. Newsgroups: alt.3d,comp.graphics,comp.graphics.animation,rec.games.programmer
  5. Message-ID: <EfLzbQu00iV3Q154w6@andrew.cmu.edu>
  6. Date: Fri, 22 Jan 1993 08:42:52 -0500 
  7. From: Philip John Stroffolino <ps1o+@andrew.cmu.edu>
  8. Subject: Re: 3D mapping
  9. In-Reply-To: <C14433.8r@cs.mcgill.ca>
  10. References: <C14433.8r@cs.mcgill.ca>
  11. Lines: 30
  12.  
  13. Here's a method that will produce a 3d mapping:
  14.  
  15. let d represent depth, (d>=0)
  16. let h represent horizontal position, -(1+d) <= h <= (1+d)
  17. let v represent height
  18.  
  19. m := 1/(1+d)
  20. x := m*h
  21. y := m*(d+v)
  22.  
  23. output: square centered at (0,0) with side length 2; {(-1,-1) to (+1,+1)}
  24.  
  25.  
  26. test demo: plots a grid of points, 3d style
  27.  
  28. v:=-1; {plot grid as viewed from above}
  29. for d:=0 to max step .25 do {max should be bigger than 5}
  30. begin
  31.  m:=1/(1+d);
  32.  for x:=-(1+d) to (1+d) step .25 do
  33.  begin
  34.   x:=m*h;
  35.   y:=m*(d+v);
  36.   plot ((x+1)*HalfScreenWith,(1-y)*HalfScreenHeight); {scale to window}
  37.  end;
  38. end;
  39.  
  40.  
  41.  
  42. - Phil -
  43.