呵呵哈嘿

路曼曼其修远兮,吾将上下而求索
随笔 - 88, 文章 - 0, 评论 - 1, 引用 - 0
数据加载中……

from max sdk

解决了一些关于material的疑惑。

In MAX, every texture or material may have sub-texture or sub-materials. Materials that have sub-materials are referred to as meta-materials.

不明白texture可以有sub-texture和sub-material,还是只能有sub-texture?Mtl是不是就是这里说的Material?

In 3ds max there is only one material per node. In the INode class there are methods GetMtl() and SetMtl() that provide access to the node's material. GetMtl() returns a pointer to an instance of class Mtl.

virtual Mtl *GetMtl()=0;

Returns the renderer material for the node.

The material returned can be any material that may be assigned by the user. These include those from 3ds max itself as well as those created by third party developers. One may look at the Class_ID of the material to determine its type. For example, the 3ds max Standard material has a Class_ID of DMTL_CLASS_ID while the Multi/Sub-Object material uses MULTI_CLASS_ID. See List of Class_IDs to review the complete list provided by MAX.

Subclasses of MATERIAL_CLASS_ID

CMTL_CLASS_ID - Top/Bottom Material.

MULTI_CLASS_ID - Multi Material

DOUBLESIDED_CLASS_ID - Double sided Material

MIXMAT_CLASS_ID - Mix Material

Let's consider the case of accessing properties of the 3ds max Standard material first. If the Class_ID returned is DMTL_CLASS_ID then it's a Standard material. This material does not have any sub-materials, but has many parameters that a developer may need to access.

Next, let's consider access to the properties a Multi/Sub-Object material. If the Class_ID returned is MULTI_CLASS_ID then it's a Multi/Sub-Object material. The multi-material is a plug-in that uses the MtlID assigned to each face of a mesh as an index into the list of sub-materials. There are methods of the Face class getMatID() and setMatID() to access the MtlID for each face. Additionally, the Mesh class has methods getFaceMtlIndex(int i) and setFaceMtlIndex(int i, MtlID id).

Note that the meaning of this material index assigned to the face is specific to the type of material. A third party developer could write a material that used the ID in an entirely different manner than 3ds max does.

//哎,和没说一样,标准的max是怎么样的了?

For a multi-material, a developer can use the methods of MtlBase::NumSubMtls(), GetSubMtl(i) and SetSubMtl(i, Mtl* m) to access the sub materials.

NumSubMtls()和GetSubMtl(i)明明是Mtl的函数,哎,max,你真强。

posted on 2005-04-07 23:01 ChenA 阅读(651) 评论(0)  编辑 收藏 网摘 所属分类: 图形





标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2005-04-23 14:31 编辑过
Google站内搜索

China-pub 计算机图书网上专卖店!6.5万品种 2-8折!
近千种 9-95 新二手计算图书火热销售中!
开发者征途系统新作:《设计模式——基于C#的工程化实现及扩展》

相关文章:

相关链接: