Camera system
-
capture
- Goblin
- Posts: 237
- Joined: Sun Nov 20, 2005 2:44 pm
Camera system
I have a request i would love to see put into Ogre. It would be really cool if there was a way to attach a camera to an node or entity. And have Ogre take care of making sure the camera stays in the correct place for use in a FPS or something or for being a third person camera.
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Code: Select all
SceneNode::attachObject(yourCamera);/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
CABAListic
- OGRE Retired Team Member

- Posts: 2903
- Joined: Thu Jan 18, 2007 2:48 pm
- x 58
- Contact:
- Kencho
- OGRE Retired Moderator

- Posts: 4011
- Joined: Fri Sep 19, 2003 6:28 pm
- Location: Burgos, Spain
- x 2
- Contact:
- stoneCold
- OGRE Expert User

- Posts: 867
- Joined: Fri Oct 01, 2004 9:13 pm
- Location: Carinthia, Austria
- x 1
I can just add to the previous speakers opinions, this is just way too application specific, and ogre shouldn't be responsible for that task.
You get a very! flexible camera API when using ogre and the wiki also got loads of articles about camera management.
Now go, use it/read them

greetings
You get a very! flexible camera API when using ogre and the wiki also got loads of articles about camera management.
Now go, use it/read them
greetings
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
-
Silencer
- Kobold
- Posts: 25
- Joined: Sun Feb 25, 2007 2:08 pm
You could add your camera to a child node of the object you want to track and use setAutoTracking to fix the camera to the object.
Code: Select all
Ogre::Entity* robot( mSceneMgr->createEntity( "robot", "robot.mesh" ) );
Ogre::SceneNode* robotnode( mSceneMgr->getRootSceneNode()->createChildSceneNode( "robotnode" ) );
robotnode->attachObject( robot );
robotnode->setPosition( 0, 500, 0 );
Ogre::SceneNode* cameranode = robotnode->createChildSceneNode( "camerayawnode" );
cameranode->setPosition( Ogre::Vector3( 0, 100, 250 ) );
cameranode->setAutoTracking( true, robotnode );
cameranode = cameranode->createChildSceneNode( "camerapitchnode" );
cameranode->attachObject( mCamera );
