Change scale of an object as you get closer #267
outandaboutar
started this conversation in
General
Replies: 1 comment 2 replies
-
Are you using geolocations or marker/NFTs? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
I am trying to understand how you would resize the scale as you get closer. Im still experimenting with one of the tutorials and I have 3 objects:
var models = [
{
url: './assets/magnemite/scene.gltf',
scale: '0.5 0.5 0.5',
info: 'Magnemite, Lv. 5, HP 10/10',
rotation: '0 180 0',
position: '50 0 -200',
},
{
url: './assets/articuno/scene.gltf',
scale: '0.2 0.2 0.2',
rotation: '0 180 0',
position: '50 0 -200',
info: 'Articuno, Lv. 80, HP 100/100',
},
{
url: './assets/dragonite/scene.gltf',
scale: '0.08 0.08 0.08',
rotation: '0 180 0',
position: '50 0 -200',
info: 'Dragonite, Lv. 99, HP 150/150',
},
];
I am familiar with coding to some degree but i've never looked at AR before so I would just really appreciate some more help (thanks very much for previous help guys). I imagine I would need to turn the scale attribute into a variable, and then create an if statement some where to check on users position and as the user moves closer to one of the objects, I can use the distance from the user to the object to effect the scale of the object. But having multiple objects is messing with my mind and I just dont know how to access the users position? Can this be accessed as a variable or something?
cheers!
Dan
Beta Was this translation helpful? Give feedback.
All reactions