查找纹理坐标 UVW 的例子
macroScript FindingUVCoord category:"WJL"
(
--重置场景
resetMaxFile #noprompt
s = sphere material:(standardMaterial diffuseMap:(checker()))
showTextureMap s.material s.material.diffuseMap on
-- 添加一个修改器
addModifier s (normalModifier())
r = ray [-100,5,0] (s.center-[-100,5,0])
-- 获取相交的详细信息
arr = (intersectRayEx s r)
-- 再交点处创建一个dummy
dummy pos:(arr[1]).pos
-- 获取纹理面
tf = getTVFace s arr[2]
-- 获取面的UVW
tv1 = getTVert s tf.x
tv2 = getTVert s tf.y
tv3 = getTVert s tf.z
-- 删除修改器
deleteModifier s 1
)