Results 1 to 4 of 4

Thread: How to construct a QTransform?

  1. #1
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to construct a QTransform?

    Hi,

    I have 3 known points, which are mapped to another 3 known points.
    p1 -> p1'
    p2 -> p2'
    p3 -> p3'

    From those 6 points, how can I construct a QTransform?

    Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to construct a QTransform?

    Are we talking 2D or 3D? And is the mapping linear or not?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to construct a QTransform?

    Quote Originally Posted by wysota View Post
    Are we talking 2D or 3D? And is the mapping linear or not?
    It is for 2D linear mapping, but perhaps 3D may be needed later...

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to construct a QTransform?

    Then you need to solve the following equation:
    ax + by + c = 0

    Substituting x and y with coordinates of your three points to calculate a, b and c and then place them in the matrix. Of course x and y correspond to p1.x and p1'.x and not p1.x and p1.y. You need a similar equation for p1.y and p2.y

    http://en.wikipedia.org/wiki/System_of_linear_equations
    http://en.wikipedia.org/wiki/Gaussian_elimination
    Last edited by wysota; 24th June 2011 at 15:35.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    lni (25th June 2011)

Similar Threads

  1. Replies: 0
    Last Post: 20th April 2009, 17:45
  2. Must construct QApplication before QPaintDevice
    By sekatsim in forum Qt Programming
    Replies: 16
    Last Post: 8th June 2008, 00:00
  3. How to construct a ip contraler?
    By longtrue in forum Qt Programming
    Replies: 1
    Last Post: 7th March 2008, 06:48
  4. Replies: 15
    Last Post: 21st April 2007, 17:46
  5. How to construct Image from Bytes
    By vishal.chauhan in forum Qt Programming
    Replies: 2
    Last Post: 29th January 2007, 05:41

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.