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

createARCanvas() does not work with preload #73

Open
stalgiag opened this issue Sep 11, 2019 · 4 comments
Open

createARCanvas() does not work with preload #73

stalgiag opened this issue Sep 11, 2019 · 4 comments
Labels
AR bug Something isn't working

Comments

@stalgiag
Copy link
Owner

Getting

Uncaught TypeError: Cannot read property 'set' of undefined
    at p5xrViewer.set (p5xr.js:8123)

works fine in setup() but canvas is visible before launching and sketch is running in background before AR is entered.

@stalgiag stalgiag added bug Something isn't working AR labels Sep 11, 2019
@msub2
Copy link
Contributor

msub2 commented Feb 28, 2021

Did a bit of digging on this. As far as I can tell, p5.instance._renderer is correct (RendererGL) all the way until it requests the reference space in p5ar.js. Inside the .then(), the renderer comes back as a Renderer2D. All I can think of is that there's some weird race condition happening here that doesn't happen with setup(). but I have no idea what it could be right now. Very spooky.

@stalgiag
Copy link
Owner Author

Thanks for digging. The way that we are handling preload methods might need to change for the createARCanvas. Luckily I would say this isn't the highest priority yet since it might require significant investigation time.

@tomermesser
Copy link

please implement the possibility of loading 3d models in AR canvas.

@stalgiag
Copy link
Owner Author

stalgiag commented Aug 3, 2021

I was under the impression that model loading worked with loadModel() in preload with AR but I don't have a WebXR compatible phone atm. I can look into it when I get access to a phone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AR bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants