Help with NSAffineTransform?
Help with NSAffineTransform?
- Subject: Help with NSAffineTransform?
- From: Vince Ackerman <email@hidden>
- Date: Sat, 29 May 2004 08:48:36 -0700
I'm trying to understand NSAffineTransform object, and not having any
"eureka!" moments. In fact, it's down right confusing. What I'm
trying to do is fairly simple.... I think.
I have a custom view, that I'm plotting (drawing ) a moving point taken
from a real life device that is rectangular and has a different
coordinate system. The custom view has it's origin at (0,0) and size.x=
300, size.y = 230. The "real life" rect, has a coordinate sytem that
is centered on the middle of the rect (ie. (0,0) is dead center middle,
instead of the bottom left corner. This rectangle is measured from the
center by -12500 units left by +12500 units right of center (25000
units total x axis), by -10,000 bottom of center to +10000 units to
top of center (20000 units total height). So the equivilent point on
the custom view of (0,0) == (-12500, -10000) on the real life
rectangle. I need to convert readily back and forth between these two
points.
Is this something that NSAffineTransform is capable of doing? How do I
go about setting this up? Or would it be simpler to just come up with a
formula that converts the two coordinate systems? (I've already
kludged a formula together to do this to some extent, but the
conversion seems to lose a few points due to floats and rounding etc,
and it doesn't seem too elegant). I'm hoping someone has already done
this. I'm no calculus major so go easy on me if you can :)
Thanks in advance
Vince
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.