2019/05/30
2019/05/31
bool dmp_source (const Xml_E& xml)
{
tstring name = xml.GetName() ;
if (name != DAE_source) { return false ; }
Xml_E fa = xml.GetElement(DAE_float_array) ;
Xml_E tc = xml.GetElement(DAE_technique_common) ;
Xml_E ac = tc.GetElement(DAE_accessor) ;
if (fa.IsEmpty()) { return false ; }
if (tc.IsEmpty()) { return false ; }
if (ac.IsEmpty()) { return false ; }
{
tstring fa_str = fa.GetText() ;
long stride = 1 ;
tstring stride_str = ac.GetAttribute(DAE_stride) ;
if (stride_str.empty()) { return false ; }
stride = ::_ttoi(stride_str.c_str()) ;
Vd3A v3a ;
Vd2A v2a ;
if (stride == 3) { v3a = ::String_ToVd3A(fa_str.c_str()) ; }
if (stride == 2) { v2a = ::String_ToVd2A(fa_str.c_str()) ; }
{
v_Vd4A v_pnts ;
PLF plf ;
if (v3a.size() > 0) { plf = PLF(PLF::point,::ToVd4A( v3a) ) ; }
if (v2a.size() > 0) { plf = PLF(PLF::point,::ToVd4A(::ToVd3A(v2a))) ; }
v_PLF v_plf ;
v_plf.push_back(plf) ;
::Dump_ipl(v_plf) ;
}
}
return true ;
}
2019/06/04
先日のコードと見た目はあまり変わらないが...
bool dmp_source (const Xml_E& xml)
{
tstring name = xml.GetName() ;
if (name != DAE_source) { return false ; }
Xml_E tc = xml.GetElement(DAE_technique_common) ;
if (tc.IsEmpty()) { return false ; }
{
long stride = get_stride(tc) ;
dae_V3A v3a ;
dae_V2A v2a ;
if (stride == 3) { v3a = get_source_3(xml) ; }
if (stride == 2) { v2a = get_source_2(xml) ; }
{
v_Vd4A v_pnts ;
PLF plf ;
if (v3a.size() > 0) { plf = PLF(PLF::point,::ToVd4A( v3a) ) ; }
if (v2a.size() > 0) { plf = PLF(PLF::point,::ToVd4A(::ToVd3A(v2a))) ; }
v_PLF v_plf ;
v_plf.push_back(plf) ;
::Dump_ipl(v_plf) ;
}
}
return true ;
}
広告