Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NFT positions 3D model differently for different images? #620

Open
ODINN555 opened this issue Dec 3, 2024 · 4 comments
Open

NFT positions 3D model differently for different images? #620

ODINN555 opened this issue Dec 3, 2024 · 4 comments
Assignees
Labels
nft question Further information is requested

Comments

@ODINN555
Copy link

ODINN555 commented Dec 3, 2024

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
My test repo: https://github.com/ODINN555/ArExample/tree/master

I have 1 NFT image called "goodjob" under ArExample/goodjob/ which when I use it the AR works and the 3d model appears fine,
but then when I use another NFT image named "city_with_code7", the model does not appear.
The city nft does get tracked and I even debug it with "markerFound" and "markerLost" events.

My suspicion is that because the image is different, the 3D model is placed in a different location in the scene. But if it is the case, how can I measure how much to move the 3D model to appear correctly?

If the current behavior is a bug, please provide the steps to reproduce.
Clone my repro: https://github.com/ODINN555/ArExample/tree/master
first use the goodjob image (update the nft url to https://[YOUR GITHUB URL]/ArExample/goodjob/goodjob)
then use the city_with_code7 (update the nft url to https://[YOUR GITHUB URL]/ArExample/nft/city_with_code7)

https://github.com/ODINN555/ArExample/tree/master

Please mention other relevant information such as the browser version, Operating System and Device Name
Tried in both desktop and mobile, the problem persists in both
What is the expected behavior?
both images should be displaying the 3d model
If this is a feature request, what is motivation or use case for changing the behavior?

@ODINN555 ODINN555 changed the title Some NFT images work and some doesnt? NFT positions 3D model differently for different images? Dec 3, 2024
@ODINN555
Copy link
Author

ODINN555 commented Dec 3, 2024

[Update]
After trying to adjust the size and position of the 3d model, i got it to be visible, kind of as seen in this image:
image

but the model is very glitchy, it is not only black, it is you can also see white in some areas and sometimes you see through the model.
Does anyone know why this is happening? the model shows fine with different settings on a different nft image. why on this one isnt?

You can see the changes ive made in the "newImageTesting" branch in the repo above (https://github.com/ODINN555/ArExample/tree/newImageTesting)

@kalwalt
Copy link
Member

kalwalt commented Dec 3, 2024

Hi @ODINN555 it could depend by the dpi and size of the NFT, if it is too low you must be very close to the image to scan and goes outside of the FOV.

@kalwalt kalwalt added question Further information is requested nft labels Dec 3, 2024
@kalwalt kalwalt self-assigned this Dec 3, 2024
@ODINN555
Copy link
Author

ODINN555 commented Dec 4, 2024

Thank you for your response,
It is true that the resoultion of each image is different, but it shouldnt effect this drastically...
for the first image the scale of the model is 100 and for the second it is 800.
and it does not explain why the model is glitching out like in the image I sent above

@ODINN555
Copy link
Author

ODINN555 commented Dec 4, 2024

Managed to fix the "glitching" by adding this script:
<script> // Workaround for an AR.js bug (https://github.com/jeromeetienne/AR.js/issues/410) const sceneEl = document.querySelector('a-scene'); sceneEl.addEventListener('loaded', () => { sceneEl.camera = new THREE.PerspectiveCamera(); }); </script>

I do still think that the issue I mentioned above is a bug.
The camera is at the same relative position to the images (I scan them from about the same distance), there shouldnt be such a drastic difference in positioning because of the resoultion or dpi of the image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nft question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants