Crystal Space
Welcome, Guest. Please login or register.
August 22, 2014, 05:08:17 pm

Login with username, password and session length
Search:     Advanced search
9005 Posts in 2043 Topics by 8333 Members
Latest Member: Deminagomez76
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  splited camera lookat problem
« previous next »
Pages: [1] Print
Author Topic: splited camera lookat problem  (Read 1785 times)
Janther
Newbie
*
Posts: 19


View Profile Email
« on: July 28, 2008, 11:37:09 pm »

im spliting the camera in four with this code

Code:
for (i; i < 4; i++) {
view[i].AttachNew(new csView (engine, g3d));
view[i]->GetCamera ()->SetSector (room);
view[i]->GetCamera ()->GetTransform ().SetOrigin (pos);
}
view[0]->SetRectangle(0, g2d->GetHeight() / 2, g2d->GetWidth() / 2, g2d->GetHeight() / 2);
view[1]->SetRectangle(g2d->GetWidth() / 2, g2d->GetHeight() / 2, g2d->GetWidth() / 2, g2d->GetHeight() / 2);
view[2]->SetRectangle(0, 0, g2d->GetWidth() / 2, g2d->GetHeight() / 2);
view[3]->SetRectangle(g2d->GetWidth() / 2, 0, g2d->GetWidth() / 2, g2d->GetHeight() / 2);

and im trying to look at a car

Code:
view[0]->GetCamera()->GetTransform().LookAt(car->GetMovable()->GetPosition() -
view[jug]->GetCamera()->GetTransform().GetOrigin(),
csVector3(0,1,0));

the thing is that the camera actualy reacts like its not splited and the car ends in the center of the window instead of the center of the camera view does anyone konw how to fix this?¿

thanks
Logged
Janther
Newbie
*
Posts: 19


View Profile Email
« Reply #1 on: July 29, 2008, 12:16:32 am »

I solved it

after a while looking at the functions of view, camera and transform i found

Code:
view[0]->GetCamera()->SetPerspectiveCenter(
g2d->GetWidth() / 4,
g2d->GetHeight()*3/4);
this centeres the horizont to the point in the window you want.

thanks anyway
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 4.182 seconds with 15 queries.