I want to create 3D shape on my canvas, but I am using ml5.js
and posenet
example. There are two ways I could think of:
Approach 1: Using WEBGL renderer. But, it does not work. WEBGL renderer is required to make 3d shapes run, right? The following is NOT working when I use it with ml5.js example:
createCanvas(640,480, WEBGL)
Approach 2: Use a different library. I decided to use babylon.js
But it requires that I create a canvas element first and then do the diplay.
<canvas id="renderCanvas" touch-action="none"></canvas>
var canvas = document.getElementById("renderCanvas"); // Get the canvas element
var engine = new BABYLON.Engine(defaultCanvas0, true); // Generate the BABYLON 3D engine
// Add the create scene function
Problem: The canvas created by p5 is different from that of the babylon.js. I want the display to be one and not two separate windows. How to do that? Thank you!