texture

概要

  • 纹理(texturePath)

参数

  1. texturePath –字符串
    要插入的纹理文件的名称。有关内置纹理列表的搜索位置和内置资源的信息,请参阅 资产搜索纹理必需品中列出了支持的图像格式 。

描述

纹理操作使用指定的文件texturePath来纹理当前形状(颜色映射信道)。“texture”命令是“ set(material.colormap,..)” 的简化版本。“texture”命令不会创建纹理坐标。

有关

例子

brickMap = "assets/bricks.jpg"
randBuildingHeight = rand(3,20)

Lot -->
s('.75,'1,'.75)
center(xz)
extrude(world.up, randBuildingHeight)
comp(f) {side : Facade 
        | top : set(material.color.a, .3) 
                Roof.}

Facade -->
	# color, uv set 0
	setupProjection(0, scope.xy, 5, 5)
	texture(brickMap)
	// = set(material.colormap,brickMap)
	projectUV(0)
与砖纹理的形状

Was this article helpful?

Leave A Comment?

You must be logged in to post a comment.