Apply force to bottom of object given rotation

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have a box and I want to apply a force in the direction that the bottom of the box is facing, given any Pitch, Roll, or Yaw rotation. At a resting point where pitch, roll, and yaw are 0, I know the downward force would be: x = 0, y = 0, z = -n, as the box is laying flat.



I also have the box's quaternion (qx, qy, qz, qw) available if that is helpful.



Here is a visual example showing my question:



A box with a pitch of 0



enter image description here



A box with a pitch of 90



enter image description here



How can I get this force using the objects rotation?







share|cite|improve this question





















  • @mvw The force will be applied in a loop, so as the rotation changes, the direction of the force needs to change with it to always be applied to the top of the box. At any given time I need to be able to get the direction the force needs to be in using the current rotation
    – funcs
    Jul 25 at 18:51











  • @mvw you are correct, sorry for my misuse of the terms!
    – funcs
    Jul 25 at 18:54










  • @mvw I am looking to get the X, Y, and Z direction of force (in my particular case, Z is less necessary)
    – funcs
    Jul 25 at 18:57










  • Is there no way to calculate the force from the present orientation alone? I don't think that's what I'm trying to find. The goal is the simulated gravity relative to the objects orientation.
    – funcs
    Jul 25 at 19:09










  • @mvw I believe my problem is much for simple than your interpretation of it. Lets just say for example my box's current orientation is: Pitch=90, Roll=10, Yaw=20. There is 0 force presently on the object (I need to calculate it and apply it myself!). Using that orientation information, can I calculate what the force needs to be to push on the top of the object. I also have the box's quaternion available if that is helpful.
    – funcs
    Jul 25 at 19:31















up vote
0
down vote

favorite












I have a box and I want to apply a force in the direction that the bottom of the box is facing, given any Pitch, Roll, or Yaw rotation. At a resting point where pitch, roll, and yaw are 0, I know the downward force would be: x = 0, y = 0, z = -n, as the box is laying flat.



I also have the box's quaternion (qx, qy, qz, qw) available if that is helpful.



Here is a visual example showing my question:



A box with a pitch of 0



enter image description here



A box with a pitch of 90



enter image description here



How can I get this force using the objects rotation?







share|cite|improve this question





















  • @mvw The force will be applied in a loop, so as the rotation changes, the direction of the force needs to change with it to always be applied to the top of the box. At any given time I need to be able to get the direction the force needs to be in using the current rotation
    – funcs
    Jul 25 at 18:51











  • @mvw you are correct, sorry for my misuse of the terms!
    – funcs
    Jul 25 at 18:54










  • @mvw I am looking to get the X, Y, and Z direction of force (in my particular case, Z is less necessary)
    – funcs
    Jul 25 at 18:57










  • Is there no way to calculate the force from the present orientation alone? I don't think that's what I'm trying to find. The goal is the simulated gravity relative to the objects orientation.
    – funcs
    Jul 25 at 19:09










  • @mvw I believe my problem is much for simple than your interpretation of it. Lets just say for example my box's current orientation is: Pitch=90, Roll=10, Yaw=20. There is 0 force presently on the object (I need to calculate it and apply it myself!). Using that orientation information, can I calculate what the force needs to be to push on the top of the object. I also have the box's quaternion available if that is helpful.
    – funcs
    Jul 25 at 19:31













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a box and I want to apply a force in the direction that the bottom of the box is facing, given any Pitch, Roll, or Yaw rotation. At a resting point where pitch, roll, and yaw are 0, I know the downward force would be: x = 0, y = 0, z = -n, as the box is laying flat.



I also have the box's quaternion (qx, qy, qz, qw) available if that is helpful.



Here is a visual example showing my question:



A box with a pitch of 0



enter image description here



A box with a pitch of 90



enter image description here



How can I get this force using the objects rotation?







share|cite|improve this question













I have a box and I want to apply a force in the direction that the bottom of the box is facing, given any Pitch, Roll, or Yaw rotation. At a resting point where pitch, roll, and yaw are 0, I know the downward force would be: x = 0, y = 0, z = -n, as the box is laying flat.



I also have the box's quaternion (qx, qy, qz, qw) available if that is helpful.



Here is a visual example showing my question:



A box with a pitch of 0



enter image description here



