3rd person camera problem

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
gnuesr
Gnoblar
Posts: 1
Joined: Wed Aug 12, 2009 7:56 am

3rd person camera problem

Post by gnuesr »

Hi:
I want to create a simple demo use 3rd person camera, and I use a very simple method:
1. Create playerNode
2. Create cameraNode as the child of playerNode. So when I move the playerNode, the camera can move without coding.
3. And I use follow code to do roll and pitch work:

Code: Select all

mCamNode->yaw(Degree(-mRotate * e.state.X.rel), Node::TS_PARENT); 
mCamNode->pitch(Degree(-mRotate * e.state.Y.rel), Node::TS_LOCAL);
Now, I create a plane to walk, but how to limit the pitch do not drill through the plane??

I'm still a new bird, can anyone give me a direction? :)
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Re: 3rd person camera problem

Post by Kencho »

This has been answered here a million times. Please, use the search first :)
Image
Post Reply