Brainache
Member
|
Above view camera
Hey there, I am starting some work on implementing a minimap, and when trying to just render the world from directly above the player's position... the camera wont render from directly above ( it changes to what looks like 3rd person at the player's position, but zoomed out)... when I add a slight offset on .z... it renders correctly (though not where i need it...) I dont see anywhere where the pitch/angle is being limited... suggestions?
(below is the code im using to set the camer'a position... )
Vec target = who->pos();
Vec from = target;
// from.z -= 0.01;
from.y += 15;
Cam.setFromAt(from,target);
Cam.updateVelocities().set();
|
|
06-28-2009 02:56 PM |
|
Esenthel
Administrator
|
Re: Above view camera
try this:
Vec target=who->pos();
Cam.setPosDir(target+Vec(0,15,0), Vec(0,-1,0), Vec(0,0,1));
you may have problems with setFromAt because it tries to find the camera 'up' vector aligned to Vec(0,1,0) vector, which is problematic when looking straight down
|
|
06-28-2009 03:56 PM |
|
Brainache
Member
|
Re: Above view camera
Great - that took care of it... Thanks!
|
|
06-29-2009 01:48 AM |
|