• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Help with NSAffineTransform?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with NSAffineTransform?


  • Subject: Re: Help with NSAffineTransform?
  • From: matt neuburg <email@hidden>
  • Date: Sun, 30 May 2004 09:06:27 -0700

On Sat, 29 May 2004 08:48:36 -0700, Vince Ackerman <email@hidden> said:
>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?

How about doing neither? If that's how you want the origin and bounds of
your view to be, make the origin and bounds of your view be that way. That
way there's nothing to convert.

<http://developer.apple.com/documentation/Cocoa/Conceptual/DrawViews/Tasks/
TransformingCoords.html>

m.
--
matt neuburg, phd = email@hidden, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
AppleScript: the Definitive Guide! NOW SHIPPING...! (Finally.)
http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt
Subscribe to TidBITS! It's free and smart. http://www.tidbits.com/
_______________________________________________
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.


  • Prev by Date: Window won't show a second time.
  • Next by Date: NSRulerView
  • Previous by thread: Help with NSAffineTransform?
  • Next by thread: Getting filename of just opened document...
  • Index(es):
    • Date
    • Thread