惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
T
Threatpost
Latest news
Latest news
N
News | PayPal Newsroom
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
O
OpenAI News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Securelist
小众软件
小众软件
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Martin Fowler
Martin Fowler
S
SegmentFault 最新的问题
Cisco Talos Blog
Cisco Talos Blog
云风的 BLOG
云风的 BLOG
AWS News Blog
AWS News Blog
GbyAI
GbyAI
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
美团技术团队
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
博客园 - 聂微东
V2EX - 技术
V2EX - 技术
T
Troy Hunt's Blog
SecWiki News
SecWiki News
S
Secure Thoughts
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
腾讯CDC
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed

博客园 - 大河马和小魔鱼

[zz]dds [zz]Shader programming tips #1 [zz]如何使用effect [论文摘要]Tips and Tricks for D3DX Effects-Based Renders [zt]矩阵和向量的乘法顺序 [论文简要]Integrating Shaders Into the Vision Rendering Engine Depth Bias Planar Shadow Instancing 渲染简要 球面环境贴图 MaxScript 心得1 - 大河马和小魔鱼 - 博客园 MAX Script Export/Import 3DS MAX PlugIn 材质和纹理 牛刀小试,Max Script 3DS MAX PlugIn(2) 邂逅Geometry [原创]3DS MAX PlugIn 1 预备役 Novodex2.6.2 布料系统 Novodex,ODE,Tokamak,Bullet,Newton...... 原来我一直在做傻事
Export利器:IGame
大河马和小魔鱼 · 2007-05-28 · via 博客园 - 大河马和小魔鱼

古人云:君子生非异也,善假于物也
数据导出是一个繁琐的工作,于是,有了IGame这个解脱程序员的东西:

IGameMax提供给游戏开发的一个用于导入导出的接口。在Maxhelp里面这个东西叫做3ds Max Data Exchange Interface。有了这个接口,可以大大的简化导入导出工作的工作量。

如果有经历过用MAX SDK导出关键帧动画以及骨骼动画,SkinModifier等等的经历的话,我想肯定会记忆深刻。IGame的作用就是把复杂的Max的概念简化,封装。

建立IGame:

IGameScene * m_pIgame= GetIGameInterface()

坐标系:

前面我提到的导出的文章都没有提这个问题,所有的坐标都是用的MAX本身的坐标系,及Z轴向上。在游戏中坐标系可能千奇百怪,IGame考虑到这点提供了指定坐标系的功能:

IGameConversionManager * cm = GetConversionManager();

cm->SetCoordSystem(IGameConversionManager::IGAME_D3D);

m_pIgame->InitialiseIGame(true);

其中IGAME_D3D就是指定的坐标系,同样也可以自定义坐标系:

  UserCoord WhackySystem = {

     1,   //Right Handed

     1,   //X axis goes right

     4,   //Y Axis goes in

     3,   //Z Axis goes down.

     0,   //U Tex axis is left

     1, //V Tex axis is Down

   };  

   IGameConversionManager * cm = GetConversionManager();

   cm->SetUserCoordSystem(WhackySystem);

IGame要点:

GetTopLevelNodeCount:获得顶级的Node数目,不包括Root

GetRootMaterialCount:获得所有的材质数目

GetTopLevelNode(i):获得指定Node

GetIGameObject():获得Node中包含的Object

GetLocalTM():获得Node的矩阵

IGameMesh ::GetVertex(i):获得顶点

IGameMesh ::GetFace(i);获得面

IGameMesh ::GetNormal(i):获得法线

至于其他就依次类推了,从函数的命名,到概念的简化,无疑都比原始的MAXSDK进步了很多。有了IGame接口,大大减轻了程序员的负担,我相信没有哪个愿意把大把的时间花在数据的导入导出上。

花了几十分钟简单的试用了一下IGame写了个小小的导出插件,只导出了顶点,面,材质,法线以及矩阵,感觉基本上没什么阻碍。不过IGame最大的功能还是用在骨骼动画,关键帧动画上面,仅仅只是简单的几何体导出并不能体现出IGame的功效。

最后还是附上代码和工程吧。不得不提示一下,由于种种曲折的原因,我这个工程是在MAX8 SDK MAX8 完成的,其间省略上千字曲折的经历,不过在MAX9下应该可以通过编译。编译完成后,记得在Max 中选择Export Selected而不是试用Export

DownLoad Source