I am trying to add some dynamic data to my scene. I've read that I need to do this using Register Component, so I tried it but I'm not having any luck.
I want to create some variables I can use in my scene.
<script>
AFRAME.registerComponent("set-data", {
init: function(){
var theURL = "/link-to-my-NFT";
var theScale = 220;
var thePos = 100;
}
});
</script>
Then I tried to use these variables:
...
<a-nft
type="nft"
url="theURL" <-------
smooth="true"
emitevents="true"
smoothCount="10"
smoothTolerance=".01"
smoothThreshold="5"
>
<a-entity
gltf-model="/link-to-model.glb"
scale="theScale theScale theScale" <-------
position="thePOS thePOS 0" <--------
>
My goal is to be able to change these details based on which NFT image I want to load. Is this possible and I'm close, or should I go about it another way? Thanks for any help.
EDIT: I didn't realize that you could have multiple markers on one page! That is much easier than trying to read which marker I need from the URL.