Crystal Space
Welcome, Guest. Please login or register.
October 31, 2014, 11:55:04 am

Login with username, password and session length
Search:     Advanced search
9011 Posts in 2044 Topics by 8898 Members
Latest Member: Anitelc
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Project Development
| |-+  Bug Reports
| | |-+  SetFOVAngle has a wrong aspect ratio
« previous next »
Pages: [1] Print
Author Topic: SetFOVAngle has a wrong aspect ratio  (Read 652 times)
Lucageode
Newbie
*
Posts: 2


View Profile Email
« on: November 12, 2013, 10:52:27 am »

Try SetFOVAngle(110, 1.0f) and SetFOVAngle(20, 1.0f) in simplept application.
The field of height is constant and the image is only deformed in width. This not allow to use this function like a real zoom. I try it on crystalspace 1.0 and it worked right but in crystalspace 2.1 the image not respect the aspectratio and the field of height is constant. The projection matrix has some trouble?
I used the simplept to testing it changing the line pcam->SetFOVAngle(20, 1.0f); in CreateRoom
Logged
Lucageode
Newbie
*
Posts: 2


View Profile Email
« Reply #1 on: November 12, 2013, 12:27:23 pm »

i think the problem is in
void PerspectiveImpl::UpdateMatrix ()
{
  if (!matrixDirty) return;

  matrix = CS::Math::Projections::CSPerspective (1.0f,
    aspect, shift_x, shift_y*aspect, inv_aspect, nearClip);

  matrixDirty = false;
  invMatrixDirty = true;
}

it should use the default_aspect. like this?

void PerspectiveImpl::UpdateMatrix ()
{
  if (!matrixDirty) return;

  matrix = CS::Math::Projections::CSPerspective (1.0f,
    default_aspect, shift_x, shift_y*default_aspect, inv_aspect, nearClip);

  matrixDirty = false;
  invMatrixDirty = true;
}

now the simplept tutorial seams worf fine.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 5.195 seconds with 16 queries.