Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 1 Support › Rotation around x or y axis not working?

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4735

    Mathias

    Hi,

    I’m currently porting a game made in QML for Meego to Felgo. Most things works fine but I have some issues with the “card flip”-animations that were implemented using  Rotation element around y axis. I made a small test application to test the Rotation element and it seems to work fine to rotate an object around z axis, but not around x or y.

    Here is my code:

    import VPlay 1.0
    import QtQuick 1.1
    
    GameWindow {
        activeScene: scene
        width: 640
        height: 960
        
        Scene {
            id: scene
            width: 320
            height: 480
            
            Rectangle {
                anchors.fill: parent
                color: "black"
            }
    
            Rectangle{
                id: rectangle
                width: 100
                height: 100
                color: "red"
                anchors.centerIn: parent
                transform:  Rotation {
                    id: rotation
                    origin.x: rectangle.width/2
                    origin.y: rectangle.height/2
                    axis.x: 0; axis.y: 1; axis.z: 0     // set axis.y to 1 to rotate around y-axis
                    angle: 45    // the default angle
                }
            }
    
        }
    }

    Will this be fixed anytime soon?

    Thank you!

    – Mathias

    #4736

    Christian
    Felgo Team

    Hi Matthias,

    I’m sorry, but with our current renderer flipping is not possible. You could create the animation in any program and save the single sprite frames into a sprite sheet, and then play the animation sequence like an animated gif. Would this be sufficient for your use-case? Another workaround would be to animate the xScale of the sprite from 1 to 0, then change the sprite image, and then animate the xScale from 0 to 1.

    Cheers, Chris

    #4737

    Mathias

    In my case using sprites would not be practical. Animating the width will work fine in my case even if the effect is not as nice as the QML flip rotation. Thanx for the input.

Viewing 3 posts - 1 through 3 (of 3 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded