persec
persec

Reputation: 29

I want to transform the coordinates of a parallel projection in WebGL

Parallel projection in WebGL,

const orthoMatrix = mat4.create();
mat4.ortho(orthoMatrix, -1, 1, -1, 1, near, far);
    
    

Some of the parts that are done as


mat4.ortho(orthoMatrix, -0.5, 1, -0.5 1, near, far);


and display it on the screen. We want to convert the coordinates of the mouse on the screen to mat4.ortho(orthoMatrix, -0.5, 1, -0.5 1, near, far); from the coordinates obtained on mat4.ortho(orthoMatrix, -1, 1, -1, 1, near, far); before cropping. I would like to convert them to Is it possible to do so?


I would like to convert the screen size to





width = 600, height = 600


and then cut out by mat4.ortho(orthoMatrix, -0.5, 1, -0.5 1, near, far), with width = 600 and height = 600, scaled up.

It would be great if you could let me know.

Upvotes: 0

Views: 18

Answers (0)

Related Questions