I folow your step but i have a problem. the camera is not behind the model. it is beside the model like this
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.
Dead Easy 3rd Person Camera
Re: Dead Easy 3rd Person Camera
same...i don't understand..Halan wrote:sry i dont get it :SN/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)
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
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!
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!
-< Dante >
< Industry Senior QA Tester>
< IT Project Manager>
< Independent Programmer>-
< Industry Senior QA Tester>
< IT Project Manager>
< Independent Programmer>-
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...
Reply if anyone wants the snippets, I found them by searching camera code on the forum...
-< Dante >
< Industry Senior QA Tester>
< IT Project Manager>
< Independent Programmer>-
< Industry Senior QA Tester>
< IT Project Manager>
< Independent Programmer>-