AR Camera not working properly
Hi.
I am new in the world of AR (and I don't have a coding background) and I'm doing a graphic design project for school which is simple (just 2D targets triggering animated 3d objects). I have tried it with another SDK and was sucessful but I want to experiment with MAXST and I'm having some difficulties setting it up.
When I launch my app, it asks permission to use camera but instead of seeing the camera feed, I'm seeing a sky like in Unity editor. However, if I point at the target image, I am seeing the camera feed behind my 3D model and the 3D model position won't change, just the camera.
What am I doing wrong?
This is what I see in my phone when I launch my app:
And after I point my phone at the target, I get the static 3D model in top left corner (position never changes), and if I move my phone, the camera feed which is on the back changes position.
Here are some screenshots from my unity project:
How can I solve this?
Thanks and sorry for what might be a really stupid question. I tried comparing my scene with the provided samples in Prefabs folder but I couldn't figure out what is wrong or missing.
I tried setting world center to TARGET and CAMERA and none of them worked.
Kind regards
S.
Hello,
Thank you for using our SDK.
First of all, please check your Unity graphic settings is Force Open GL.
Here is how to do.
https://developer.maxst.com/MD/doc/unity/setup#installing-maxst-ar-sdk-for-unity
Is it same situation appears when you push the play button in Unity?
We think there is another camera, so may be main camera is set with that camera not with our AR camera. Like this situation, it appears like that.
If you have any questions, please do not hesitate to contact us.
- MAXST Support Team
Hi. Thanks for the very quick reply!
I forced Open GL and I have the same problem. If I press play in Unity it shows the same sky as in the phone (maybe because I don't have a webcam?) I am building the app everytime and installing on my device (Android) to test it.
I used your sample app (MAXST AR SDK from Play Store) with your sample targets and it was working fine.
How/where can I see if I have another camera? I deleted the 'Main camera' after creating the unity project. Any ideas?
Here's attached what I get in the console when I play in unity + Player Settings on the right, if it helps.
I am also getting a warning after building the app:
Can this be related to my problem?
Thanks
S.
We're sorry to let you have inconvenience.
To open and start camera device you should add some script to your hierachy view.
Please refer to ImageTracker sample scene in MaxstARSample folder.
You can see there is SceneManager gameobject with ImageTrackerSample.cs attached.
And ImageTrackerSample.cs has some code about controlling camera device like CameraDevice.GetInstance().Start() / Stop().
It's a little annoying work to implement some code for starting camera device, but the purpose of our intention is to give some freedom to developers.
(Please ignore build warning mesage it's not having no relation with your problem)
Thanks
- Maxst support team
Hello again,
I managed to fix it. I had already ImageTrackerSample.cs attached to an empty GameObject before so that wasn't the issue.
For anyone who needs the fix: the problem was with the import settings for my C4D file. I had the "Import Cameras" option enabled, and even though I didn't have any camera in my C4D scene, it was importing my viewport angle as a camera. I only noticed because I opened C4D and I was viewing the bottom right corner of the 3d object, in the same angle as it was appearing in the app. I had Import Cameras enabled with other SDK and it didn't have problems, so I never considered that.
Anyway, once I disabled that checkbox in Unity it started working as intended.
Congratulations on your amazing SDK! My favorite from the ones I have tried. I will be purchasing my license sometime soon. :-)
Thanks,
S.
It's very nice to hear that you've found the solution by yourself!
The problem you have gone through is not in bound of our team's prediction and your solution is very helpful to make our sdk better :-)
We are considering to apply your hint to our sdk.
Thanks
- Maxst support team
I am very glad to be of any help! Cheers and thanks again.
S.