LlScaleTexture

来自人工智能助力教育知识百科
跳转至: 导航搜索

Template:Needs Translation/


函数名
Function: llScaleTexture( float u, float v, integer face );
参数:• float u – 区间[-100.0,100.0]的水平(x)尺度

• float v – 区间内垂直(y)尺度[-100.0,100.0]

• integer face – 面号或所有面

返回值:为选择的面设置纹理u和v的比例。

如果面是ALL_SIDES,那么函数对所有面都起作用。

注意事项
这个函数使脚本休眠0.2秒。

如果该函数的面值表示一个不存在的面值,则该函数将悄无声息地失败。

 Specification
 在默认的纹理映射模式下,缩放单位是每个面的纹理重复。在平面纹理映射模式中,尺度单位是每半米的纹理重复。这与世界编辑工具形成了对比,在世界编辑工具中,平面纹理缩放单位是每米重复的。
示例
示例1
// WARNING:
//      llScaleTexture有200毫秒的延迟
//      这意味着每次在脚本中调用该函数将花费0.2秒
//      例如,下面的脚本大约需要1.2秒……那真的很慢!!
//
//      为了解决这个问题,可以使用下面的方法:
//
//
//
//      llSetLinkPrimitiveParamsFast(integer link,
//          [PRIM_TEXTURE, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians]);
 
 
// *******************************************************************************************************************
 
 
 
//Scales the textures on 6 sides
float scale;
 
default
{
    state_entry()
    {
        integer index;
        while (index < 7)
        {
            scale += 0.1;
            llScaleTexture((float)scale, (float)scale, index);
 
            ++index;
        }
    }
}
 
// output:
//      face 0 >> 0.1
//      face 1 >> 0.2
//      face 2 >> 0.3
//      face 3 >> 0.4
//      face 4 >> 0.5
//      face 5 >> 0.6
//      face 6 >> 0.7
相关函数
llGetTextureScale
相关事件