Crystal Space
Welcome, Guest. Please login or register.
March 24, 2017, 09:14:14 am

Login with username, password and session length
Search:     Advanced search
8993 Posts in 2044 Topics by 32293 Members
Latest Member: Haistarla881
* 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 2244 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.127 seconds with 15 queries.