2,564 reputation
724
bio website
location Poland
age 25
visits member for 2 years, 8 months
seen Sep 1 at 21:33

Dec
5
comment Black Screen: How to set Projection/View Matrix
why are you transposing the view and projection matrices in the first example? surely that's not right. also in the second example you don't seem to be actually storing the projection matrix.
Nov
24
comment How can I generate a view or projection matrix for OpenGL 3.+
@SeanMiddleditch it's going to work, just that when using OpenGL your depth buffer is going to get filled in the (0.5, 1) range instead of the (0, 1) range, because your perspective projection matrix mapped your z coordinate to the (0, 1) range like in DirectX, but OpenGL maps that as if z was in the (-1, 1) range. glDepthRange doesn't fix that, it works just like glViewport, it sets to what range the NDC coordinates get mapped, the NDC z range is still going to be (-1, 1) for OpenGL and (0, 1) for DirectX. Really, just read carefuly what the description of glDepthRange says, it's all there.
Nov
24
comment How can I generate a view or projection matrix for OpenGL 3.+
@SeanMiddleditch do you understand how glDepthRange works though? you started this by saying that the clip space is configurable and you point to the function, which is wrong. and now you're correctly saying that the DX matrix uses half the availible z-range from OpenGL. it's true, but you effectively cut your depth precision by half, which is completely unnecessary. stating such things is unconstructive, that's why i wrote what i did. also NDC is NOT the homogenous clip space, and what is the non-homogenous clip space exactly? i'm sorry but your understanding of this issue is lacking.
Nov
23
comment How can I generate a view or projection matrix for OpenGL 3.+
@SeanMiddleditch glDepthRange() has nothing to do with clip space, what it does is set to what coordinates the (-1,1) NDC range is going to be mapped when the image is written to the buffer. Saying that glDepthRange() affects the clip space z range is like saying that glViewport() affects the x and y range, which it doesn't, obviously.
Nov
23
answered Do I need a Point and a Vector object? Or just using a Vector object to represent a Point is ok?
Nov
23
comment How can I generate a view or projection matrix for OpenGL 3.+
@SeanMiddleditch i've never heard of that, can you cite a source
Nov
23
revised How can I generate a view or projection matrix for OpenGL 3.+
added 124 characters in body
Nov
23
comment How can I generate a view or projection matrix for OpenGL 3.+
@mh01 you're right, i'll do that
Nov
23
revised How can I generate a view or projection matrix for OpenGL 3.+
added 12 characters in body
Nov
23
comment How can I generate a view or projection matrix for OpenGL 3.+
@mh01 did you even read the answer? i'm talking about the perspective projection matrix, it's going to be different for OpenGL and DirectX, the clip space z axis for DirectX goes from 0 to 1, not form -1 to 1 like it does with OpenGL, IT'S GOING TO BE DIFFERENT
Nov
23
comment How can I generate a view or projection matrix for OpenGL 3.+
@Ken there is none, GLUT used to be that, but as you know it's for the deprecated OpenGL. There are libraries that provide functionality you may want, like FreeGLUT or GLM, but they're not a widely accepted standard or anything like that.
Nov
23
comment How can I generate a view or projection matrix for OpenGL 3.+
@Ken your issue is weird one to have, because it's one of code re-usability. just pack your solution into a library and use it when you need it. if you don't want to write your own library then use some one else's like GLM.
Nov
23
comment How can I generate a view or projection matrix for OpenGL 3.+
@Ken well it's not really coding your own solution as much as it's writing a basic set of functions. it depends on a lot of things. if you don't want to deal with math then you can use GLM, lots of people do, it'll calculate transformations and do all the math for you. however if you're using a SIMD math library, like the one bullet has then it won't provide you with functions that create a rotation matrix or a perspective projection matrix and thus you'll have to do it yourself
Nov
23
comment How can I generate a view or projection matrix for OpenGL 3.+
@Ken well GLM is going to calculate the matrix each time aswell. just pack your logic into a function. your projection matrix should be calculated once, unless you change the aspect ratio of the screen, the camera matrix has to be calculated each frame. you should probably just pack both of those into a camera object that'll do things like rotate and move the camera and return the matrices when necessary.
Nov
23
revised How can I generate a view or projection matrix for OpenGL 3.+
added 605 characters in body
Nov
23
answered How can I generate a view or projection matrix for OpenGL 3.+
Nov
13
comment Optimal way to learn DirectX?
i've no idea what books you were looking at, one of the first things that pops in google is "Introduction to 3D Game Programming with DirectX 11" and that's just about the best dx11 teaching resource you could ask for
Nov
9
comment Techniques to prevent non-official clients in network gaming?
-1 this does not answer the question, having an on-line account doesn't prevent somebody from connecting with a hacked client that, for example, automates in-game actions. wow is entirely online based and it still gets hacked constantly. to prevent this blizzard employs their "warden" anti-cheat software, which is an example of dealing with the problem in question
Nov
6
comment Where to start learning OpenGL with C++?
@MahbuburRAaman null and void
Nov
6
comment Where to start learning OpenGL with C++?
opengl.org does more harm than good, i'd avoide it like the plague unless somebody wants the pure specification, it's not good for anything else