Results 1 to 5 of 5

Thread: animation in qt

  1. #1
    Join Date
    Apr 2012
    Posts
    101
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default animation in qt

    Hi
    i want to make animation of my object (i use ogre)
    is there any idea how i do that ?

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: animation in qt

    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: animation in qt

    Quote Originally Posted by amleto View Post
    Very clever. Have to remember that for the next time someone asks me a question they could have answered for themselves with a little bit of effort.

  4. #4
    Join Date
    Apr 2012
    Posts
    101
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: animation in qt

    Hi
    thanks for repling
    beh,
    yes , i see the links (before you put it her "i made effeort") but there is not like what i want
    in my case i have in each frame the position of my objects like that
    Qt Code:
    1. frame[i].object.x//frame[0].object.x=...,frame[1].object.x=.....,...............................
    2. frame[i].object.y
    3. frame[i].object.z
    To copy to clipboard, switch view to plain text mode 
    so i want when i clic to button i see my object in the new positions in each frame (like an animation)

  5. #5
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: animation in qt

    well, I dont know about ogre, but if you were rendering by qt, then use a basic index for time, or use http://qt-project.org/doc/qt-4.8/qtimeline.html.

    then reimplement paintevent to draw your objects using the time index.
    Qt Code:
    1. void widget::paintEvent(qpaintevent * evt)
    2. {
    3. int time = getTime(); // get time index from qtimeline or some other counter
    4.  
    5. // for each object in frame
    6. drawObjectAt(object, frame[tim].object.x, frame[tim].object.y, frame[tim].object.z); // func that draws an object at specific location.
    7. }
    To copy to clipboard, switch view to plain text mode 


    btw, it looks strange that you seem to have object as a property on frame. Normally animation would be a function of a model or model id.

    also might be useful
    http://www.developer.nokia.com/Commu...TimeLine_in_Qt
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. qml animation
    By vinayaka in forum Qt Quick
    Replies: 2
    Last Post: 21st September 2011, 05:44
  2. QML Animation
    By ujwala in forum Qt Quick
    Replies: 3
    Last Post: 11th August 2011, 08:14
  3. png not support animation in QT4.6
    By sophister in forum Qt Programming
    Replies: 6
    Last Post: 10th December 2009, 13:04
  4. Animation in Qt
    By A.H.M. Mahfuzur Rahman in forum Qt Programming
    Replies: 3
    Last Post: 25th June 2009, 07:05
  5. Animation in Qt
    By yogesh884 in forum Qt Programming
    Replies: 3
    Last Post: 29th January 2009, 09:56

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.