×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    63

    3D-like rotation on a 2d image

    Hi all
    I'd like to make 3D-like rotation on a flat image, to differentiate which way I'm rotating an image.
    I currently do

    Code:
                Rotation{
                    id:rotationY; origin.x:width/2; origin.y:height/2; axis { x: 0; y: 1; z: 0 } angle: tilt
                },
    On the element, but when the tilt is -10 and +10 it looks the same
    Rotation3D would do the job, but it's not available in the current version of Qt (correct me if I'm wrong)
    It would be good to skew the image to apply the perspective when rotating on Y axis, but I don't know how to do it either.


    Any ideas?
    Krzysztof Kucharewicz

  2. #2
    Registered User
    Join Date
    Apr 2009
    Posts
    23

    Re: 3D-like rotation on a 2d image

    I'm not really sure if it'll do exactly what you want, but you can try something like this:

    Code:
            transform: Rotation {
                origin {x: image.width/2; y: image.height/2}
                axis {x: 0; y: 1; z: 0}
                angle: 0
            }
    And then up the angle ofcourse

    Edit: Hmm, thats actually exactly what you posted :$

  3. #3
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    63

    Re: 3D-like rotation on a 2d image

    I've realized the rotation is always done exactly this way, only the effect was not very well visible with the image I used
    Krzysztof Kucharewicz

Similar Threads

  1. mixing 2d and 3d graphics
    By ed_welch in forum Symbian Media (Closed)
    Replies: 3
    Last Post: 2008-02-22, 10:38
  2. Replies: 6
    Last Post: 2008-02-13, 12:30
  3. Displaying 3D elements on a 2D canvas.
    By bouncebounce in forum Mobile Java General
    Replies: 2
    Last Post: 2006-06-01, 10:04
  4. create image rotation on top of screen
    By mohd_izzuan in forum Mobile Java General
    Replies: 3
    Last Post: 2006-05-05, 19:48
  5. jsr 184 3D to 2D coordinates
    By simonhayles in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2005-09-13, 22:17

Posting Permissions

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