×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    99

    QTransform problem on Symbian phone...

    Here is the problem: i am using QTransform to paint an image on the screen.

    This is the matrix i am using:
    m11=5.36336e-05
    m12=8.91723e-07
    m13 = 0
    m21=1.30209e-06
    m22=-3.80648e-05
    m23 = 0
    m31=6.95399
    m32=45.0656
    m33 = 1

    On Pc, on the simulator, this is done properly. On Symbian instead, this become a simple "scale" matrix with no shearing/rotation at all... which is WRONG.

    I guess the problem lies in the different way Symbian handles floating points... But does anybody has a pointer on how to fix this?
    Last edited by gardiol; 2011-02-07 at 15:51.

  2. #2
    Registered User
    Join Date
    Jul 2010
    Posts
    99

    Re: QTransform problem on Symbian phone...

    I am answering to myself.

    This is indeed another of the oh-so-many Qt bugs related to floating point and transformations. Really it seems Qt is riddled with these. Hey guys, never heard of floating point precision and rounding errors?

    Anyway, my solution has been calculate the "inverse" matrix then invert it. So all the mXY coefficients are big enough to avoid any internal roudoff imprecision in Qt and return a valid matrix, that then i invert.

  3. #3
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QTransform problem on Symbian phone...

    This is true that on ARM platform qreal is defined as float, while on desktop it's defined as double. It causes different results when you due to different rounding errors. This especially became crucial, when you do multiple matrix operations. However, your numbers are not small enough to be rounded, when single precision is used.
    I will leave this thread in Symbian forum, however, Symbian is not only ARM platform existing.

Similar Threads

  1. QTransform::rotate question
    By mj_124949727@126.com in forum Qt
    Replies: 2
    Last Post: 2010-12-17, 02:51
  2. ping on symbian phone
    By stenlik in forum Symbian Networking & Messaging (Closed)
    Replies: 7
    Last Post: 2006-01-31, 08:54
  3. Getting phone id on Symbian 9.x
    By deepikamulani in forum Symbian
    Replies: 1
    Last Post: 2006-01-24, 05:27
  4. web-server on symbian-phone
    By ronsimaschine in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2005-12-13, 12:44
  5. Mobile phone forensics on Symbian
    By AThonger in forum Symbian
    Replies: 1
    Last Post: 2005-09-27, 22:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×