• 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: Using affine transforms
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using affine transforms


  • Subject: Re: Using affine transforms
  • From: vincent habchi <email@hidden>
  • Date: Fri, 29 Apr 2011 17:26:28 +0200

Le 29 avr. 2011 à 17:01, McLaughlin, Michael P. a écrit :

> I am writing the drawRect routine for a custom view in which I need to draw
> a simple X-Y graph, given the data.  Desiring to be elegant and up-to-date,
> I decided that the best (Cocoa) way to do this was to construct a scaling
> affine transform to change x,y coordinates into view coordinates using
>
> CGAffineTransform matrix = CGAffineTransformMakeScale(360/(x2 - x1), 240/(y2
> - y1));

[…]

I think this method has the drawback, as you said, to apply to the image as a whole, line width included.

Basically, if this helps, what I did for my simple GIS, where I also need to translate from one set of coordinates (geographical) to another (screen) was to use the Accelerate framework (CBLAS), that provides the dot product you're looking for and matrix multiplications to "concatenate" your various transforms. You can then compute the new coordinates and then draw directly to screen.

Vincent_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Using affine transforms (From: "McLaughlin, Michael P." <email@hidden>)

  • Prev by Date: Using affine transforms
  • Next by Date: Hey,f
  • Previous by thread: Using affine transforms
  • Next by thread: Re: Using affine transforms
  • Index(es):
    • Date
    • Thread