Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ARCore – How to set default scale for a Transformable node?

I am using Transformable node and able to set minimum and maximum scale values. But I am using a model whose default size is much bigger so I have to use gestures to make it small.

How is it possible to set default scale value of a model / Transformable node?

like image 653
Daniyal Javaid Avatar asked Jan 02 '23 09:01

Daniyal Javaid


1 Answers

i think you can use TransformableNode's setLocalScale method before it set a actual Renderable. like the code below

TransformableNode andy = new TransformableNode(arFragment.getTransformationSystem());
      andy.setLocalScale(new Vector3(0.1f, 0.1f, 0.1f));
      andy.setParent(anchorNode);
      andy.setRenderable(andyRenderable);
      andy.select();

I used 0.1f for x, y, z value, then it looks better

like image 71
D.Jiang Avatar answered Jan 30 '23 17:01

D.Jiang