Creating a camera
 
 
 

CubeCreator creates a node whose node attribute is a camera.

Let’s assume we already have a scene:

KFbxSDKManager* mySDKManager  // An initialized and valid SDK manager object
KFbxScene* myScene;           // An initialized and valid scene object

First we instantiate a camera object that is contained within our scene:

KFbxCamera* myCamera = KFbxCamera::Create(myScene, "");

Then we adjust the settings of the camera so that it “films” in a format suitable for (non-high-definition) television :

// Set camera properties for classic TV projection with aspect ratio 4:3
myCamera->SetFormat(KFbxCamera::eNTSC);

Next we instantiate a node object:

KFbxNode* myCameraNode = KFbxNode::Create(myScene, "");

We set the camera object as the node attribute of the node object:

myCameraNode->SetNodeAttribute(myCamera);

Finally, we add the node as a child of the root note of the FBX scene graph:

KFbxNode* myRootNode = myScene->GetRootNode()
myRootNode->AddChild(myCameraNode);