home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: rec.games.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!ux1.cso.uiuc.edu!cs.uiuc.edu!sparc0b!wang
- From: wang@cs.uiuc.edu (Eric Wang)
- Subject: Re: skewed map
- Message-ID: <Bzn26q.Dq@cs.uiuc.edu>
- Sender: news@cs.uiuc.edu
- Reply-To: wang@cs.uiuc.edu
- Organization: University of Illinois at Urbana-Champaign
- References: <724788017.0@njackn.fidonet.org>
- Distribution: usa
- Date: Tue, 22 Dec 1992 02:13:37 GMT
- Lines: 21
-
- Jacob.Hartog@f99.n121.z1.fidonet.org (Jacob Hartog) writes:
-
- > Assuming you have a coordinate plane with its origin at a given point.
- > Does anyone have any idea how you would get the x,y of points on that
- > in terms of another coordinate plane skewed off the original one n
- > number of degrees with its origin at a different point.
-
- Assuming that all info is stored in a global coordinate system (x,y),
- and that the player defines some local coordinate system whose origin is
- located at (xc,yc) in the global coord sys, and is furthermore rotated
- theta degrees with respect to it, then a point (xl,yl) in the local
- coordinate system translates back to a point (x,y) in the global
- coordinate system by
-
- x = xl cos theta - yl sin theta + xc
- y = yl cos theta + xl sin theta + yc
-
- This stuff is taught in any introductory computer graphics class.
-
- Eric Wang
- wang@cs.uiuc.edu
-