if I call it like this:
var worldMy = createVector( 0,0,0 );
let screenCoor = projectWorldToCanvas( canvas, worldMy ) ;
I receive
TypeError: canvas.uMVMatrix is undefined (sketch: line 99)
p5.RendererGL: enabled webgl context
in
/* Project a vector from World to Canvas coordinates. */
function projectWorldToCanvas(canvas, vWorld) {
// Calculate the ModelViewProjection Matrix.
var mvp = (canvas.uMVMatrix.copy()).mult(canvas.uPMatrix); // !!!!!!!!!!!!!!!!!! HERE
// Transform the vector to Normalized Device Coordinate.
?
I gather that of the 3 funcs in Add screenX, screenY and screenZ · Issue #1553 · processing/p5.js · GitHub
I only need projectWorldToCanvas ?
and not the other?
That’s overly complicated…
Is canvas = 2D and world = 3D?
Thanks for your help!
Chrisir