stalgiag / p5.xr

a library that helps turn p5.js sketches into immersive experiences using WebXR
GNU Lesser General Public License v2.1
117 stars 25 forks source link

Fix camera implementation for p5.js 1.10.0 #218

Closed TiborUdvari closed 2 months ago

TiborUdvari commented 2 months ago

Starting from version 1.10.0 p5.js (finally) separates model and view matrices. This breaks how p5XrViewer handles the camera and needs to be updated.

Details in this merged PR: https://github.com/processing/p5.js/pull/6761

TiborUdvari commented 2 months ago

Using the new separated matrices work, but there was a new issue introduced in the line renderer, affecting small coordinates ex. real world coordinates expressed in meters. Details here:

https://github.com/processing/p5.js/issues/7200

Might need to temporarily use older vertex shader that was working well before.

TiborUdvari commented 2 months ago

This was also an issue affecting all sketches, the new behaviour that was introduced activated the linePerspective by default in p5.xr which was not the case, this broke older sketches, as the lines could be really thick and made them look like a bug. https://github.com/processing/p5.js/issues/7209