Chase cam around circular hoop

Problems building or running the engine, queries about how to use features etc.
Post Reply
parityerror
Gnoblar
Posts: 1
Joined: Thu Oct 30, 2014 5:35 am

Chase cam around circular hoop

Post by parityerror »

Hi all, in what I'm working on, I have a large vertical hoop (hoop is upright, parallel to y-axis) which I've gotten my character to be able to run around continuously. E.g. run across the bottom, up the side, and across the ceiling as if the character has magnetic boots which glue him to the surface. I think there have been threads on a similar topic in the past but not quite what I was looking for.

I'd like to develop a 3rd person camera which is always looking at the character's backside, with the camera's "up" and the characters "up" always in the same direction, even when the character is upsidedown on the upper prat of the hoop.

Developing a camera for this has got me stuck for over a week though. At first I started with the standard 3rd person camera as described in the Ogre tutorials, which uses a single camera node. I think the problem that I had there was gimbal lock, as the camera would always roll over on its own no matter what I tried.

Now I'm trying to use a multi-node camera in the hope that keeping the yaw, pitch, roll separate will help. But I can never get the camera to follow the character as he runs around the hoop--it always starts shuddering and pointing in random directions.

Setup code:

Code: Select all

 mCameraNode = mSceneManager->getRootSceneNode()->createChildSceneNode();
 mCameraYawNode = mCameraNode->createChildSceneNode();
 mCameraPitchNode = mCameraYawNode->createChildSceneNode();
 mCameraRollNode = mCameraPitchNode->createChildSceneNode();
 mCameraYawNode->setFixedYawAxis(true);
 mCameraNode->setFixedYawAxis(true);
 mCameraPitchNode->setFixedYawAxis(true);
 mCameraRollNode->attachObject(cam);
Does someone have experience with this type of camera? I think it must be similar to the cam you'd need for an airplane or a spaceship?
User avatar
Waruck
Goblin
Posts: 210
Joined: Mon Dec 12, 2011 12:52 pm
Location: Germany
x 34

Re: Chase cam around circular hoop

Post by Waruck »

Can you provide some of the code you use to move the camera/make it follow the node to which your character is attached?
User avatar
duststorm
Minaton
Posts: 921
Joined: Sat Jul 31, 2010 6:29 pm
Location: Belgium
x 80
Contact:

Re: Chase cam around circular hoop

Post by duststorm »

Do you know Ogre Camera Control System?
http://ogre-ccs.sourceforge.net/
Perhaps it has what you need. It might serve as an implementation example if you want to write it yourself.

I'm not sure if it works with v2 but if not, it should be updated to do so ;)
Developer @ MakeHuman.org
Post Reply