Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: "John Emmer" Newsgroups: scea.yaroze.programming.2d_graphics Subject: Re: Algorithm to orbit? Date: 6 Aug 1997 04:19:53 GMT Organization: Justice Center Lines: 36 Message-ID: <01bca217$66cd2840$8df135ce@jjustice.iquest.net> References: <01bca03a$5c9d6ee0$8bf135ce@jjustice.iquest.net> <33E4E1EE.7CE0791A@ix.netcom.com> <01bca043$beb64300$8bf135ce@jjustice.iquest.net> <01bca04f$83feb6a0$8bf135ce@jjustice.iquest.net> <33E69E15.75F8@concentric.net> <01bca151$50db3f20$e7f135ce@jjustice.iquest.net> <33E7AFE5.6EA0@concentric.net> Reply-To: "John Emmer" NNTP-Posting-Host: and-003-13.iquest.net X-Newsreader: Microsoft Internet News 4.70.1161 Scott Cartier wrote in article <33E7AFE5.6EA0@concentric.net>... > Here's how I understand it. The sprite components mx and my > specify the "center" of your sprite. The pixel to which > (mx, my) refers will be the pixel that you are moving with > the x & y components. > > Lets say you have a GsSPRITE "sprt" which is 31 by 31 pixels > and you set (sprt.mx, sprt.my) to be the center (15, 15). > Now the components sprt.x and sprt.y don't refer to the upper- > left corner, but to the pixel pointed to by (sprt.mx, sprt.my). > So for instance, if you move your sprite to screen > coordinates (100, 100), the sprite will actually extend from > (86, 86) to (114, 114). > > The same goes for rotation. If you rotate the sprite, that > one pixel will stay put, but the other pixels will rotate > around it. > Ahhhh! Finally, the behavior of my program makes sense to me. I've been plugging in offsets all over the place and finally got things looking right, but only now do I understand why it's working the way it does. It hadn't even occurred to me that the center of rotation would also be the screen coordinates. For some reason I was stuck on their description as 'upper left' and assumed it would always be related to something of that description. Thank you! -- John Emmer Video Game Enthusiast, Philosopher, Fledgling Programmer jjustice@cs.bsu.edu jjustice@iquest.net jpemmer@bsuvc.bsu.edu Vectrex; 7800, Supercharger, Lynx, Jaguar; NES, SNES, Virtual Boy; Turbo Duo & Express; SG, SGCD, 32X, Saturn; 3DO; PlayStation, Yaroze; C64, A600, A1200, P100; Arcade Centipede, Spy Hunter, Neo-Geo; BA, MA, ABD