Skip to main content
7-Bedrock
June 25, 2023
Solved

3D Models Not Positioning Correctly Using JSON Data in Vuforia

  • June 25, 2023
  • 1 reply
  • 2087 views

Hello Vuforia Community,

 

I'm reaching out to you because I'm currently facing a challenging issue in my Vuforia project and would appreciate any insights or suggestions.


I am working on an Augmented Reality application using Vuforia. My project involves rendering 3D models in real-time and positioning them according to specific coordinates and rotations. The position and rotation values are fetched from a JSON file.


Despite ensuring the integrity of the position and rotation values in the JSON file, the 3D models are not positioning correctly within the scene. They either appear in incorrect positions or orientations that don't align with the values specified in the JSON file.

 

What I have tried already:
- Ensured that data is fetched properly and available before positioning the models.
- Checked the coordinate system for any mismatches.
- Verified the scale factors and units for position and rotation.
- Checked for nested transformations and the order of rotations.


However, despite these checks, the issue persists.


I have attached my Vuforia project file for reference. I would greatly appreciate it if anyone can take a look and provide insights or suggestions to resolve this issue. I am particularly interested in any Vuforia-specific configurations or practices that I might be overlooking.

Thank you in advance for your time and assistance!

 

Best regards,

Max

 

Best answer by MM_10532044

Hey Roland,

Big thanks for taking the time to help me out! πŸ™Œ

Guess what? I cracked it! πŸŽ‰ Turns out, it was a sneaky decimal separator causing the hiccup - I had semicolons instead of decimal points. No error messages or anything, just stubborn positions and orientations refusing to budge.

Huge shoutout to you for lending a hand. You’re a star! 🌟 Anyone running into the same kind of trouble, keep an eye on those decimals!

Cheers,

1 reply

21-Topaz I
June 26, 2023

Hi @MM_10532044 ,

I did fast check in the provided project and I so far I could see is  that there are some errors in the consistence between names in the json file and the project Widget names which cause that the code will be interrupted and no any changes will be done

2023-06-26_11-16-08.jpg

This cause also the issue when you try to set the property using name of widget which does not exist in the current Vuforia Studio Project

2023-06-26_11-19-57.jpg

Here in this case the Widget name "-KH1" does not exist and therefore the JavaScript part  in $scope.positioning trying :

 $scope.view.wdg[model].src=modelPath;

will fails for a model = "-KH1" because not widget with this name is in the project.

 

21-Topaz I
June 26, 2023

I see that possibly there are different versions of this project saved in the rar file. So that I need to check which is the correct json file. I will check and will see if the issue is different. Because there seem to be the correct name. Therefore possibly it will better  to upload the project -when this first is exported from UI and not copied from the Experience Service. - I believe this is a copy form experience service location. I think I have now the correct json version . Sorry for this mixup. Thanks