So if you want the coordinates in canvas coordinates, you will have to compute the points in world coordinates first.
The coordinates that you computed before applying the user matrix are in view coordinates.
So you will have to apply the user matrix.
I advise using the exisiting vec3.transformMat4()
. If it doesn’t give you the right points, you may have to transpose the matrix first by using mat4.transpose()
function.
Then you can get the canvas coordinates from world coordinates using computeWorldToDisplay()
function.