Problem from 3rd person camera

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
byelan74
Posts: 28
Joined: Sat Dec 24, 2005 11:29 am

Problem from 3rd person camera

Post by byelan74 »

I do a 3rd cam from http://irrlicht.sourceforge.net/phpBB2/ ... highlight=

but a camera view is very far
How can i improve a camera view

Image
dawasw
Posts: 357
Joined: Tue Aug 10, 2004 4:39 pm
Location: Poland

Post by dawasw »

Code: Select all

core::position2d<f32> cursorPos = device->getCursorControl()->getRelativePosition(); 
     scene::ICameraSceneNode* camera = device->getSceneManager()->getActiveCamera(); 
     core::vector3df cameraPos = camera->getAbsolutePosition(); 
      
     float change_x = ( cursorPos.X - 0.5 ) * 256.0f; 
     float change_y = ( cursorPos.Y - 0.5 ) * 256.0f; 
     
     device->getCursorControl()->setVisible(true);
      
     core::vector3df playerPos = playerNodeint->getPosition();
     
     float xf = playerPos.X - cos( direction * PI / 180.0f ) * 128.0f; 
     float yf = playerPos.Y - sin( zdirection * PI / 180.0f ) * 128.0f; 
     float zf = playerPos.Z + sin( direction * PI / 180.0f ) * 128.0f; 

     camera->setPosition( core::vector3df( xf, yf+25.0f, zf ) ); 
     camera->setTarget( core::vector3df( playerPos.X, playerPos.Y+25.0f, playerPos.Z ) ); 
     playerNodeint->setRotation( core::vector3df( 0, direction, 0 ) );
I use this above and I have camera exacly in 'back' of player.

Sorry for of top, but what do you use for physics in your game ? Scene node Animators ? And could you just tell me what is the 3d format of your level ? (I'm just curious because I'm making a bit similiar thing myself atm. and I would just like to know what techniques use other people)
byelan74
Posts: 28
Joined: Sat Dec 24, 2005 11:29 am

Post by byelan74 »

I use model "dwarf.x"
but i setscale(0.05f, 0.05f, 0.05f);

if i dont set scale, a camera view is exactly "back"
Post Reply