Question

I am porting GLU gluUnproject method to the modern OpenGL.I generally understand the algorithm behind it, but my question is why do we need model-view matrix?Can it be just view matrix?We unproject screen coordinates into the world space, so why do I need to supply also some object's model matrix (as a part of model view)?Or maybe I misunderstand how to use the method?I never really used fixed pipeline.

Was it helpful?

Solution

gluUnproject is usually described as transfroming coordinates from screen space (back) to object space. However, you can always use any matrices you like to get into some other space, so just using the view matrix here would give get you the world space values you seem to care about. The fixed function pipeline of GL never did use a world space explicitely, and always worked directly on the comopsition of the model and the view matrix.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top