About Store Forum Documentation Contact



Post Reply 
2D Camera ?
Author Message
zyzix Offline
Member

Post: #1
2D Camera ?
Hello Folks,

I'm more an artist than a coder but i managed a lot (IMHO) code in Esenthel wink But now I'm stuck with a Camera Problem. I checked all the Examples with Cameras (Camera Modes, Pathfinding, etc). I'm trying to achieve a simple 2D Camera (on a 3D Environment) that follows the Player (no rotations or anything, just simple). I'm working with this code:

Code:
Cam.dist=Max(1.0f,Cam.dist*ScaleFactor(Ms.wheel()*-0.1)); // update camera distance according to mouse wheel
Cam.setSpherical(Players[0].pos()+Vec(0,0.5,0), Players[0].angle.x, Players[0].angle.y, 0, Cam.dist); // set spherical camera looking at player position with given player angles

But somehow, whatever Values i tested (-> from the API Documentaton) it doesn't work. The only thing that happens is that the camera moves farther or higher but not from the side...

Are there any 2D Camera examples or does somebody know how to achieve this ? Thanks in advance!

Zyzix
07-26-2009 02:35 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
Re: 2D Camera ?
try replacing this "Players[0].angle.x, Players[0].angle.y" with constant values
07-26-2009 07:32 PM
Find all posts by this user Quote this message in a reply
Post Reply