The mapping from object space to window space is well defined. You just need to specify the appropriate matrices to use input coordinates of your choice.
I wanted the [vpt] transform mentioned in the first post
yes, all the matrices are well defined like
GL_MODELVIEW_MATRIX, GL_PROJECTION_MATRIX
but GL - does not maintain a GL_VIEWPORT_MATRIX which I am looking for
This is because I wanted all transforms in matrix form only
gl doesn’t store any GL_VIEWPORT_MATRIX matrix, you have to get the viewport using glGet(GL_VIEWPORT). I guess this is because the viewport transform is a simple affine transform.
You don’t say what kind of projection you are using. If perspective this is not possible because, well its perspective, you divide with your depth coordinate before the viewport transform.
“The above matrix did not give the same points.”
The viewport transformation includes translation, you need to use homogeneous coordinates.
A viewport matrix could be created like below in homogeneous coords, where
x and y are bottom left window coordinates.