Jump to content
  • Advertisement
Sign in to follow this  
lucky6969b

3dxi to d3d camera conversions

This topic is 2524 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Have to resort to 3dxi, just wondering how to construct a D3D Camera from the far/near clips etc parameters.
Anywhere I can look?
Thanks
Jack


void IGameExporter::DumpCamera(IGameCamera *ca, CComPtr<IXMLDOMNode> parent)
{

IGameProperty * prop;
CComPtr <IXMLDOMNode> propNode,targNode;


CreateXMLNode(pXMLDoc,parent,_T("Properties"),&propNode);
prop = ca->GetCameraFOV();
DumpProperties(propNode,prop);
prop = ca->GetCameraFarClip();
DumpProperties(propNode,prop);
prop = ca->GetCameraNearClip();
DumpProperties(propNode,prop);
prop = ca->GetCameraTargetDist();
DumpProperties(propNode,prop);

if(ca->GetCameraTarget())
{
CreateXMLNode(pXMLDoc,parent,_T("Target"),&targNode);
ExportChildNodeInfo(targNode,ca->GetCameraTarget());
}


}

Share this post


Link to post
Share on other sites
Advertisement
You can use [font=Consolas, Courier, monospace][size=2]D3DXMatrixLookAtLH(...) command to create a view matrix and [/font][font=Consolas, Courier, monospace][size=2]D3DXMatrixPerspectiveFovLH(...) to create the projection matrix. [/font][font=Consolas, Courier, monospace][size=2]Those functions have variants so you'll have to look for the correct function.[/font]
[font=Consolas, Courier, monospace][size=2]
[/font]
[font=Consolas, Courier, monospace][size=2]Fov, FarClip and NearClip are data needed for the projection matrix.[/font]
[font=Consolas, Courier, monospace][size=2]
[/font]
[font=Consolas, Courier, monospace][size=2]Camera's position and target's position provide data for the view matrix.[/font]
[font=Consolas, Courier, monospace][size=2]
[/font]
[font=Consolas, Courier, monospace][size=2]Cheers![/font]
[font=Consolas, Courier, monospace][size=2]
[/font]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!