Full screen and projection matrices

Started by dimy93, June 22, 2013, 01:17:26 AM

Previous topic - Next topic

dimy93

I am trying to display an unit cube so that it fits in a specific way in the phone's screen. At the moment I need to display it so that its  side is equal to the smaller of the sides of the screen. Later I may also need to add margins to the picture. Thus, I am searching for a way to get the screen coordinates of the cube. I know that the right way to do that is to use the projection matrix. But the projection matrix of the camera class is puzzling to me. It definitely doesn't match the normal opengl projection matrix(even converted to opengl matrix using the toOpegl method in the Matrix class). So I was wondering if you guys know how the matrix is derived or even better - how to use it to convert a vertex to screen coordinates. Thx in andvance

EgonOlsen

There are methods to do 3d-2d and 2d-3d projections in Interact2D.

dimy93

Thanks for the quick reply- those do kinda of what I need
Nevertheless it would be cool if I could extract the required coordinates of the camera so that a couple of vertices are mapped to given screen coordinates. Now I am doing a binary search for my camera coordinates which is not very efficient isn't it :D

EgonOlsen

I don't get the problem...what binary search?