Closed kalwalt closed 3 years ago
That getters can be used only if you import the CameraViewRenderer class, because we export only the ARnft class https://github.com/webarkit/ARnft/blob/ef9e182278da7a4d24460ba9222da531bea30e87/src/index.ts#L36-L40 it's not possible to test directly in vanilla js code. This will be useful for devloping other initialize functions as i started for example in the raw-initialize branch
CameraViewRenderer new getters and functions
General infos
This PR add some more getters to the CameraViewRenderer class see #216 :
getVideo() to get the video HTML element getCanvasProcess() to get the canvas used in the process to transfer the video pixels to the WebWorker. getContextProcess() to get the context of the canvas :arrow_up: getFacing() to get the facing string (environment, user...) used for the video settings. Note that this can be retrieved only after initialization of the CameraViewRenderer instance.
and lastly prepareImage() to 'prepare' the canvas to fill with the video pixels.
Examples and tests
I will see if add some examples, but this getters will be only availables for the ARnft class. For now you can test inside the ARnft _initialize put this code just after
this.cameraView = new CameraViewRenderer(document.getElementById("video") as HTMLVideoElement);
:and just after
put this:
you will see in the console:
Other
Minor fix for the
arNFT_example.html
https://github.com/webarkit/ARnft/pull/218/commits/702bbdfd7cbf7ee3020db12ec11bf5d886db0268 (root object3D) is not required anymore)