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

Re: Shearing with NSAffineTransform


  • Subject: Re: Shearing with NSAffineTransform
  • From: Thomas Lachand-Robert <email@hidden>
  • Date: Wed, 29 May 2002 23:07:33 +0200

Le mardi 28 mai 2002, ` 04:27 , Edwin Zacharias a icrit :

Can someone post a quick example of doing shearing with NSAffineTransform?
I can't seem to find one in the documentation.


A shearing matrix (in the x direction) has the form {1, s, 0, 1}, where s is the shearing coefficient; use {1, 0, s, 1} for shearing in the y direction.
So you need to use NSAffineTransform setTransformStruct with these values (plus two zero values for the translation coefficients).

For instance with s = 2, you get the matrix {1, 2, 0, 1}. The four vertices of the unit square will change as follows:
(0, 0) -> (0, 0)
(1, 0) -> (1, 0)
(1, 1) -> (3, 1)
(0, 1) -> (2, 1)
hence the two bottom points don't change, but the two top points are moved by s = 2 in the horizontal direction, which gives the shearing.


Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.
_______________________________________________
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: Shearing with NSAffineTransform
      • From: Edwin Zacharias <email@hidden>
References: 
 >Shearing with NSAffineTransform (From: Edwin Zacharias <email@hidden>)

  • Prev by Date: Hiding/Showing Table Columns
  • Next by Date: Re: Frontmost window of particular document type
  • Previous by thread: Shearing with NSAffineTransform
  • Next by thread: Re: Shearing with NSAffineTransform
  • Index(es):
    • Date
    • Thread