...

View Full Version : Rotation of a bitmap image (C++)



Monkeydude
10-18-2012, 03:01 AM
Hi.
I'm new at programming and I need some help with a task assigned for me.
I've been asked to Make a C++ program that can rotate an image q degrees around the point (x,y).

So far I have modified a program a friend of mine made that inputs the bitmap image and outputs a the new image, so that it works for what I want it to do.

I'm having trouble figuring out how to make the algorithm that rotates the image and how to code it. Another problem i'm having is that i'm quite new to programming, I can read and understand code but I have a really hard time just writing code.

Here's what I have made so far:
http://pastebin.com/VrxEYZMv
(The function rotate is the one i'm trying to make)

Monkeydude
10-18-2012, 11:01 AM
I've gotten the idea that I could interpret every pixel as a vector and rotate said vector using a 2d rotation matrix, but i'm not sure how I should do so.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum