<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to set camera settings properly in FBX Forum</title>
    <link>https://forums.autodesk.com/t5/fbx-forum/how-to-set-camera-settings-properly/m-p/11700985#M197</link>
    <description>&lt;P&gt;In a FBX exporter from a Qt3d scene I try to copy the camera parameters to a FBX camera. First I create camera and camera node as follows:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;	auto lCamera = FbxCamera::Create(d-&amp;gt;mFbxScene, "camera");
	auto lCameraNode = FbxNode::Create(d-&amp;gt;mFbxScene, "cameraNode");
	lCameraNode-&amp;gt;SetNodeAttribute(lCamera);

	auto lRootNode = d-&amp;gt;mFbxScene-&amp;gt;GetRootNode();
	lRootNode-&amp;gt;AddChild(lCameraNode);
	d-&amp;gt;mFbxCamera = lCamera;&lt;/LI-CODE&gt;&lt;P&gt;Then I try to copy the parameters from the QCamera object:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;bool FbxExport::copyCameraSettings(Qt3DRender::QCamera* camera)
{
	if (!camera || !d-&amp;gt;mFbxManager)
		return false;

	auto position = camera-&amp;gt;position();
	auto viewCenter = camera-&amp;gt;viewCenter();
	auto upVector = camera-&amp;gt;upVector().normalized();

	FbxDouble3 lCameraLocation(position[0], position[1], position[2]);
	FbxDouble3 lNewPointOfInterest(viewCenter[0], viewCenter[1], viewCenter[2]);
	FbxDouble3 lUpVector(upVector[0], upVector[1], upVector[2]);

	auto lCamera = d-&amp;gt;mFbxCamera;
	lCamera-&amp;gt;ProjectionType.Set(camera-&amp;gt;lens()-&amp;gt;projectionType() == Qt3DRender::QCameraLens::PerspectiveProjection ? FbxCamera::ePerspective : FbxCamera::eOrthogonal);
	lCamera-&amp;gt;Position.Set(lCameraLocation);
	lCamera-&amp;gt;InterestPosition.Set(lNewPointOfInterest);
	lCamera-&amp;gt;UpVector.Set(lUpVector);
	lCamera-&amp;gt;SetNearPlane(camera-&amp;gt;nearPlane());
	lCamera-&amp;gt;SetFarPlane(camera-&amp;gt;farPlane());
	lCamera-&amp;gt;FieldOfView.Set(camera-&amp;gt;fieldOfView());
	lCamera-&amp;gt;FocalLength.Set(lCamera-&amp;gt;ComputeFocalLength(camera-&amp;gt;fieldOfView()));
	lCamera-&amp;gt;FocusSource.Set(FbxCamera::eFocusSpecificDistance);
	lCamera-&amp;gt;FocusDistance.Set((viewCenter - position).length());
...
	d-&amp;gt;mFbxScene-&amp;gt;GetGlobalSettings().SetDefaultCamera(lCamera-&amp;gt;GetName());
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this does not seem to work as when opening the exported FBX in FBX Review I see the cameraNode selected but the camera settings not applied.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How should one copy the settings to be applicable in FBX Review?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers, Volker&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jan 2023 07:41:46 GMT</pubDate>
    <dc:creator>volkerenderlein</dc:creator>
    <dc:date>2023-01-24T07:41:46Z</dc:date>
    <item>
      <title>How to set camera settings properly</title>
      <link>https://forums.autodesk.com/t5/fbx-forum/how-to-set-camera-settings-properly/m-p/11700985#M197</link>
      <description>&lt;P&gt;In a FBX exporter from a Qt3d scene I try to copy the camera parameters to a FBX camera. First I create camera and camera node as follows:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;	auto lCamera = FbxCamera::Create(d-&amp;gt;mFbxScene, "camera");
	auto lCameraNode = FbxNode::Create(d-&amp;gt;mFbxScene, "cameraNode");
	lCameraNode-&amp;gt;SetNodeAttribute(lCamera);

	auto lRootNode = d-&amp;gt;mFbxScene-&amp;gt;GetRootNode();
	lRootNode-&amp;gt;AddChild(lCameraNode);
	d-&amp;gt;mFbxCamera = lCamera;&lt;/LI-CODE&gt;&lt;P&gt;Then I try to copy the parameters from the QCamera object:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;bool FbxExport::copyCameraSettings(Qt3DRender::QCamera* camera)
{
	if (!camera || !d-&amp;gt;mFbxManager)
		return false;

	auto position = camera-&amp;gt;position();
	auto viewCenter = camera-&amp;gt;viewCenter();
	auto upVector = camera-&amp;gt;upVector().normalized();

	FbxDouble3 lCameraLocation(position[0], position[1], position[2]);
	FbxDouble3 lNewPointOfInterest(viewCenter[0], viewCenter[1], viewCenter[2]);
	FbxDouble3 lUpVector(upVector[0], upVector[1], upVector[2]);

	auto lCamera = d-&amp;gt;mFbxCamera;
	lCamera-&amp;gt;ProjectionType.Set(camera-&amp;gt;lens()-&amp;gt;projectionType() == Qt3DRender::QCameraLens::PerspectiveProjection ? FbxCamera::ePerspective : FbxCamera::eOrthogonal);
	lCamera-&amp;gt;Position.Set(lCameraLocation);
	lCamera-&amp;gt;InterestPosition.Set(lNewPointOfInterest);
	lCamera-&amp;gt;UpVector.Set(lUpVector);
	lCamera-&amp;gt;SetNearPlane(camera-&amp;gt;nearPlane());
	lCamera-&amp;gt;SetFarPlane(camera-&amp;gt;farPlane());
	lCamera-&amp;gt;FieldOfView.Set(camera-&amp;gt;fieldOfView());
	lCamera-&amp;gt;FocalLength.Set(lCamera-&amp;gt;ComputeFocalLength(camera-&amp;gt;fieldOfView()));
	lCamera-&amp;gt;FocusSource.Set(FbxCamera::eFocusSpecificDistance);
	lCamera-&amp;gt;FocusDistance.Set((viewCenter - position).length());
...
	d-&amp;gt;mFbxScene-&amp;gt;GetGlobalSettings().SetDefaultCamera(lCamera-&amp;gt;GetName());
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this does not seem to work as when opening the exported FBX in FBX Review I see the cameraNode selected but the camera settings not applied.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How should one copy the settings to be applicable in FBX Review?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers, Volker&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 07:41:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fbx-forum/how-to-set-camera-settings-properly/m-p/11700985#M197</guid>
      <dc:creator>volkerenderlein</dc:creator>
      <dc:date>2023-01-24T07:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to set camera settings properly</title>
      <link>https://forums.autodesk.com/t5/fbx-forum/how-to-set-camera-settings-properly/m-p/11701369#M198</link>
      <description>&lt;P&gt;I was under the impression that&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;lCamera-&amp;gt;Position.Set(lCameraLocation);&lt;/PRE&gt;&lt;P&gt;should work. Setting the camera position using a camera nodes LcLTranslation property worked like a charm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So out of curiosity what can the lCamera-&amp;gt;Position property be used for other than positioning the camera?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 07:31:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fbx-forum/how-to-set-camera-settings-properly/m-p/11701369#M198</guid>
      <dc:creator>volkerenderlein</dc:creator>
      <dc:date>2023-01-25T07:31:44Z</dc:date>
    </item>
  </channel>
</rss>

