hiukim / mind-ar-js

Web Augmented Reality. Image Tracking, Face Tracking. Tensorflow.js
MIT License
2.13k stars 394 forks source link

Translating MindAR Studio Values to GLTF Properties #458

Open HieronymusLex opened 9 months ago

HieronymusLex commented 9 months ago

I used MindAR studio to import a 3D model and adjusted the scale, position and rotation values to get a nice result. Is there a way we can take the position and scale (and anchor point?) values that were set in the studio, and translate them for use when setting the scale and position values on a loaded GLTF model:

const glasses = await loadGLTF('./glasses/scene.gltf');          
glasses.scene.rotation.set(0, degrees_to_radians(90), 0) ;
glasses.scene.position.set(0, -169, -3);
glasses.scene.scale.set(100, 102, 112);
const anchor = mindarThree.addAnchor(0); 
anchor.group.add(glasses.scene); 

Here I'm using the values that were shown in the MindAR Studio but the result is way off

LiZhenzhuBlog commented 5 months ago

did you get the answer?

LiZhenzhuBlog commented 5 months ago

https://github.com/hiukim/mind-ar-js/issues/440 I donot know are there any difference between the mindarfs and studio the transform matrix . I get a correct 6dof in studio but not in mindarjs( mindar-face-target="anchorIndex: 1">)