Results 1 to 4 of 4

Thread: Rotation along the Y-axis

  1. #1
    Join Date
    Jun 2013
    Posts
    46
    Thanks
    24
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Windows

    Post Rotation along the Y-axis

    Overview of program, to understand Question
    I'm loading an image in type QImage
    Then I paint the image in label,
    & allow user to make markings on image (draw point/ellipse/...)
    After the user finish editing the image
    All the points the user created via mouse clicks is stored in an array.

    Later in the program I'm rotating image along the y-axis then repainting the image.
    but when I paint all the points that were stored in array its not being rotated accordingly(naturally)

    The rotation of image along the y-axis.... Works
    How do I rotate the points along the same axis so its inline with image


    ie(creating a perspective look on output)

    code to transform image
    Qt Code:
    1. //before paint function
    2. QTransform pptv;
    3. pptv.rotate(-60, Qt::YAxis);
    4. image1 = image1.transformed(pptv);
    5. imageDrawFlag1 = true;
    To copy to clipboard, switch view to plain text mode 
    & i paint the transformed image
    but when it comes to repainting the points
    Qt Code:
    1. //In paint function
    2. foreach(tempPoint, markers)
    3. {
    4. painter.drawEllipse(tempPoint, 5, 5);
    5. }
    6. //painter.rotate -> only allows an integer, Does not allow which axis
    To copy to clipboard, switch view to plain text mode 

    How would I go about solving this issue?

    Kind Regards

    Having some network issues today, my posts or responses might be delayed

  2. #2
    Join Date
    Mar 2010
    Posts
    77
    Thanks
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Rotation along the Y-axis

    can you save all of your paintings in another image, and rotate that image?

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Rotation along the Y-axis

    What happens if you call QPainter::setTransform() with the same transform?

  4. The following user says thank you to ChrisW67 for this useful post:

    2lights (16th August 2013)

  5. #4
    Join Date
    Jun 2013
    Posts
    46
    Thanks
    24
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Windows

    Default Re: Rotation along the Y-axis

    QPainter::setTransform() with the same transform... Works

    Thanks

Similar Threads

  1. How to move items with x axis keep y axis
    By linhdong24 in forum Qt Programming
    Replies: 0
    Last Post: 5th July 2013, 03:39
  2. Replies: 9
    Last Post: 3rd May 2011, 22:21
  3. Graph rotation
    By jomarin in forum Qwt
    Replies: 2
    Last Post: 16th August 2010, 10:21
  4. Replies: 0
    Last Post: 9th August 2010, 11:46
  5. rotation and drawTexture
    By makism in forum Qt Programming
    Replies: 0
    Last Post: 24th May 2010, 09:01

Tags for this Thread

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.