Results 1 to 4 of 4

Thread: Animate a plane along an endless line

  1. #1
    Join Date
    Sep 2010
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Maemo/MeeGo

    Default Animate a plane along an endless line

    I'm quite new to QML and I'm trying to program a little game.

    I'm trying to animate a plane flying along an endless line. If the rotation of the plane changes the plane updates it's path (line). I implemented this feature in js, but the problem is that the animations are never smooth.

    Using any animation like NumberAnimation the plane moves very smooth, but these Animations are all from-to based, so I can move from A to B but I cannot (or I dont know how) move the plane continuous along an endless line using a NumberAnimation.

    Any suggestions?

    plan_rich
    Last edited by plan_rich; 30th December 2010 at 17:19. Reason: changed title

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Animate a plane along an endless line

    Please explain more what you mean by an endless line. A screen has a limited width and height so if you call something as "endless" you surely have some special meaning for it.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2010
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Maemo/MeeGo

    Default Re: Animate a plane along an endless line

    My plane has a rotation from 0-360 degree. I what that the plane flies in this rotation direction.

    So if it has a rotation of 90 degree it moves along the x axis to the right...

    plan_rich

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Animate a plane along an endless line

    So the end point of the current animation is an intersection of the vector of its direction and the edge of the screen. Whenever the direction changes, update the end point. Note that using SmoothedAnimation might be better than NumberAnimation.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Getting std::string object from QString object ( qt3)
    By joseph in forum Qt Programming
    Replies: 11
    Last Post: 28th March 2013, 20:09
  2. Replies: 4
    Last Post: 20th August 2010, 13:07
  3. Replies: 1
    Last Post: 30th July 2010, 23:05
  4. writing object to the file(Object Persistance)
    By jjbabu in forum Qt Programming
    Replies: 2
    Last Post: 11th June 2009, 14:28
  5. Open a QMainWindow Object in QDialog Object
    By chuengchuenghq in forum Qt Programming
    Replies: 1
    Last Post: 13th June 2008, 06:33

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.