Remove scale transformation from a complex transform matrix 4x4?












1












$begingroup$


My common task is I have a rect with coordinates of its $2$ points: $(x, y, z), (x + a, y + b, z)$. I applied a $4times4$ transform matrix to it and it became a quadrilateral. Now for some reasons I can't use it this way and must apply scaling before other transformations. The list of operations is given below (it is used in computer graphics so I don't know exactly if it is a correct order or if it should be reversed). How to solve this issue?




  1. perspective (m34 = -0.0001);

  2. translation by z = -radius;

  3. rotation around x axis;

  4. rotation around y axis;

  5. scale (decrease the size);

  6. translation by z = radius.


This $4times4$ matrix is transposed (for example, m41 means translation by x, m42 translation by y and m43 translation by z).










share|cite|improve this question











$endgroup$

















    1












    $begingroup$


    My common task is I have a rect with coordinates of its $2$ points: $(x, y, z), (x + a, y + b, z)$. I applied a $4times4$ transform matrix to it and it became a quadrilateral. Now for some reasons I can't use it this way and must apply scaling before other transformations. The list of operations is given below (it is used in computer graphics so I don't know exactly if it is a correct order or if it should be reversed). How to solve this issue?




    1. perspective (m34 = -0.0001);

    2. translation by z = -radius;

    3. rotation around x axis;

    4. rotation around y axis;

    5. scale (decrease the size);

    6. translation by z = radius.


    This $4times4$ matrix is transposed (for example, m41 means translation by x, m42 translation by y and m43 translation by z).










    share|cite|improve this question











    $endgroup$















      1












      1








      1





      $begingroup$


      My common task is I have a rect with coordinates of its $2$ points: $(x, y, z), (x + a, y + b, z)$. I applied a $4times4$ transform matrix to it and it became a quadrilateral. Now for some reasons I can't use it this way and must apply scaling before other transformations. The list of operations is given below (it is used in computer graphics so I don't know exactly if it is a correct order or if it should be reversed). How to solve this issue?




      1. perspective (m34 = -0.0001);

      2. translation by z = -radius;

      3. rotation around x axis;

      4. rotation around y axis;

      5. scale (decrease the size);

      6. translation by z = radius.


      This $4times4$ matrix is transposed (for example, m41 means translation by x, m42 translation by y and m43 translation by z).










      share|cite|improve this question











      $endgroup$




      My common task is I have a rect with coordinates of its $2$ points: $(x, y, z), (x + a, y + b, z)$. I applied a $4times4$ transform matrix to it and it became a quadrilateral. Now for some reasons I can't use it this way and must apply scaling before other transformations. The list of operations is given below (it is used in computer graphics so I don't know exactly if it is a correct order or if it should be reversed). How to solve this issue?




      1. perspective (m34 = -0.0001);

      2. translation by z = -radius;

      3. rotation around x axis;

      4. rotation around y axis;

      5. scale (decrease the size);

      6. translation by z = radius.


      This $4times4$ matrix is transposed (for example, m41 means translation by x, m42 translation by y and m43 translation by z).







      matrices geometry trigonometry matrix-calculus matrix-decomposition






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Jul 16 '15 at 8:41







      Vyachaslav Gerchicov

















      asked Jul 16 '15 at 7:47









      Vyachaslav GerchicovVyachaslav Gerchicov

      1085




      1085






















          1 Answer
          1






          active

          oldest

          votes


















          0












          $begingroup$

          I multiply by additional matrices to "neutralize" perspective and translation (first 2 transforms) one by one then I apply scale (because the rotation and scale transforms don't need to be placed in a strict order). Then I "repeat" first 2 transforms I previously "removed".



          The reason I haven't found a solution previously is the perspective transform. It seems it breaks the whole matrix (or adds something like an unusual distortion) and common matrix rules may work no longer. In this case my way works if I "remove" the perspective by the first action and it won't work if I "remove" transforms from the end of the sequence.






          share|cite|improve this answer









          $endgroup$














            Your Answer








            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',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            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%2f1363020%2fremove-scale-transformation-from-a-complex-transform-matrix-4x4%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0












            $begingroup$

            I multiply by additional matrices to "neutralize" perspective and translation (first 2 transforms) one by one then I apply scale (because the rotation and scale transforms don't need to be placed in a strict order). Then I "repeat" first 2 transforms I previously "removed".



            The reason I haven't found a solution previously is the perspective transform. It seems it breaks the whole matrix (or adds something like an unusual distortion) and common matrix rules may work no longer. In this case my way works if I "remove" the perspective by the first action and it won't work if I "remove" transforms from the end of the sequence.






            share|cite|improve this answer









            $endgroup$


















              0












              $begingroup$

              I multiply by additional matrices to "neutralize" perspective and translation (first 2 transforms) one by one then I apply scale (because the rotation and scale transforms don't need to be placed in a strict order). Then I "repeat" first 2 transforms I previously "removed".



              The reason I haven't found a solution previously is the perspective transform. It seems it breaks the whole matrix (or adds something like an unusual distortion) and common matrix rules may work no longer. In this case my way works if I "remove" the perspective by the first action and it won't work if I "remove" transforms from the end of the sequence.






              share|cite|improve this answer









              $endgroup$
















                0












                0








                0





                $begingroup$

                I multiply by additional matrices to "neutralize" perspective and translation (first 2 transforms) one by one then I apply scale (because the rotation and scale transforms don't need to be placed in a strict order). Then I "repeat" first 2 transforms I previously "removed".



                The reason I haven't found a solution previously is the perspective transform. It seems it breaks the whole matrix (or adds something like an unusual distortion) and common matrix rules may work no longer. In this case my way works if I "remove" the perspective by the first action and it won't work if I "remove" transforms from the end of the sequence.






                share|cite|improve this answer









                $endgroup$



                I multiply by additional matrices to "neutralize" perspective and translation (first 2 transforms) one by one then I apply scale (because the rotation and scale transforms don't need to be placed in a strict order). Then I "repeat" first 2 transforms I previously "removed".



                The reason I haven't found a solution previously is the perspective transform. It seems it breaks the whole matrix (or adds something like an unusual distortion) and common matrix rules may work no longer. In this case my way works if I "remove" the perspective by the first action and it won't work if I "remove" transforms from the end of the sequence.







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered Jul 16 '15 at 9:18









                Vyachaslav GerchicovVyachaslav Gerchicov

                1085




                1085






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Mathematics Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    Use MathJax to format equations. MathJax reference.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1363020%2fremove-scale-transformation-from-a-complex-transform-matrix-4x4%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Human spaceflight

                    Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                    張江高科駅