Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
22 May, 2013, 00:31:04 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1]   Go Down
  Print  
Author Topic: Sprite/Picture rotating -  (Read 531 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Quigibo
The Executioner
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Yesterday at 02:03:21
Date Registered: 22 January, 2010, 05:02:37
Location: Los Angeles
Posts: 2022


Total Post Ratings: +1019

View Profile
« on: 07 January, 2012, 19:22:05 »
0

Not all pixels are being mapped to because you only Pxl-On if there was a Pxl-Test.  This restricts sprites to have the same number of pixels in the best case even though there could be a lot more when the sprite is rotated and I'm not even including the overlapped pixels.  Instead what you have to do is get a bounding box of the destination zone (which could be the whole screen) and then run for loops over the region to see if each destination pixel belonged to the original image.  So you need to find the inverse in your eqaution first of all:

XI = ([X - XOffset] * cos a) + ([Y - YOffset] * sin a)
YI = ([Y - YOffset] * cos a) - ([X - XOffset] * sin a)

Something like that...  So you for loop over the X and Y bounding box, pixel test if (XI,YI) is shaded, and if it is, fill in (X,Y)
« Last Edit: 07 January, 2012, 19:25:07 by Quigibo » Logged

___Axe_Parser___
Today the calculator, tomorrow the world!
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.264 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.