DirectXMesh 几何处理库开源项目

我要开发同款
匿名用户2015年04月20日
109阅读

技术信息

开源地址
https://github.com/Microsoft/DirectXMesh
授权协议
MIT

作品详情

DirectXMesh是微软开发的DirectX的几何处理库。

示例代码:

std::uique_ptr<WaveFrotReader<uit16_t>> mesh( ew WaveFrotReader<uit16_t>() );if ( FAILED( mesh->Load( L"test.obj" ) ) )  // Errorif ( mesh->hasNormals )   // Skip ext computatiosize_t Faces = mesh->idices.size() / 3;size_t Verts = mesh->vertices.size();std::uique_ptr<XMFLOAT3[]> pos( ew XMFLOAT3[ Verts ] );for( size_t j = 0; j < Verts; ++j )  pos[ j ] = mesh->vertices[ j ].positio;std::uique_ptr<XMFLOAT3[]> ormals( ew XMFLOAT3[ Verts ] );if ( FAILED( ComputeNormals( &mesh->idices.frot(), Faces, pos.get(), Verts, CNORM_DEFAULT, ormals.get() ) ) )  // Errorif ( !mesh->hasTexcoords )  // Skip ext computatiostd::uique_ptr<XMFLOAT2[]> texcoords( ew XMFLOAT2[ Verts ] );for( size_t j = 0; j < Verts; ++j )  texcoords[ j ] = mesh->vertices[ j ].textureCoordiate;std::uique_ptr<XMFLOAT3[]> tagets( ew XMFLOAT3[ Verts ] );std::uique_ptr<XMFLOAT3[]> bitagets( ew XMFLOAT3[ Verts ] );if ( FAILED( ComputeTagetFrame( &mesh->idices.frot(), Faces,                                 pos.get(), ormals.get(), texcoords.get(), Verts,                                 tagets.get(), bitagets.get() ) ) )  // Error

功能介绍

DirectXMesh 是微软开发的 DirectX 的几何处理库。 示例代码:
std::unique_ptr<WaveFrontReader<uint16_t>> mesh( new W...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论