• 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
NSAffineTransform
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSAffineTransform


  • Subject: NSAffineTransform
  • From: Jim Beard <email@hidden>
  • Date: Wed, 6 Feb 2002 10:06:40 -0800

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Howdy,

I've been trying to teach myself some of the graphical sides of cocoa, and lately I've been having trouble trying to rotate a NSBezierPath with NSAffineTransform. I understand that - -rotateByDegrees: will rotate around the origin. So to rotate it in place the transform must first -tranlateXBy: yBy: to the origin, then apply the -rotateByDegrees: and finally translate back. The problem I'm having is that after the rotation is applied, the translation back to the source location seems to travel along a rotated axis. So it isn't going back to where it came from, it continues on towards where it would have ended up had I only rotated it.

I've been establishing the NSAffineTransform like so:

[direction translateXBy:-thing_x yBy:-thing_y];
[direction rotateByDegrees:angle];
[direction translateXBy:thing_x yBy:thing_y];

Then drawing applying / drawing like this:

[[direction transformBezierPath:thing] fill];

I also tried making the translation back a second NSAffineTransform and applying separately with no luck. Is there something I'm missing? I've been using the Hillegass book and apple's site as references, but I haven't been able to find many samples of rotated transforms.

Jim

___________________________________
Jim Beard
Masters Student in CS @ U of Oregon
~
PGP Public Key: http://www.cs.uoregon.edu/~jim/pgp.html
1F87 0604 E10A 20BA 99FD E57D 7AAF 6B4E 3669 5B29
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (Darwin)
Comment: For info see http://www.gnupg.org

iD8DBQE8YXC0eq9rTjZpWykRAtbSAJ9OD5WjB5TAgGpdl2+ccHNoSZseKQCgiOFi
3rFWYD54r4OY3bd57w4/v6g=
=IsPB
-----END PGP SIGNATURE-----
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSAffineTransform
      • From: Jim Beard <email@hidden>
  • Prev by Date: Re: determining availability of a given glyph via NSFont
  • Next by Date: Re: Speed of Quartz (was: optimizing compilers)
  • Previous by thread: Re: NSMovie and resizing
  • Next by thread: Re: NSAffineTransform
  • Index(es):
    • Date
    • Thread