Thomas Beer wrote:

Dirk Reiners wrote:

    Hi Thomas,

On Sun, 2005-10-30 at 01:04 +0200, Thomas Beer wrote:
Hi!

I just encountered an "unexpected behaviour" kind of problem with
MatrixPerspective:

MatrixPerspective(90.0, 1.0, 0.1, 1000.0) gives

 -0.501    0.000    0.000    0.000
  0.000   -0.501    0.000    0.000
  0.000    0.000   -1.000   -0.200
  0.000    0.000   -1.000    0.000

while gluPerspective(90.0, 1.0, 0.1, 1000.0) gives me

  1.000    0.000    0.000    0.000
  0.000    1.000    0.000    0.000
  0.000    0.000   -1.000   -0.200
  0.000    0.000   -1.000    0.000

Is this the supposed behaviour of MatrixPerspective?


Yup. ALL OpenSG functions take angles in radians, not degrees. Try
MatrixPerspective(osgdegree2rad(90.0), 1.0, 0.1, 1000.0), that should
fix it.

Hope it helps

    Dirk

I know, but the values with deg2rad(90) are worse:

MarixPespective 90:
 -0.501    0.000    0.000    0.000
  0.000   -0.501    0.000    0.000
  0.000    0.000   -1.000   -0.200
  0.000    0.000   -1.000    0.000

MarixPespective deg2rad(90):
 -0.000    0.000    0.000    0.000
  0.000   -0.000    0.000    0.000
  0.000    0.000   -1.000   -0.200
  0.000    0.000   -1.000    0.000

gluPerspective:
  1.000    0.000    0.000    0.000
  0.000    1.000    0.000    0.000
  0.000    0.000   -1.000   -0.200
  0.000    0.000   -1.000    0.000

Any ideas?
Thomas

I had a look into several gluPerspective and alike implementations:
They all take the tan(fov*0.5) where MatrixPerspective takes the whole tan(fov)!

Thomas


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to