3rd camera and movement for RPG
3rd camera and movement for RPG
Greetings, recently has passed with 3d game studio A6 (c-script), on Irrlicht, is very happy with it, has disassembled all туториалы, give plz an example of movement and the chamber from 3 persons, for рпг game, and is easier plz that it was possible to disassemble, in advance thanks... P.S. Forgive for my bad English, I from Russia:)
Gothic, great game...
Sorry do you mean how do you make a camera view you the player from 3rd person like many rpg games??
Programming Blog: http://www.uberwolf.com
Yeah I see what you mean about the links in the thread - sorry bout thatDiego wrote:Rytz References for a long time have died... There are still ideas? dejai the chamber as in the Gothic style... It is adhered to the player... Also follows everywhere it... It is desirable for the beginning a code of the chamber without any routine
Do you understand / have a working 1st person camera view already? The 3rd person view isn't much different in my opinion.
The camera from 1 person and moving on WASD I do without problems, with the camera from 3 persons all is differently... Help plz... I Attach the camera to node What that in the image the camera turns on 180* and movement of the player varies on the contrary... And the model of the player looks at me instead of is located to me by a back o. O
//Camera
scene::ICameraSceneNode* camera=
smgr->addCameraSceneNode(playerNode,core::vector3df(50,50,0))
then I do moving on WASD
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{
if (playerNode != 0 && event.EventType == irr::EET_KEY_INPUT_EVENT)
{
switch(event.KeyInput.Key)
{
case KEY_KEY_W:
case KEY_KEY_S:
{
core::vector3df v=playerNode->getPosition();
v.X += event.KeyInput.Key == KEY_KEY_W ? 2.0f : -2.0f;
playerNode->setPosition(v);
break;
}
case KEY_KEY_A:
case KEY_KEY_D:
{
core::vector3df v=playerNode->getPosition();
v.Z += event.KeyInput.Key == KEY_KEY_A ? 2.0f : -2.0f;
playerNode->setPosition(v);
break;
}
return true;
}
}
return false;
}
};
playerNode moves jerky and is curve enough... Look a code.. What have I made not so? .
P.S. Forgive for my bad English...
//Camera
scene::ICameraSceneNode* camera=
smgr->addCameraSceneNode(playerNode,core::vector3df(50,50,0))
then I do moving on WASD
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{
if (playerNode != 0 && event.EventType == irr::EET_KEY_INPUT_EVENT)
{
switch(event.KeyInput.Key)
{
case KEY_KEY_W:
case KEY_KEY_S:
{
core::vector3df v=playerNode->getPosition();
v.X += event.KeyInput.Key == KEY_KEY_W ? 2.0f : -2.0f;
playerNode->setPosition(v);
break;
}
case KEY_KEY_A:
case KEY_KEY_D:
{
core::vector3df v=playerNode->getPosition();
v.Z += event.KeyInput.Key == KEY_KEY_A ? 2.0f : -2.0f;
playerNode->setPosition(v);
break;
}
return true;
}
}
return false;
}
};
playerNode moves jerky and is curve enough... Look a code.. What have I made not so? .
P.S. Forgive for my bad English...
Gothic, great game...
I don't think you have a grasp on movement in a 3D space... you need to be using cosf() / sinf() / tan() to calculate the positioning.Diego wrote:The camera from 1 person and moving on WASD I do without problems, with the camera from 3 persons all is differently... Help plz... I Attach the camera to node What that in the image the camera turns on 180* and movement of the player varies on the contrary... And the model of the player looks at me instead of is located to me by a back o. O
Whenever your avatar (player) moves, you also need to move its target position and the camera position based on that avatar movement.
If the current view is 1st person, the camera will be centered at the avatar position (the avatar-to-camera radius will be almost 0). If the current view is 3rd person, the camera will be "zoomed out" (the avatar-to-camera radius will increase based on the zoom extent).
That's why I asked if you understood how the 1st person view worked when it came to movement
http://irrlicht.sourceforge.net/phpBB2/ ... a&start=15
http://irrlicht.sourceforge.net/phpBB2/ ... son+camera
http://irrlicht.sourceforge.net/phpBB2/ ... son+camera
There are plenty of more examples in the examples / tutorials forum.
Do a search for 3rd person camera in that forum.
http://irrlicht.sourceforge.net/phpBB2/ ... son+camera
http://irrlicht.sourceforge.net/phpBB2/ ... son+camera
There are plenty of more examples in the examples / tutorials forum.
Do a search for 3rd person camera in that forum.
