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

推荐订阅源

G
Google Developers Blog
D
Docker
Stack Overflow Blog
Stack Overflow Blog
GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence
H
Help Net Security
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
L
LangChain Blog
MongoDB | Blog
MongoDB | Blog
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
SegmentFault 最新的问题
博客园 - 司徒正美
C
Check Point Blog
B
Blog
Y
Y Combinator Blog
Microsoft Azure Blog
Microsoft Azure Blog
P
Proofpoint News Feed
F
Fortinet All Blogs
美团技术团队
D
DataBreaches.Net

博客园 - 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,你真强。