Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Matrix transformation sensitivity

Matrix transformation sensitivity

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 373 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Trian
    wrote on last edited by
    #1

    I use QMatrix4x4 to find position of an item on screen as below. When xFactor in matrix.scale( xFactor, 1.0f ) is small, transformation goes smoothly and work as expected. When I drag the item on a touch screen, the item follows my finger property. However, when xFactor gets large, transformation is insensitive and jumpy. When dragging, the item no longer follows my finger. At this time, matrix has been changed, but matrix multiplies by the vector position does not change the position. It behaves as if this matrix does not change a lot; as a result, vector position does not change. If I keep dragging a bit more, the item jumps to another position (approximately 100 px from its previous position). This somehow suggests that all of a sudden, the matrix has been changed a lot and yielded a big jump. Any suggestions on what could cause this behavior?

    //your code here
                QMatrix4x4 matrix;
                matrix.translate( m, n ); //translate back to qt coordinate where origin is top left corner
                matrix.scale( xFactor, 1.0f );
                matrix.translate(-x, -y);  // position back to origin ( 0 , 0 )
                //qDebug()<<" matrix " << matrix;
                //find x
                QPointF point( localX , 0);
                QPointF tranformPoint = matrix.map(point);
                float x = tranformPoint.x();
                //qDebug()<< " x " << x;
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved