Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help with Matrix manipulation



I'm stumped. Something that should be pretty simple is causing me grief.

I have an offscreen GWorld containing a high-resolution image (drawn there with GraphicsImportDraw).

I have a window I want to draw into.

I want to scale and rotate the source GWorld image while drawing it into my destination window. I am using the NULL codec and DecompressSequenceBegin to apply the matrix while drawing.

If the rotation value is zero degrees or 180 degrees, my scaling and drawing code work great. As soon as I rotate the image to 90 or 270 degrees, the image is offset in the destination window.

I know that I'm missing a translation here, but I'm stumped about how to make it work right.

Can someone help me with a simple set of "rules" for manipulating this matrix so things work right? For example, when calling "RotateMatrix" should I rotate about 0,0 or about the image's center? I'm sure one of these will be easier to work with than the other. What about using "MapMatrix" to do my scaling and translation? Should I call that before or after "RotateMatrix"?

I figure this is pretty ordinary stuff: given a source rectangle, and a destination rectangle (possibly scaled and rotated), determine the matrix which will map the first onto the second properly.

I'm sure this is straightforward, but it's really got me stumped. Any help would be terrific.

--
Cliff McCollum <email@hidden>
_______________________________________________
quicktime-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/quicktime-api
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.