quadToQuadMatrix()

External developers... This forum's for you!

quadToQuadMatrix()

Postby gonetriadrr » Tue Aug 17, 2010 7:50 am

Mark posted XFcn code which calls QuadToQuadMatrix function of imageCompression.h of QuickTime framework IIRC.
Anyway, i'd like to modify to return floating point matrix values alone... if possible.

I am familiar with C only enough to tweak code similar to command line tool syntax.
Any assistance would be appreciated.

DCS
gonetriadrr
 
Posts: 170
Joined: Fri Jan 08, 2010 6:50 pm

Re: quadToQuadMatrix()

Postby codegreen » Tue Aug 17, 2010 8:08 am

If you want to do this using floating point coordinates without getting too bogged down in the underlying matrix math, Cocoa is probably the simplest way to go.

There's a simple (albeit a bit dated) example demonstrating this at:

  http://cocoadevcentral.com/articles/000045.php

HTH,
-Mark
codegreen
 
Posts: 1510
Joined: Mon Jul 14, 2008 11:03 pm

Re: quadToQuadMatrix()

Postby gonetriadrr » Tue Aug 17, 2010 8:46 am

mark wrote:If you want to do this using floating point coordinates without getting too bogged down in the underlying matrix math, Cocoa is probably the simplest way to go.
-Mark


I'm already bogged down in matrix math, but intentionally. :D
I've just not worked out how to calculate the proper matrix for skew and hoping the matrix returned by quadToQuadMatrix is a solution.
I need to be able to derive a skew matrix alone to round out my bezierPolygonEditor project which already includes scripted affine tranforms for translation, rotation and scaling.
Would prefer, at this point, to be able to compute matrix in pure supertalk since this is a learning project.
But i'll take what i can get.

DCS
gonetriadrr
 
Posts: 170
Joined: Fri Jan 08, 2010 6:50 pm

Re: quadToQuadMatrix()

Postby sctell » Tue Aug 17, 2010 11:30 am

onetriadrr wrote:But i'll take what i can get.


Not wanting to put you off but...

Why reinvent the wheel unless you are really enjoying the challenge.

Apple' docs are quite good, I was quickly pointed to NSAffineTransform when attempting scale/rotation in Cocoa.

See here:
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaDrawingGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40003290-CH201-SW1
sctell
 
Posts: 1128
Joined: Sun Jul 06, 2008 10:41 am

Re: quadToQuadMatrix()

Postby gonetriadrr » Wed Aug 18, 2010 1:25 pm

[quote="haden_young]Why reinvent the wheel unless you are really enjoying the challenge.[quote]

The point was, and still is, to build a native bezier drawing tool. And it has been a enjoyable and educational challenge. When SuperCard goes Cocoa and Mark rolls in bezier path scripting, i'll be way ahead of the game ;)

My ignorance may be showing, but from looking at Foundation framework/NSAffineTransform header...
the next to last entry may allow Cocoa to get the transform matrix values coerced from QuickTime's QuadToQuadMatrix.

In any case, I finally had a eureka moment last night and solved the skew matrix puzzle for the most part.
Though, QuadToQuadMatrix might allow easy pseudo perspective distortions and the like.

DCS
gonetriadrr
 
Posts: 170
Joined: Fri Jan 08, 2010 6:50 pm

Re: quadToQuadMatrix()

Postby S. Leys » Thu Aug 19, 2010 12:23 am

onetriadrr wrote: I finally had a eureka moment last night and solved the skew matrix puzzle for the most part.


WARNING : Gallic bluntness ahead :-P

I often had the feeling that some people think that programming consists in searching the APIs for the appropriate tricks and thread them like pearls.
I confess that I'm often practicing this technique myself.
I won't deny the interest of learning the APIs and I wish that I would know them better.
But what I'm really interested in is algorithmic.
It even happened that writing my own function, beyond the interest of doing it, produced a good round wheel instead of the square one found in the API (the opposite is true as well).
Since I'm a math believer (oxymoron) but not practising, people who are trying to understand math will always have my sympathy.

S.
User avatar
S. Leys
 
Posts: 628
Joined: Sun Jul 06, 2008 11:03 am

Re: quadToQuadMatrix()

Postby gonetriadrr » Thu Aug 19, 2010 9:03 am

Stephane Leys wrote:But what I'm really interested in is algorithmic.
--snip--
Since I'm a math believer (oxymoron) but not practising, people who are trying to understand math will always have my sympathy.

S.


Ditto!!!!!
Learning how to make the math follow the mouse can be a test in itself.
Especially when constraining to arbitrary angles.

My math skills are particularly pitifull. ;)

DCS
gonetriadrr
 
Posts: 170
Joined: Fri Jan 08, 2010 6:50 pm


Return to Xcode and the Internals Toolbox

Who is online

Users browsing this forum: No registered users and 1 guest