akbartus / WebAR-Coloring

The project demonstrates various ways of implementing web AR coloring. The project is open-source and compatible with MindAR.js, AR.js and SimpleAR. Feel free to star and share
https://webarcoloring-component.glitch.me/
MIT License
12 stars 7 forks source link

How to prepare the 3d model and target coloring area for printing? #1

Closed kfarr closed 11 months ago

kfarr commented 1 year ago

I've been trying out the demos from this project and have a few questions about preparing a 3D model for the AR coloring functionality. Specifically, I'm trying to understand how to set up a 3D model with texture mapping and how to prepare its target coloring area for printing on paper.

Background: I am currently using a bus model for my use case. My initial understanding was that I might need to create a version of the bus model with two textures mapped on each side. But based on my conversation with @Akbartus, it seems I only need to map the texture on one side of the bus, as the other side is just a mirror.

Questions:

@Akbartus's Recommendations from Slack conversation:

bus1.png image

bus-outline.png image

kfarr commented 1 year ago

Here is another concept using a QR code, would this work? Swink QR (1)

@akbartus feedback:

kfarr commented 1 year ago

Also if you're interested to check out the model we are looking to "WebAR color" there are 2 options:

akbartus commented 1 year ago

@kfarr thank you for your kind summary and questions. I prepared an example texture mapping for this particular glb model. It can be found under folder "texture-mapping-example" in this repo. The folder contains the following:

Now concerning your questions: you can take now image target, remove the inner and leave only the outline. But make sure to add features because simple outline is not trackable in all web AR systems. Maybe add some qr code or other images. Make sure what you add is not inside of the bus outline, because that area is for coloring. You can also make the way you did with qr marker. But make sure that QR marker does not intersect the bus outline.

Basically, as I mentioned in the repo, everything is dependent on how you make texture mapping.

kfarr commented 1 year ago

Excellent! I was able to get this working on mobile here is a quick video: https://github.com/akbartus/WebAR-Coloring/assets/470477/432a8a84-8230-492a-99dc-a6bba51b92a6

I migrated the sample project directory to a glitch repo: https://glitch.com/edit/#!/sedate-marbled-glitter?path=index.html%3A7%3A0

I had to name the .mind file as -mind.glb to allow uploading to glitch's asset system

akbartus commented 1 year ago

Glad that it worked. Feel free to make 3d model bigger or smaller. Also you can add whatever you want to image target

akbartus commented 1 year ago

Just in case, if you want to upload files with other formats you can follow instructions here for Glitch: https://support.glitch.com/t/uploading-a-whole-folder/3128/3. I usually use this method of uploading.

akbartus commented 11 months ago

@kfarr if everything is ok, I am closing the issue.

kfarr commented 11 months ago

Yes this is great, thank you for your help!