WebGL 是否应该在 canvas 上展开
Is WebGL supposed to be stretched out on canvas
我正在学习 webgl。我正在休假 tutorial on youtube. My issue is the traingle I'm rendering to the canvas is streched out.
在更广泛的 canvas.
更正方形 canvas。 (这些是相同的三角形。)这应该发生吗,我该如何解决。
是的,WebGL 坐标始终在 canvas(或整个视口)范围内从 -1 到 +1。任何其他坐标系都是您提供的 math/data/shaders 。换句话说,如果你不根据 canvas 的大小更新你的数学,事情就会延伸。
我正在学习 webgl。我正在休假 tutorial on youtube. My issue is the traingle I'm rendering to the canvas is streched out.
在更广泛的 canvas.
更正方形 canvas。 (这些是相同的三角形。)这应该发生吗,我该如何解决。
是的,WebGL 坐标始终在 canvas(或整个视口)范围内从 -1 到 +1。任何其他坐标系都是您提供的 math/data/shaders 。换句话说,如果你不根据 canvas 的大小更新你的数学,事情就会延伸。