cx20 / gltf-test

Testing the glTF Loader and WebGL Library

Home Page:https://cx20.github.io/gltf-test/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why my image is upside down on some computer?

PrincessGod opened this issue · comments

On my 15' macbook demo works fine, but on 13' macbook and windows computer are upside down...

Like this
image

Also in jsdo.js
Right
image

Wrong
image

Do you have any ideals why? Thanks!

commented

@PrincessGod I saw the event at Chrome. If Zoom is set to 110%, it will be displayed upside down.
I do not know the cause. .

@cx20 Really strange, not wrong on every computer...

Seems canvas draw thing upside down and left right switched.

Not just a zoom change. Any window resize will trigger this bug. A window zoom or resize will trigger this line here:

if(resized) camera.updateProjMatrix( context.canvas.width / context.canvas.height );

In PerspectiveCamera.prototype.updateProjMatrix, this line is executed:

        Matrix4.perspective( this.projMat, this.fov, this.aspect, this.near, this.far );

But, this.fov is in degrees, not radians. The Matrix4.perspective function tries to use the value as radians, and gets confused. The projection matrix is then flipped over.