Page 1 of 1

NEED HELP! NAO!!! (Rotation code wise)

PostPosted: Wed Jun 11, 2008 9:22 pm
by Game A Gogo
after many great help from all of the forum members *COUGH*

anyways...

I MADE IT WORK! but it needs clean up. it rotates yes :D but it would be nice at least that there would be no black dots randomly...

here is the file. click the rotate button to rotate :D

soo... PLEASE HELP ME! it's very rare I need help anyway <,,<

I will give points to the one that cleans it up :O

and to sgt.sparky... I know you were working on something like this, well... D: nothing else to say lol

Re: NEED HELP! NAO!!! (Rotation code wise)

PostPosted: Wed Jun 11, 2008 10:48 pm
by feral
need more info ?

I cant seem to replicate the problem ?? sorry, what should i be looking for ?

feral

Re: NEED HELP! NAO!!! (Rotation code wise)

PostPosted: Wed Jun 11, 2008 11:39 pm
by Game A Gogo
ok, just enter like the number 1, then click rotate. you will see that it will take some data out of bound. which is all 0. I would like to be able to at least make it completly transparent or something

Re: NEED HELP! NAO!!! (Rotation code wise)

PostPosted: Wed Jun 11, 2008 11:51 pm
by pyrometal
It seems your rotating single pixels at once... By doing it that way, you generate those black pixels because pixels cannot be garanteed to align in a proper manner, generating data loss... I may know a method that could fix your problem, consists of taking average colors instead and using a similar rotation method. I'll try something for you ok?

Re: NEED HELP! NAO!!! (Rotation code wise)

PostPosted: Thu Jun 12, 2008 5:35 am
by pyrometal
Here! This is better and doesn't generate black pixels at all! Note that there is still loss in detail and data after after rotation, but the result is cleaner. I tried using an averaging method like I mentioned, but the results became very blured, and were very shitty... So instead, I opted for a system that creates a rotated version by selecting only the values of the closest matching pixel, this way, you avoid "voids" and also, without color averaging, only the original colors used will reappear. Don't rotate the same image continually because it will become very bad. Instead, draw the initial, save it, and everytime you need a new angle for it, reopen the original instead in order to minimize image loss. Hope this was helpful and that my comments in the code aren't too horrible to read! (I also made a test image! Nice program indead! I beleive its practically complete!)

Rotation Fixed.zip
Yay!
(162.12 KiB) Downloaded 158 times


--pyro

Re: NEED HELP! NAO!!! (Rotation code wise)

PostPosted: Thu Jun 12, 2008 1:35 pm
by DST
Well done!

Re: NEED HELP! NAO!!! (Rotation code wise)

PostPosted: Thu Jun 12, 2008 1:38 pm
by pyrometal
Thanks!

Re: NEED HELP! NAO!!! (Rotation code wise)

PostPosted: Thu Jun 12, 2008 1:52 pm
by Game A Gogo
Thanks a lot!!! With this, I will be able to make my next game :D

and this will be a great revolution without the need to have intense need of images.

Re: NEED HELP! NAO!!! (Rotation code wise)

PostPosted: Thu Jun 12, 2008 2:29 pm
by pyrometal
No problem! It was fun to figure out!

Re: NEED HELP! NAO!!! (Rotation code wise)

PostPosted: Thu Jun 12, 2008 8:06 pm
by Game A Gogo
and here is your two points :D now you are eligible to receive a free GE gold/silver (Forgot) version

and also, that program is old, and I just used it cuz it had what I needed for starting. I will implant the rotation engine in another game, where you have space ship and all. will be very interesting.

And what I like with your code is it's in degree, unlike my previous code, it was weird screwed up radians O,,o

Re: NEED HELP! NAO!!! (Rotation code wise)

PostPosted: Thu Jun 12, 2008 8:50 pm
by pyrometal
thanks a lot for the points Gogo! I have to warn you about one thing though, Using this in real time sucks up CPU power, especially if used extensively... It tried something like that with my bmp24 code series, and I got my CPU usage higher than 50% doing rather simple things. It will work fine for a single actor, but many actors could be risky.

Re: NEED HELP! NAO!!! (Rotation code wise)

PostPosted: Thu Jun 12, 2008 9:05 pm
by Game A Gogo
only 50%? not a lot. games usually take it all :P even on my parents computer

Re: NEED HELP! NAO!!! (Rotation code wise)

PostPosted: Thu Jun 12, 2008 9:28 pm
by pyrometal
Alright, just keep that in mind though!