home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / rec / games / programm / 5154 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.3 KB  |  35 lines

  1. Newsgroups: rec.games.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!ux1.cso.uiuc.edu!cs.uiuc.edu!sparc0b!wang
  3. From: wang@cs.uiuc.edu (Eric Wang)
  4. Subject: Re: skewed map
  5. Message-ID: <Bzn26q.Dq@cs.uiuc.edu>
  6. Sender: news@cs.uiuc.edu
  7. Reply-To: wang@cs.uiuc.edu
  8. Organization: University of Illinois at Urbana-Champaign
  9. References: <724788017.0@njackn.fidonet.org>
  10. Distribution: usa
  11. Date: Tue, 22 Dec 1992 02:13:37 GMT
  12. Lines: 21
  13.  
  14. Jacob.Hartog@f99.n121.z1.fidonet.org (Jacob Hartog) writes:
  15.  
  16. > Assuming you have a coordinate plane with its origin at a given point.
  17. > Does anyone have any idea how you would get the x,y of points on that
  18. > in terms of another coordinate plane skewed off the original one n
  19. > number of degrees with its origin at a different point.
  20.  
  21. Assuming that all info is stored in a global coordinate system (x,y),
  22. and that the player defines some local coordinate system whose origin is
  23. located at (xc,yc) in the global coord sys, and is furthermore rotated
  24. theta degrees with respect to it, then a point (xl,yl) in the local
  25. coordinate system translates back to a point (x,y) in the global
  26. coordinate system by
  27.  
  28.     x = xl cos theta - yl sin theta + xc
  29.     y = yl cos theta + xl sin theta + yc
  30.  
  31. This stuff is taught in any introductory computer graphics class.
  32.  
  33. Eric Wang
  34. wang@cs.uiuc.edu
  35.