How to make the node translation?












0















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





























    0















    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



























      0












      0








      0








      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 '18 at 8:44







      user10578038

















      asked Nov 20 '18 at 7:28









      user10578038user10578038

      314




      314
























          2 Answers
          2






          active

          oldest

          votes


















          0














          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 '18 at 8:48











          • There was no attribute for View "localRotation". Please change View.rotationY or rotationX

            – Lwin Myo Aung
            Nov 20 '18 at 9:14



















          0














          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',
            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
            },
            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









            0














            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 '18 at 8:48











            • There was no attribute for View "localRotation". Please change View.rotationY or rotationX

              – Lwin Myo Aung
              Nov 20 '18 at 9:14
















            0














            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 '18 at 8:48











            • There was no attribute for View "localRotation". Please change View.rotationY or rotationX

              – Lwin Myo Aung
              Nov 20 '18 at 9:14














            0












            0








            0







            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 '18 at 7:54









            Lwin Myo AungLwin Myo Aung

            341117




            341117













            • I modify the problem, can you please revisit it?

              – user10578038
              Nov 20 '18 at 8:48











            • There was no attribute for View "localRotation". Please change View.rotationY or rotationX

              – Lwin Myo Aung
              Nov 20 '18 at 9:14



















            • I modify the problem, can you please revisit it?

              – user10578038
              Nov 20 '18 at 8:48











            • There was no attribute for View "localRotation". Please change View.rotationY or rotationX

              – Lwin Myo Aung
              Nov 20 '18 at 9:14

















            I modify the problem, can you please revisit it?

            – user10578038
            Nov 20 '18 at 8:48





            I modify the problem, can you please revisit it?

            – user10578038
            Nov 20 '18 at 8:48













            There was no attribute for View "localRotation". Please change View.rotationY or rotationX

            – Lwin Myo Aung
            Nov 20 '18 at 9:14





            There was no attribute for View "localRotation". Please change View.rotationY or rotationX

            – Lwin Myo Aung
            Nov 20 '18 at 9:14













            0














            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




























              0














              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


























                0












                0








                0







                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 '18 at 1:46









                user10578038user10578038

                314




                314






























                    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.




                    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

                    How to change which sound is reproduced for terminal bell?

                    Can I use Tabulator js library in my java Spring + Thymeleaf project?

                    Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents