alanross / AlvaAR

World tracking for WebAR. A Javascript library for Augmented Reality to run SLAM in the browser.
GNU General Public License v3.0
349 stars 73 forks source link

Created a react-three-fibre R3F example #7

Open ThorstenBux opened 1 year ago

ThorstenBux commented 1 year ago

Hi @alanross ,

I've created a R3F example that works (after a fashion). I've got everything on a branch and if you are interested would create a PR. Just let me know if you would like to have the branch pushed to your repo or if I should fork and open a PR from the fork. Cheers

alanross commented 1 year ago

Awesome, thank you Thorsten! Can you hold on to it and keep it warm for now so we can integrate it once the architecture is better defined?

ThorstenBux commented 1 year ago

Sure thing, I'll push to a fork and keep it there. I'd also have a couple of questions as to why the model shows the way it shows :). How are you getting along with the architecture. Need any help?

alanross commented 1 year ago

What would you like to know about how the model is shown? If you have any system architecture suggestions on the C++ side I'd be happy to check it out

ThorstenBux commented 1 year ago

Hi @alanross I pushed it here https://github.com/ThorstenBux/AlvaAR/tree/thor-r3f here is a screenshot regarding model placement.

image

It looks like the model is at an angle and not sitting on the surface. Unsure if that is due to my camera/model settings in R3F or if it is due to the data coming from AlvaAR.

Lastly, I'm also getting a lot of these errors randomly:

RangeError: Range consisting of offset and length are out of bounds
set — alva_ar.js:6372
write — alva_ar.js:6372
findCameraPose — alva_ar.js:6527
(anonymous function) — useAlvaAR.tsx:91
render$1 — index-7dbf758c.esm.js:1454
loop — index-7dbf758c.esm.js:1481
650set — alva_ar.js:6372

Would you know why that is. Cheers

alanross commented 1 year ago

IMU integration will handle orientation. The SLAM algorithm itself has no notion of its orientation in regards to its environment and will just use the first found frame as its reference.

Zaniyar commented 1 year ago

It looks like the model is at an angle and not sitting on the surface. Unsure if that is due to my camera/model settings in R3F or if it is due to the data coming from AlvaAR.

Would you know why that is. Cheers

actually when you test the official example, the 3d object is never "sitting" on the plane, rather always floating.

Squareys commented 11 months ago

actually when you test the official example, the 3d object is never "sitting" on the plane, rather always floating.

I think this is because the video frame is shown before the tracking is ready and can update the 3D mesh, so it just lags behind the video basically. The tracking is quite stable and surprisingly performant.

sookie928 commented 7 months ago

Lastly, I'm also getting a lot of these errors randomly:

RangeError: Range consisting of offset and length are out of bounds
set — alva_ar.js:6372
write — alva_ar.js:6372
findCameraPose — alva_ar.js:6527
(anonymous function) — useAlvaAR.tsx:91
render$1 — index-7dbf758c.esm.js:1454
loop — index-7dbf758c.esm.js:1481
650set — alva_ar.js:6372

Would you know why that is. Cheers

you initialized alva twice :)