A box with a pitch of 90



enter image description here



How can I get this force using the objects rotation?









share|cite|improve this question












share|cite|improve this question




share|cite|improve this question








edited Jul 25 at 19:33
























asked Jul 25 at 18:33









funcs

11




11











  • @mvw The force will be applied in a loop, so as the rotation changes, the direction of the force needs to change with it to always be applied to the top of the box. At any given time I need to be able to get the direction the force needs to be in using the current rotation
    – funcs
    Jul 25 at 18:51











  • @mvw you are correct, sorry for my misuse of the terms!
    – funcs
    Jul 25 at 18:54










  • @mvw I am looking to get the X, Y, and Z direction of force (in my particular case, Z is less necessary)
    – funcs
    Jul 25 at 18:57










  • Is there no way to calculate the force from the present orientation alone? I don't think that's what I'm trying to find. The goal is the simulated gravity relative to the objects orientation.
    – funcs
    Jul 25 at 19:09










  • @mvw I believe my problem is much for simple than your interpretation of it. Lets just say for example my box's current orientation is: Pitch=90, Roll=10, Yaw=20. There is 0 force presently on the object (I need to calculate it and apply it myself!). Using that orientation information, can I calculate what the force needs to be to push on the top of the object. I also have the box's quaternion available if that is helpful.
    – funcs
    Jul 25 at 19:31

















  • @mvw The force will be applied in a loop, so as the rotation changes, the direction of the force needs to change with it to always be applied to the top of the box. At any given time I need to be able to get the direction the force needs to be in using the current rotation
    – funcs
    Jul 25 at 18:51











  • @mvw you are correct, sorry for my misuse of the terms!
    – funcs
    Jul 25 at 18:54










  • @mvw I am looking to get the X, Y, and Z direction of force (in my particular case, Z is less necessary)
    – funcs
    Jul 25 at 18:57










  • Is there no way to calculate the force from the present orientation alone? I don't think that's what I'm trying to find. The goal is the simulated gravity relative to the objects orientation.
    – funcs
    Jul 25 at 19:09










  • @mvw I believe my problem is much for simple than your interpretation of it. Lets just say for example my box's current orientation is: Pitch=90, Roll=10, Yaw=20. There is 0 force presently on the object (I need to calculate it and apply it myself!). Using that orientation information, can I calculate what the force needs to be to push on the top of the object. I also have the box's quaternion available if that is helpful.
    – funcs
    Jul 25 at 19:31
















@mvw The force will be applied in a loop, so as the rotation changes, the direction of the force needs to change with it to always be applied to the top of the box. At any given time I need to be able to get the direction the force needs to be in using the current rotation
– funcs
Jul 25 at 18:51





@mvw The force will be applied in a loop, so as the rotation changes, the direction of the force needs to change with it to always be applied to the top of the box. At any given time I need to be able to get the direction the force needs to be in using the current rotation
– funcs
Jul 25 at 18:51













@mvw you are correct, sorry for my misuse of the terms!
– funcs
Jul 25 at 18:54




@mvw you are correct, sorry for my misuse of the terms!
– funcs
Jul 25 at 18:54












@mvw I am looking to get the X, Y, and Z direction of force (in my particular case, Z is less necessary)
– funcs
Jul 25 at 18:57




@mvw I am looking to get the X, Y, and Z direction of force (in my particular case, Z is less necessary)
– funcs
Jul 25 at 18:57












Is there no way to calculate the force from the present orientation alone? I don't think that's what I'm trying to find. The goal is the simulated gravity relative to the objects orientation.
– funcs
Jul 25 at 19:09




Is there no way to calculate the force from the present orientation alone? I don't think that's what I'm trying to find. The goal is the simulated gravity relative to the objects orientation.
– funcs
Jul 25 at 19:09












@mvw I believe my problem is much for simple than your interpretation of it. Lets just say for example my box's current orientation is: Pitch=90, Roll=10, Yaw=20. There is 0 force presently on the object (I need to calculate it and apply it myself!). Using that orientation information, can I calculate what the force needs to be to push on the top of the object. I also have the box's quaternion available if that is helpful.
– funcs
Jul 25 at 19:31





