Page 1 of 1
Problem from 3rd person camera
Posted: Wed Jan 04, 2006 8:38 pm
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
Posted: Wed Jan 04, 2006 8:56 pm
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)
Posted: Wed Jan 04, 2006 9:13 pm
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"