We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › how to rotate an image without rotate() function
Page Index Toggle Pages: 1
how to rotate an image without rotate() function? (Read 324 times)
how to rotate an image without rotate() function?
Nov 9th, 2008, 11:21am
 
Dear all ,
could you help me how to rotate an image without rotate() function? using sin and cos function

thanks Smiley
Re: how to rotate an image without rotate() functi
Reply #1 - Nov 9th, 2008, 6:19pm
 
Draw a textured quad maybe ?

Is there a special reason you don't want to use rotate() ?
Re: how to rotate an image without rotate() functi
Reply #2 - Nov 9th, 2008, 8:00pm
 
(homework question?)

is just a case of iterating through the pixels and translating the source x and y to the new position using the input angle and standard 2d rotation matrix (see wikipedia).

it'll look pretty bad though because you'll get some overlap and some gaps in the output where the transformed pixels are reduced to integer positions.
Page Index Toggle Pages: 1