Hi, all! Forked today the
Zappar Universal AR project in order to view a large building in AR. For proper visualization it requires updating the variables nearClip and farClip, but I can’t get them to work in-game like in Editor.
Zappar’s Official Documentation tells to set zNear and zFar directly on the script zapparCamera.js, like this, but had no sucess:
const projectionMatrixArray = Array.from(Zappar.projectionMatrixFromCameraModel(model, width, height, zNear=0.1, zFar=10000));
Any suggestions here, please?
It seems Playcanvas depolyed Zappar version 0.3.8 from February , while zFar e zNear is available from version 0.3.10.
Any way to get this working for delivering with
urgency this project to Pinacoteca de SP? It’s one the largest museums in Latin America. Hundreds of thousands of people are likely to try this AR experience
August 20, 2021, 10:30am
You will have to ask on the Zappar support as we didn’t create the PlayCanvas integration unfortunately.
August 20, 2021, 10:56am
Having a quick look at this from their example and docs and can’t see anything where they’ve exposed the zNear and zFar planes
Edit: Looks like they haven’t exposed the zNear and zFar params in Zapper.projectionMatrixFromCameraModel. It’s available in the internal function projection_matrix_from_camera_model
You can see i=.01 and o=100 params that are left as default.
Will see if I can hack around it but you will need to reach out to Zappar to fix this.
August 20, 2021, 11:20am
Sorry, I can’t see an easy way of getting around this.
You will need to reach out to Zapper to fix the SDK as there are a number of dependencies that assume that it is loaded from their CDNs
August 20, 2021, 11:44am
Looks like they’ve fixed this issue in a later version of the SDK (0.3.11)
In your project, make sure you are on the latest version
And the usage is like this:
const projectionMatrixArray = Array.from(Zappar.projectionMatrixFromCameraModel(model, width, height, 0.01, 5));
Where 0.01 and 5 are the near and far plane distances.
PlayCanvas 3D HTML5 Game Engine
@yaustar !!! Thank you so much, got it working with only this simple change!
I suggest informing the Zappar team to update the template with the new version!!!
@GEORGEMARTIN and @DEIM
Marked as SOLVED.