Java-Gaming.org Hi !
Featured games (88)
games approved by the League of Dukes
Games in Showcase (679)
Games in Android Showcase (194)
games submitted by our members
Games in WIP (733)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Rotating a 1D matrix  (Read 1364 times)
0 Members and 1 Guest are viewing this topic.
Offline Vasari

Junior Newbie





« Posted 2013-07-22 15:02:35 »

So the way I render images onto the screen involves having an array of color data from a buffered image. I can manipulate that one image, through the color data, and basically render any other image into that main buffered image. The problem I'm having right now is I'm having trouble implementing a rotation transformation correctly on this array.
I've gotten strange results, where the sprite is rotating around the origin (top left corner). I couldn't really figure out how to make it rotate around it's center or any point. Also with that rotation, there are tiny gaps in the sprite while it's rotating.
Offline Mac70
« Reply #1 - Posted 2013-07-22 15:16:39 »

This is how the rotation work - you need to use coordinates like (-1, 1).

About tiny gaps in the sprite - can you show this problem or explain it more?
Offline Vasari

Junior Newbie





« Reply #2 - Posted 2013-07-22 16:49:30 »

When the object is rotating, the pixels themselves aren't rotating around their center, they're just rotating around another fixed point. So with that effect, there are pixel sized gaps evenly spread throughout the object. I think this happens in order to preserve the actual shape of the object.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Vasari

Junior Newbie





« Reply #3 - Posted 2013-07-28 15:28:44 »

So I guess there are a lack of linear algebra folk around here haha Close the thread, I've figured it out after reading a bit about matrix transformations.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 
Hydroque (21 views)
2016-05-26 14:45:46

Mac70 (42 views)
2016-05-24 21:16:33

theagentd (45 views)
2016-05-14 18:38:35

theagentd (78 views)
2016-05-10 22:37:41

theagentd (86 views)
2016-05-10 22:33:46

IanParcs (112 views)
2016-04-18 14:18:53

KaiHH (111 views)
2016-04-18 08:35:41

KaiHH (133 views)
2016-04-15 12:43:58

theagentd (137 views)
2016-04-14 02:16:17

theagentd (160 views)
2016-04-14 02:15:43
FPS Camera Tutorial
by Hydroque
2016-05-22 05:40:58

Website offering 3D Models specifically for games for free
by vusman
2016-05-18 17:23:09

Website offering 3D Models specifically for games for free
by vusman
2016-05-09 08:50:56

Website offering 3D Models specifically for games for free
by vusman
2016-05-06 11:10:21

Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17

List of Learning Resources
by SilverTiger
2016-02-05 09:39:47

List of Learning Resources
by SilverTiger
2016-02-05 09:38:38

List of Learning Resources
by SilverTiger
2016-02-05 09:35:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!