Author Topic: Full screen and projection matrices  (Read 1733 times)

Offline dimy93

  • byte
  • *
  • Posts: 2
    • View Profile
Full screen and projection matrices
« on: June 22, 2013, 01:17:26 am »
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Full screen and projection matrices
« Reply #1 on: June 22, 2013, 08:43:22 am »
There are methods to do 3d-2d and 2d-3d projections in Interact2D.

Offline dimy93

  • byte
  • *
  • Posts: 2
    • View Profile
Re: Full screen and projection matrices
« Reply #2 on: June 22, 2013, 01:54:07 pm »
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Full screen and projection matrices
« Reply #3 on: June 22, 2013, 04:39:06 pm »
I don't get the problem...what binary search?