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

推荐订阅源

A
About on SuperTechFans
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 司徒正美
宝玉的分享
宝玉的分享
美团技术团队
量子位
The Cloudflare Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
IT之家
IT之家
爱范儿
爱范儿
J
Java Code Geeks
博客园 - Franky
Last Week in AI
Last Week in AI
B
Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
InfoQ
GbyAI
GbyAI
Recent Announcements
Recent Announcements
小众软件
小众软件
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
MyScale Blog
MyScale Blog

博客园 - ChenA

Fire and Motion[转载] terrain lighting radiosity lighting 很专业的Flash游戏 Water Simulate Decal Texture NVPerfHUD 不明白 晕,wow的alpha贴图的坐标要*0.95f 关于ROAM 四道题让你变猪头,敢不敢试一试?? 哈哈,今天晚上12:00魔兽世界公测 时光如梭 深圳抵制日※货※游※行 CWOW客户端首发 3C 3ds max CPU的另类用法
from max sdk
ChenA · 2005-04-07 · via 博客园 - ChenA

解决了一些关于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,你真强。