cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

3D Models Not Positioning Correctly Using JSON Data in Vuforia

MM_10532044
7-Bedrock

3D Models Not Positioning Correctly Using JSON Data in Vuforia

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

 

ACCEPTED SOLUTION

Accepted Solutions

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,

View solution in original post

6 REPLIES 6

 

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.

 

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

OK, after renaming of the model Widget the first error disappear . So in UI when set all postion properties to zero  it looks like this:

2023-06-26_12-02-51.jpg

 

So after applying of the properties and checking the values in Preview mode:

 

2023-06-26_12-03-34.jpg

after first check it seems that values are set correctly. So far I see the position is also OK (only first check I do not know the geometry. 

Could you provide another check,  possibly in Creo View or other tool which will demonstrate that setting of this values should lead to different constellation in space  of the different model widgets  

Or could you explain which part has the wrong position and what should be the correct position. Thanks

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,

Yes the point , comma decimal separator - is something we know it  but always could be overlocked  unfortunately 😀  -, especially when also non englisch enviroment is used , thanks for the feedback

Announcements

Top Tags