游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1046|回复: 0

loadmesh 问题

[复制链接]

3

主题

3

帖子

0

积分

新手上路

Rank: 1

积分
0
发表于 2008-11-21 09:09:00 | 显示全部楼层 |阅读模式
private :  void LoadMesh(String ^file)
                {
                                array<ExtendedMaterial ^> ^ mtrl;
                                array<GraphicsStream ^> ^adj;

                                 // Load our mesh
                       
               Mesh ^ mesh = Mesh::FromFile(file, MeshFlags::Managed, device);
                            // If we have any materials, store them
                                    if (mtrl->Length > 0)
                      {
                        
                                
                           meshMaterials = gcnew array <Material ^> (mtrl->Length);
                         meshTextures = gcnew array <Texture ^> (mtrl->Length);

                            Store each material and texture
                            for (int i = 0; i < mtrl.Length; i++)
                            {
                               meshMaterials = mtrl->Material3D;
                                                      if ((mtrl->TextureFilename != null) && (mtrl->TextureFilename != String::Empty))
                                 {
                                    //We have a texture, try to load it
                                                                meshTextures = TextureLoader::FromFile(device, mtrl->TextureFilename);
                                 }
                                                 }
                                            
                                      }

不知道怎么回事,这段代码总是出错。(这是用managed vc++在vs2005.net 下写的)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-20 21:16

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表