allyolz.blogg.se

Degrees to radians java lwjgl
Degrees to radians java lwjgl




degrees to radians java lwjgl

So, if our window has a size of 900x480, OpenGL coordinates (1,0) will be mapped to coordinates (900, 0) creating a rectangle instead of a quad.īut, the problem is more serious than that. Those coordinates are mapped, considering our window size, to window coordinates (which have the origin at the top-left corner of the previous figure). The following figure shows the OpenGL coordinates (just for x and y axis). That is, when we say that a vertex has a value for coordinate x of 0.5 we are saying to OpenGL to draw it at x position 0.5 on our screen. If you revisit our vertex shader code we are just passing our coordinates directly. You can even change the width of the window from 600 pixels to 900 and the distortion will be more evident.

degrees to radians java lwjgl

If you look carefully at it, it more resembles a rectangle. Let’s get back to our nice coloured quad we created in the previous chapter.






Degrees to radians java lwjgl