This week I was working on the camera controls(Quesstion10) with twoloc engine, I found that the upgraded questions look easier to me. The first person, third person, and the over the shoulder camera are pretty straightforward just five lines of code.
OGRE_CORE->mViewport->setCamera(mCam1);
mCam1->setVisible(true);
mCam1->setDebugDisplayEnabled(true);
camDisplacement = (Ogre::Vector3(0,8,-50) - mCamera1Node->getPosition()) * mTightness;
mCamera1Node->translate(camDisplacement);
This is the first person camera code.
First, you need to toggle the visibility of the camera, then setup the displacement of the first person camera, and then translate the camera with the displacement. Basically the third person and the over the shoulder camera are same with the above code, I just need to change the displacement of the camera to what you want, then attach the camera to the viewport when different key pressed.
The more challenging part for the upgrade questions I believe its the Fixed Cinematic camera. The upgrade 2 question need to do more math for the displacement and vector stuff, but there are lots of information up on the internet, so we don't need to worry that much.
![]() |
| My very-rough-fixed-cinematic-cameras view with the frustums. |
The problem for me now is the Q10 base question. In this question, what we are supposed to do is "Using Maya, create camera paths and label them as either Interactive or FixedCinematic cameras." We also need to export this information to TwoLOC. Most of the base homework questions required us to export coordinates to TwoLOC which is the part that I have totally no idea with, I will try to figure it out later.

No comments:
Post a Comment