3rd camera and movement for RPG

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
Diego
Posts: 9
Joined: Sat Jun 30, 2007 11:06 pm

3rd camera and movement for RPG

Post by Diego »

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...
Rytz
Posts: 249
Joined: Wed Oct 25, 2006 6:05 am
Location: IL, USA
Contact:

Post by Rytz »

Image
dejai
Posts: 522
Joined: Sat Apr 21, 2007 9:00 am

Post by dejai »

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
Diego
Posts: 9
Joined: Sat Jun 30, 2007 11:06 pm

Post by Diego »

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
Gothic, great game...
Rytz
Posts: 249
Joined: Wed Oct 25, 2006 6:05 am
Location: IL, USA
Contact:

Post by Rytz »

Diego 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
Yeah I see what you mean about the links in the thread - sorry bout that :).

Do you understand / have a working 1st person camera view already? The 3rd person view isn't much different in my opinion.
Image
Diego
Posts: 9
Joined: Sat Jun 30, 2007 11:06 pm

Post by Diego »

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...
Gothic, great game...
Rytz
Posts: 249
Joined: Wed Oct 25, 2006 6:05 am
Location: IL, USA
Contact:

Post by Rytz »

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
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.

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 :).
Image
Diego
Posts: 9
Joined: Sat Jun 30, 2007 11:06 pm

Post by Diego »

You excuse me probably I badly I understand you (I Russian and own English not in such degree in what you)... You could not show above described on any example...
Gothic, great game...
Diego
Posts: 9
Joined: Sat Jun 30, 2007 11:06 pm

Post by Diego »

People so here somebody will help?:)
Gothic, great game...
Rytz
Posts: 249
Joined: Wed Oct 25, 2006 6:05 am
Location: IL, USA
Contact:

Post by Rytz »

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.
Image
Diego
Posts: 9
Joined: Sat Jun 30, 2007 11:06 pm

Post by Diego »

Respect my friend, thanks... So now other question... I have a level .irr, I have generated shadows the program irrEdit... Here a question.
I at a level for example have a model - a flank... As to me to it to apply shader a parallax...
Gothic, great game...
Diego
Posts: 9
Joined: Sat Jun 30, 2007 11:06 pm

Post by Diego »

People so here somebody will help?:)))
Gothic, great game...
Post Reply