I want a source code about 3rd camera like wow style.the url had posted is dead.my email is
raygenes@gmail.com.
All the 3rd camera link is dead,help me
-
- Posts: 5
- Joined: Sun Mar 01, 2009 9:25 pm
I dont think that "I WANT" behaviour is correct here...
You just must place ICameraSceneNode* behind your character scene, few pixels in up and headed on some angle down.
I wont post full code here, instead I'll show you way how to do it, you'll learn more.
So first you need your character node, place it somewhere on map and make sure it has collision.
Then create a camera node. Place it 40 units behind character using 3d math:
and turn it down by a few degree:
and of course you must include those two parts in main loop while(device->run()).
You just must place ICameraSceneNode* behind your character scene, few pixels in up and headed on some angle down.
I wont post full code here, instead I'll show you way how to do it, you'll learn more.
So first you need your character node, place it somewhere on map and make sure it has collision.
Then create a camera node. Place it 40 units behind character using 3d math:
Code: Select all
vector3df pos = node->getPosition();
float delta_x = cos(angle*0.0175f);
float delta_z = -sin(angle*0.0175f);
pos.X += delta_X * 40; // 40 units behind
pos.Z += delta_Z * 40; // 40 units behind
camera->setPosition(pos);
Code: Select all
camera->setRotation().Y -= 30;