Example #1
0
LambertMaterial Converter::getLambertMaterial(FbxSurfaceMaterial *material)
{
	auto ambient = ((FbxSurfacePhong *)material)->Ambient;
	XMFLOAT3 amb = XMFLOAT3(ambient.Get()[0], ambient.Get()[1], ambient.Get()[2]);
	auto diffuse = ((FbxSurfacePhong *)material)->Diffuse;
	XMFLOAT3 dif = XMFLOAT3(diffuse.Get()[0], diffuse.Get()[1], diffuse.Get()[2]);
	auto emissive = ((FbxSurfacePhong *)material)->Emissive;
	XMFLOAT3 emi = XMFLOAT3(emissive.Get()[0], emissive.Get()[1], emissive.Get()[2]);
	auto alpha = 1.0 - ((FbxSurfacePhong *)material)->TransparencyFactor;

	return LambertMaterial(amb, dif, emi, alpha);
}
 ptr<LambertMaterial> LambertMaterial::create( Color diffuse, Color ambient, Color emissive ){
     return make_shared<LambertMaterial>(LambertMaterial(diffuse, ambient, emissive));
 }