Page 2 of 2

Posted: Sun Dec 25, 2005 1:10 pm
by byelan74
I folow your step but i have a problem. the camera is not behind the model. it is beside the model like this

Image

how can i solve this problem?

i have another problem with this code at :
http://irrlicht.sourceforge.net/phpBB2/ ... hp?p=62199

Help me please.... Thanks a lot.

Re: Dead Easy 3rd Person Camera

Posted: Sat Feb 04, 2006 2:02 am
by Guest
Halan wrote:
N/A wrote:Next, in the main file (i.e. main.cpp), put this where you are "initing" the main class, ie where you put: CGame::CGame( ... ) : variables... :

Code: Select all

direction(0), zdirection(0)
sry i dont get it :S
same...i don't understand..
is direction and zdirection being declared in the class itself?

ie
class CGame
{
public:
float direction,zdirection;
};

how and where are we supposed to initialize direction and zdirection?
thank you

Posted: Sat Feb 04, 2006 6:52 pm
by Saku
It might be because the model itself is turned in another direction.
Try opening other models or maybe open that one in a 3D editor like Blender.

Posted: Mon Jan 14, 2008 2:09 am
by Falcon
I implemented the code from the original post. But I'm having a problem moving the Player Node.

In my game loop, I change the value of PlayerNode->getPosition, then do a PlayerNode->setPosition.

The problem is that the player node is moving in world coordinates. So no matter which direction the player is facing, when I push forward (up), it translates in the same direction instead of relative (based off of the orientation).

Any help? Maybe I shouldn't use the getPosition and setPosition methods? I see a method for getRelativeTransformation, but nothing for setting a relative translation. Thanks!

Posted: Mon Jan 28, 2008 2:53 am
by Falcon
I solved the player movement problem by using some math functions for player movement found in someone else's 3rd person camera code.

Reply if anyone wants the snippets, I found them by searching camera code on the forum...

Posted: Mon Feb 25, 2008 8:54 am
by SG57
ya anything to make this little 3rd person camnera snippet the best!