Dead Easy 3rd Person Camera

A forum to store posts deemed exceptionally wise and useful
byelan74
Posts: 28
Joined: Sat Dec 24, 2005 11:29 am

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

Re: Dead Easy 3rd Person Camera

Post 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
Saku
Posts: 158
Joined: Wed Jan 05, 2005 8:48 am
Location: Denmark

Post 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.
Call me Wice, Miami Wice!
Falcon
Posts: 36
Joined: Sun Jan 13, 2008 9:24 pm
Location: Z_California

Post 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!
-< Dante >
< Industry Senior QA Tester>
< IT Project Manager>
< Independent Programmer>-
Falcon
Posts: 36
Joined: Sun Jan 13, 2008 9:24 pm
Location: Z_California

Post 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...
-< Dante >
< Industry Senior QA Tester>
< IT Project Manager>
< Independent Programmer>-
SG57
Posts: 66
Joined: Fri May 18, 2007 5:51 am

Post by SG57 »

ya anything to make this little 3rd person camnera snippet the best!
Post Reply