How to make the node translation?











up vote
0
down vote

favorite












The solarsystem case can make node rotate and I want to know how to animate an Object up and down?
This is the solarsystem case code:



Quaternion orientation1 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 0);
Quaternion orientation2 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 120);
Quaternion orientation3 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 240);
Quaternion orientation4 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 360);
ObjectAnimator orbitAnimation = new ObjectAnimator();
orbitAnimation.setObjectValues(orientation1, orientation2, orientation3, orientation4);
orbitAnimation.setPropertyName("localRotation");
orbitAnimation.setEvaluator(new QuaternionEvaluator());
orbitAnimation.setRepeatCount(ObjectAnimator.INFINITE);
orbitAnimation.setRepeatMode(ObjectAnimator.RESTART);
orbitAnimation.setInterpolator(new LinearInterpolator());
orbitAnimation.setAutoCancel(true);









share|improve this question




























    up vote
    0
    down vote

    favorite












    The solarsystem case can make node rotate and I want to know how to animate an Object up and down?
    This is the solarsystem case code:



    Quaternion orientation1 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 0);
    Quaternion orientation2 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 120);
    Quaternion orientation3 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 240);
    Quaternion orientation4 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 360);
    ObjectAnimator orbitAnimation = new ObjectAnimator();
    orbitAnimation.setObjectValues(orientation1, orientation2, orientation3, orientation4);
    orbitAnimation.setPropertyName("localRotation");
    orbitAnimation.setEvaluator(new QuaternionEvaluator());
    orbitAnimation.setRepeatCount(ObjectAnimator.INFINITE);
    orbitAnimation.setRepeatMode(ObjectAnimator.RESTART);
    orbitAnimation.setInterpolator(new LinearInterpolator());
    orbitAnimation.setAutoCancel(true);









    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      The solarsystem case can make node rotate and I want to know how to animate an Object up and down?
      This is the solarsystem case code:



      Quaternion orientation1 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 0);
      Quaternion orientation2 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 120);
      Quaternion orientation3 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 240);
      Quaternion orientation4 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 360);
      ObjectAnimator orbitAnimation = new ObjectAnimator();
      orbitAnimation.setObjectValues(orientation1, orientation2, orientation3, orientation4);
      orbitAnimation.setPropertyName("localRotation");
      orbitAnimation.setEvaluator(new QuaternionEvaluator());
      orbitAnimation.setRepeatCount(ObjectAnimator.INFINITE);
      orbitAnimation.setRepeatMode(ObjectAnimator.RESTART);
      orbitAnimation.setInterpolator(new LinearInterpolator());
      orbitAnimation.setAutoCancel(true);









      share|improve this question















      The solarsystem case can make node rotate and I want to know how to animate an Object up and down?
      This is the solarsystem case code:



      Quaternion orientation1 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 0);
      Quaternion orientation2 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 120);
      Quaternion orientation3 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 240);
      Quaternion orientation4 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 360);
      ObjectAnimator orbitAnimation = new ObjectAnimator();
      orbitAnimation.setObjectValues(orientation1, orientation2, orientation3, orientation4);
      orbitAnimation.setPropertyName("localRotation");
      orbitAnimation.setEvaluator(new QuaternionEvaluator());
      orbitAnimation.setRepeatCount(ObjectAnimator.INFINITE);
      orbitAnimation.setRepeatMode(ObjectAnimator.RESTART);
      orbitAnimation.setInterpolator(new LinearInterpolator());
      orbitAnimation.setAutoCancel(true);






      android arcore sceneform






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 at 8:44

























      asked Nov 20 at 7:28









      user10578038

      212




      212
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          I believe, It is the wrong consideration. Because ObjectAnimator can only animate subclass of View (like TextView, Button etc). But doesn't include Node.
          According to Documentation,




          A Node represents a transformation within the scene graph's hierarchy.
          It can contain a renderable for the rendering engine to render.




          You need more research about Node to make rotate






          share|improve this answer





















          • I modify the problem, can you please revisit it?
            – user10578038
            Nov 20 at 8:48










          • There was no attribute for View "localRotation". Please change View.rotationY or rotationX
            – Lwin Myo Aung
            Nov 20 at 9:14


















          up vote
          0
          down vote













          I work in this code:



          Vector3 vector1 = new Vector3(getRandom(), getRandom(), playNode.getLocalPosition().z);
          ObjectAnimator dropAnimation = new ObjectAnimator();
          dropAnimation.setObjectValues(vector1);
          dropAnimation.setPropertyName("localPosition");
          dropAnimation.setEvaluator(new Vector3Evaluator());
          dropAnimation.setRepeatCount(ObjectAnimator.INFINITE);
          dropAnimation.setRepeatMode(ObjectAnimator.RESTART);
          dropAnimation.setInterpolator(new LinearInterpolator());
          dropAnimation.setAutoCancel(true);

          return dropAnimation;





          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            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: 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
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53388145%2fhow-to-make-the-node-translation%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            I believe, It is the wrong consideration. Because ObjectAnimator can only animate subclass of View (like TextView, Button etc). But doesn't include Node.
            According to Documentation,




            A Node represents a transformation within the scene graph's hierarchy.
            It can contain a renderable for the rendering engine to render.




            You need more research about Node to make rotate






            share|improve this answer





















            • I modify the problem, can you please revisit it?
              – user10578038
              Nov 20 at 8:48










            • There was no attribute for View "localRotation". Please change View.rotationY or rotationX
              – Lwin Myo Aung
              Nov 20 at 9:14















            up vote
            0
            down vote













            I believe, It is the wrong consideration. Because ObjectAnimator can only animate subclass of View (like TextView, Button etc). But doesn't include Node.
            According to Documentation,




            A Node represents a transformation within the scene graph's hierarchy.
            It can contain a renderable for the rendering engine to render.




            You need more research about Node to make rotate






            share|improve this answer





















            • I modify the problem, can you please revisit it?
              – user10578038
              Nov 20 at 8:48










            • There was no attribute for View "localRotation". Please change View.rotationY or rotationX
              – Lwin Myo Aung
              Nov 20 at 9:14













            up vote
            0
            down vote










            up vote
            0
            down vote









            I believe, It is the wrong consideration. Because ObjectAnimator can only animate subclass of View (like TextView, Button etc). But doesn't include Node.
            According to Documentation,




            A Node represents a transformation within the scene graph's hierarchy.
            It can contain a renderable for the rendering engine to render.




            You need more research about Node to make rotate






            share|improve this answer












            I believe, It is the wrong consideration. Because ObjectAnimator can only animate subclass of View (like TextView, Button etc). But doesn't include Node.
            According to Documentation,




            A Node represents a transformation within the scene graph's hierarchy.
            It can contain a renderable for the rendering engine to render.




            You need more research about Node to make rotate







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 20 at 7:54









            Lwin Myo Aung

            276115




            276115












            • I modify the problem, can you please revisit it?
              – user10578038
              Nov 20 at 8:48










            • There was no attribute for View "localRotation". Please change View.rotationY or rotationX
              – Lwin Myo Aung
              Nov 20 at 9:14


















            • I modify the problem, can you please revisit it?
              – user10578038
              Nov 20 at 8:48










            • There was no attribute for View "localRotation". Please change View.rotationY or rotationX
              – Lwin Myo Aung
              Nov 20 at 9:14
















            I modify the problem, can you please revisit it?
            – user10578038
            Nov 20 at 8:48




            I modify the problem, can you please revisit it?
            – user10578038
            Nov 20 at 8:48












            There was no attribute for View "localRotation". Please change View.rotationY or rotationX
            – Lwin Myo Aung
            Nov 20 at 9:14




            There was no attribute for View "localRotation". Please change View.rotationY or rotationX
            – Lwin Myo Aung
            Nov 20 at 9:14












            up vote
            0
            down vote













            I work in this code:



            Vector3 vector1 = new Vector3(getRandom(), getRandom(), playNode.getLocalPosition().z);
            ObjectAnimator dropAnimation = new ObjectAnimator();
            dropAnimation.setObjectValues(vector1);
            dropAnimation.setPropertyName("localPosition");
            dropAnimation.setEvaluator(new Vector3Evaluator());
            dropAnimation.setRepeatCount(ObjectAnimator.INFINITE);
            dropAnimation.setRepeatMode(ObjectAnimator.RESTART);
            dropAnimation.setInterpolator(new LinearInterpolator());
            dropAnimation.setAutoCancel(true);

            return dropAnimation;





            share|improve this answer

























              up vote
              0
              down vote













              I work in this code:



              Vector3 vector1 = new Vector3(getRandom(), getRandom(), playNode.getLocalPosition().z);
              ObjectAnimator dropAnimation = new ObjectAnimator();
              dropAnimation.setObjectValues(vector1);
              dropAnimation.setPropertyName("localPosition");
              dropAnimation.setEvaluator(new Vector3Evaluator());
              dropAnimation.setRepeatCount(ObjectAnimator.INFINITE);
              dropAnimation.setRepeatMode(ObjectAnimator.RESTART);
              dropAnimation.setInterpolator(new LinearInterpolator());
              dropAnimation.setAutoCancel(true);

              return dropAnimation;





              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                I work in this code:



                Vector3 vector1 = new Vector3(getRandom(), getRandom(), playNode.getLocalPosition().z);
                ObjectAnimator dropAnimation = new ObjectAnimator();
                dropAnimation.setObjectValues(vector1);
                dropAnimation.setPropertyName("localPosition");
                dropAnimation.setEvaluator(new Vector3Evaluator());
                dropAnimation.setRepeatCount(ObjectAnimator.INFINITE);
                dropAnimation.setRepeatMode(ObjectAnimator.RESTART);
                dropAnimation.setInterpolator(new LinearInterpolator());
                dropAnimation.setAutoCancel(true);

                return dropAnimation;





                share|improve this answer












                I work in this code:



                Vector3 vector1 = new Vector3(getRandom(), getRandom(), playNode.getLocalPosition().z);
                ObjectAnimator dropAnimation = new ObjectAnimator();
                dropAnimation.setObjectValues(vector1);
                dropAnimation.setPropertyName("localPosition");
                dropAnimation.setEvaluator(new Vector3Evaluator());
                dropAnimation.setRepeatCount(ObjectAnimator.INFINITE);
                dropAnimation.setRepeatMode(ObjectAnimator.RESTART);
                dropAnimation.setInterpolator(new LinearInterpolator());
                dropAnimation.setAutoCancel(true);

                return dropAnimation;






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 21 at 1:46









                user10578038

                212




                212






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • 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.


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





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • 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.


                    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%2fstackoverflow.com%2fquestions%2f53388145%2fhow-to-make-the-node-translation%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

                    404 Error Contact Form 7 ajax form submitting

                    How to know if a Active Directory user can login interactively

                    TypeError: fit_transform() missing 1 required positional argument: 'X'