mind-ar-js icon indicating copy to clipboard operation
mind-ar-js copied to clipboard

How to import custom 3d model

Open errwnd opened this issue 1 year ago • 3 comments

I'm wokring on a new project, and I want to import a new model to the project. Is that possible? I tried it by changing the src in a face tracking example. It didn't work. Is there such a feature?

errwnd avatar Apr 24 '24 09:04 errwnd

what didn't work? can you post your code?

seantai avatar Apr 24 '24 13:04 seantai

      <a-asset-item id="earringModel" src="scene.gltf"></a-asset-item>

scene.gltf is a local 3d image, but that is not getting loaded to the scene

errwnd avatar Apr 25 '24 04:04 errwnd

that is simply loading the asset. additionally you need to "render" it to an anchor with something like this

 <a-entity mindar-face-target="anchorIndex: 127">
   <a-gltf-model rotation="-0.1 -0 0" position="0 -0.3 -0.3" scale="0.05 0.05 0.05" src="#earringModel" class="earring-entity" visible="false"></a-gltf-model>
</a-entity>

https://hiukim.github.io/mind-ar-js-doc/face-tracking-examples/tryon

seantai avatar Apr 25 '24 09:04 seantai