如何使用按钮更改模型的长度?

问题描述 投票:0回答:1

我想添加一个按钮,通过按下它来增加模型的长度。我目前正在做的是获得当地的模型规模。将它增加0.5f并设置局部比例。但什么也没发生。

scale arcore sceneform
1个回答
0
投票

您必须将比例设置为模型所附加到的节点:

      Node node = new Node();
      node.setParent(anchorNode);
      node.setRenderable(yourRenderable);

      button.setOnClickListener(v -> {
          //make the object twice as large
          node.setLocalScale(new Vector3(2f, 2f, 2f));
      });
© www.soinside.com 2019 - 2024. All rights reserved.