Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Animate a mesh rotation around a specific axis
QtWS25 Last Chance

Animate a mesh rotation around a specific axis

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt3d 2.0animationqmlc++
1 Posts 1 Posters 630 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    elsa
    wrote on 22 Aug 2018, 13:49 last edited by
    #1

    Hi everyone,
    I have a car and a car door that I want to animate to open. One task is to rotate the door around a specific axis, not the origin of the scene, which I already managed to do (see also this thread).
    Now I want to animate this rotation. I can easily use QPropertyAnimation to rotate the door around the origin, but how can I make the animation rotate around the axis I choose? Is there a built in rotation property with a rotation axis that I don't know of? Or do I have to define my own property? (If yes, how?) Or do I have to use another animation class?
    As far as I know, in QML you can do something like this:

    Rotation3D{
      id: doorRotation
      angle: 0
      axis: Qt.vector3d(0,1,0)
      origin: Qt.vector3d(-1.023, 0.836, -0.651)
    }
    
    NumberAnimation {target: doorRotation; property: "angle"; from: 0; to: -20; duration: 500}
    

    where you can define this Rotation3D object. Is there an equivalent to it in C++?

    Thanks!

    1 Reply Last reply
    0

    1/1

    22 Aug 2018, 13:49

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved