Camera system

What it says on the tin: a place to discuss proposed new features.
Post Reply
capture
Goblin
Posts: 237
Joined: Sun Nov 20, 2005 2:44 pm

Camera system

Post by capture »

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.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

Code: Select all

SceneNode::attachObject(yourCamera);
:wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
capture
Goblin
Posts: 237
Joined: Sun Nov 20, 2005 2:44 pm

lol

Post by capture »

yeah there is that, but i was thinking something that will cause it to follow a character and look at the correct place as the character rotates or whatever.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Post by CABAListic »

I think there is an auto-tracking functionality that does this. But frankly, for any decent game camera system that is likely way to simple. Good camera movement, however, depends strongly on the game and the surroundings, so I don't think that Ogre is suited to provide that.
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:

Post by Kencho »

That logic is too application-specific as to be treated by Ogre itself. There could be additional layers to provide certain functionality, but in my honest opinion, that layer doesn't belong to Ogre.
Image
User avatar
Glenn101
Gnoblar
Posts: 12
Joined: Sat Aug 11, 2007 11:54 am
Location: Australia, Melbourne

Post by Glenn101 »

I couldn't agree more to that request :D
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Post by stoneCold »

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 :wink: :D

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

Post by Silencer »

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 );
Post Reply