@mvw I believe my problem is much for simple than your interpretation of it. Lets just say for example my box's current orientation is: Pitch=90, Roll=10, Yaw=20. There is 0 force presently on the object (I need to calculate it and apply it myself!). Using that orientation information, can I calculate what the force needs to be to push on the top of the object. I also have the box's quaternion available if that is helpful.
– funcs
Jul 25 at 19:31











1 Answer
1






active

oldest

votes

















up vote
0
down vote













I expanded my search terms to finding a force direction from a quaternion and was able to find an excellent answer by a user named Dobbs:




forward vector:



x = 2 * (xz + wy)



y = 2 * (yz - wx)



z = 1 - 2 * (xx + yy)



up vector:



x = 2 * (xy - wz)



y = 1 - 2 * (xx + zz)



z = 2 * (yz + wx)



left vector:



x = 1 - 2 * (yy + zz)



y = 2 * (xy + wz)



z = 2 * (xz - wy)




Using the "forward vector" with a negative magnitude I was able to apply a constant force onto the top of my object, no matter the orientation.






share|cite|improve this answer





















    Your Answer




    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("mathjaxEditing", function ()
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    );
    );
    , "mathjax-editing");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "69"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2862700%2fapply-force-to-bottom-of-object-given-rotation%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    I expanded my search terms to finding a force direction from a quaternion and was able to find an excellent answer by a user named Dobbs:




    forward vector:



    x = 2 * (xz + wy)



    y = 2 * (yz - wx)



    z = 1 - 2 * (xx + yy)



    up vector:



    x = 2 * (xy - wz)



    y = 1 - 2 * (xx + zz)



    z = 2 * (yz + wx)



    left vector:



    x = 1 - 2 * (yy + zz)



    y = 2 * (xy + wz)



    z = 2 * (xz - wy)




    Using the "forward vector" with a negative magnitude I was able to apply a constant force onto the top of my object, no matter the orientation.






    share|cite|improve this answer

























      up vote
      0
      down vote













      I expanded my search terms to finding a force direction from a quaternion and was able to find an excellent answer by a user named Dobbs:




      forward vector:



      x = 2 * (xz + wy)



      y = 2 * (yz - wx)



      z = 1 - 2 * (xx + yy)



      up vector:



      x = 2 * (xy - wz)



      y = 1 - 2 * (xx + zz)



      z = 2 * (yz + wx)



      left vector:



      x = 1 - 2 * (yy + zz)



      y = 2 * (xy + wz)



      z = 2 * (xz - wy)




      Using the "forward vector" with a negative magnitude I was able to apply a constant force onto the top of my object, no matter the orientation.






      share|cite|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        I expanded my search terms to finding a force direction from a quaternion and was able to find an excellent answer by a user named Dobbs:




        forward vector:



        x = 2 * (xz + wy)



        y = 2 * (yz - wx)



        z = 1 - 2 * (xx + yy)



        up vector:



        x = 2 * (xy - wz)



        y = 1 - 2 * (xx + zz)



        z = 2 * (yz + wx)



        left vector:



        x = 1 - 2 * (yy + zz)



        y = 2 * (xy + wz)



        z = 2 * (xz - wy)




        Using the "forward vector" with a negative magnitude I was able to apply a constant force onto the top of my object, no matter the orientation.






        share|cite|improve this answer













        I expanded my search terms to finding a force direction from a quaternion and was able to find an excellent answer by a user named Dobbs:




        forward vector:



        x = 2 * (xz + wy)



        y = 2 * (yz - wx)



        z = 1 - 2 * (xx + yy)



        up vector:



        x = 2 * (xy - wz)



        y = 1 - 2 * (xx + zz)



        z = 2 * (yz + wx)



        left vector:



        x = 1 - 2 * (yy + zz)



        y = 2 * (xy + wz)



        z = 2 * (xz - wy)




        Using the "forward vector" with a negative magnitude I was able to apply a constant force onto the top of my object, no matter the orientation.







        share|cite|improve this answer













        share|cite|improve this answer



        share|cite|improve this answer











        answered Jul 27 at 17:26









        funcs

        11




        11






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2862700%2fapply-force-to-bottom-of-object-given-rotation%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            What is the equation of a 3D cone with generalised tilt?

            Color the edges and diagonals of a regular polygon

            Relationship between determinant of matrix and determinant of adjoint?