限制锥角
limitingConeAngle
属性表示聚光灯轴(即光源到其指向点的轴)与聚光灯圆锥体之间的角度(以度为单位)。因此,它定义了一个限制区域,该区域限制了光线的投射范围。圆锥体外部不会投射光线。
你可以将此属性与以下 SVG 元素一起使用
示例
html
<svg viewBox="0 0 480 200" xmlns="http://www.w3.org/2000/svg">
<filter id="spotLight1" x="0" y="0" width="100%" height="100%">
<feDiffuseLighting diffuseConstant="2">
<feSpotLight
x="10"
y="10"
z="50"
pointsAtX="100"
pointsAtY="100"
limitingConeAngle="10" />
</feDiffuseLighting>
</filter>
<filter id="spotLight2" x="0" y="0" width="100%" height="100%">
<feDiffuseLighting diffuseConstant="2">
<feSpotLight
x="10"
y="10"
z="50"
pointsAtX="100"
pointsAtY="100"
limitingConeAngle="40" />
</feDiffuseLighting>
</filter>
<rect x="0" y="0" width="200" height="200" filter="url(#spotLight1)" />
<rect x="220" y="0" width="200" height="200" filter="url(#spotLight2)" />
</svg>
用法说明
值 | <number> |
---|---|
默认值 | 0 |
可动画的 | 是 |
规范
规范 |
---|
滤镜效果模块第 1 级 # element-attrdef-fespotlight-limitingconeangle |
浏览器兼容性
加载中…