You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For vec3.transformMat4 (assumes w=1), the W-division is done, presumably because the w-component isn't returned, so it's done because the user couldn't do it:
For vec2.transformMat4 (assumes z=0 and w=1), however, the w-division is not done. Unfortunately, the user can't do it either, because the w-component isn't returned (so the user must compute w themselves, which defeats the purpose):
I'd like to see this fixed or a new function added for this purpose, but it's obviously a breaking change if this function was modified. It could also help to have a function to compute w (maybe a homogenous-dot-product already exists for this?), then the w division can be avoided.
A potential use-case for this can be found in maplibre (which would already benefit from the vec3 variant, but could be optimized further).
The text was updated successfully, but these errors were encountered:
As pointed out here #279 (comment),
vec4.transformMat4
doesn't do w-division, and the user is responsible for doing it:gl-matrix/src/vec4.js
Lines 478 to 488 in 21b745f
For
vec3.transformMat4
(assumesw=1
), the W-division is done, presumably because thew
-component isn't returned, so it's done because the user couldn't do it:gl-matrix/src/vec3.js
Lines 505 to 515 in 21b745f
For
vec2.transformMat4
(assumesz=0
andw=1
), however, the w-division is not done. Unfortunately, the user can't do it either, because thew
-component isn't returned (so the user must computew
themselves, which defeats the purpose):gl-matrix/src/vec2.js
Lines 442 to 448 in 21b745f
I'd like to see this fixed or a new function added for this purpose, but it's obviously a breaking change if this function was modified. It could also help to have a function to compute
w
(maybe a homogenous-dot-product already exists for this?), then the w division can be avoided.A potential use-case for this can be found in maplibre (which would already benefit from the
vec3
variant, but could be optimized further).The text was updated successfully, but these errors were encountered: