材质属性
# 材质属性
在真实世界里,每个物体会对光产生不同的反应。钢看起来比陶瓷花瓶更闪闪发光,一个木头箱子不会像钢箱子一样对光产生很强的反射。每个物体对镜面高光也有不同的反应。有些物体不会散射(Scatter)很多光却会反射(Reflect)很多光,结果看起来就有一个较小的高光点(Highlight),有些物体散射了很多,它们就会产生一个半径更大的高光。如果我们想要在 OpenGL 中模拟多种类型的物体,我们必须为每个物体分别定义材质(Material)属性。
# Joint3d.ColorMaterialProperty
颜色材质
# example
let material = new Joint3d.ColorMaterialProperty(Joint3d.Color.RED)
# creation
constructor(color)
构造函数
- 参数
{Joint3d.Color} color
:颜色
- 返回值
material
- 参数
# Joint3d.ImageMaterialProperty
图片材质
# example
let material = new Joint3d.ImageMaterialProperty({
image: '**/**.png',
transparent: true,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
material
- 参数
// 属性参数(可选)
{
"image": "", // 图片地址
"repeat": { "x": 1, "y": 1 }, // 图片重复
"color": Joint3d.Color.WHITE, // 图片颜色
"transparent": false // 材质是否透明
}
# properties
{String} image
:图片地址{Object} repeat
:图片重复{Joint3d.Color} color
:图片颜色{Boolean} transparent
:材质是否透明
# Joint3d.CircleBlurMaterialProperty
模糊圆材质
# example
let material = new Joint3d.CircleBlurMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10 // 速度
}
# properties
{Joint3d.Color} color
:颜色{Number} speed
:速度
# Joint3d.CircleDiffuseMaterialProperty
扩散圆材质
# example
let material = new Joint3d.CircleDiffuseMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10 // 速度
}
# properties
{Joint3d.Color} color
:颜色{Number} speed
:速度
# Joint3d.CircleFadeMaterialProperty
逐渐消逝圆材质
# example
let material = new Joint3d.CircleFadeMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10 // 速度
}
# properties
{Joint3d.Color} color
:颜色{Number} speed
:速度
# Joint3d.CirclePulseMaterialProperty
脉冲圆材质
# example
let material = new Joint3d.CirclePulseMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10 // 速度
}
# properties
{Joint3d.Color} color
:颜色{Number} speed
:速度
# Joint3d.CircleScanMaterialProperty
扫描圆材质
# example
let material = new Joint3d.CircleScanMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10 // 速度
}
# properties
{Joint3d.Color} color
:颜色{Number} speed
:速度
# Joint3d.CircleSpiralMaterialProperty
螺旋圆材质
# example
let material = new Joint3d.CircleSpiralMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10 // 速度
}
# properties
{Joint3d.Color} color
:颜色{Number} speed
:速度
# Joint3d.CircleVaryMaterialProperty
多彩圆材质
# example
let material = new Joint3d.CircleVaryMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性- 返回值
materialProperty
- 返回值
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10 // 速度
}
# properties
{Joint3d.Color} color
:颜色{Number} speed
:速度
# Joint3d.CircleWaveMaterialProperty
波纹圆材质
# example
let material = new Joint3d.CircleWaveMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10, // 速度
"count": 5, //数量
"gradient": 0.1 //强度
}
# properties
{Color} color
:颜色{Number} speed
:速度{Number} count
:数量{Number} gradient
:强度
# Joint3d.EllipsoidElectricMaterialProperty
电弧球材质
# example
let material = new Joint3d.EllipsoidElectricMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10 // 速度
}
# properties
{Joint3d.Color} color
:颜色{Number} speed
:速度
# Joint3d.EllipsoidTrailMaterialProperty
轨迹球材质
# example
let material = new Joint3d.EllipsoidTrailMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10 // 速度
}
# properties
{Joint3d.Color} color
:颜色{Number} speed
:速度
# Joint3d.PolylineDashMaterialProperty
虚线材质
# example
let material = new Joint3d.PolylineDashMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 虚线颜色
"gapColor": Joint3d.Color.TRANSPARENT, // 间隔颜色
"dashLength": 16.0 // 虚线片段长度
}
# properties
{Joint3d.Color} color
:虚线颜色{Joint3d.Color} gapColor
:间隔颜色{Number} dashLength
:虚线片段长度
# Joint3d.PolylineArrowMaterialProperty
箭头材质
# example
let material = new Joint3d.PolylineArrowMaterialProperty(Joint3d.Color.WHITE)
# creation
constructor(color)
构造函数
- 参数
{Joint3d.Color} color
:箭头颜色
- 返回值
materialProperty
- 参数
# properties
{Joint3d.Color} color
:箭头颜色
# Joint3d.PolylineOutlineMaterialProperty
边线材质
# example
let material = new Joint3d.PolylineOutlineMaterialProperty({
color: Joint3d.Color.WHITE,
outlineColor: Joint3d.Color.BLACK,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"outlineColor": Joint3d.Color.BLACK, // 边线颜色
"outlineWidth": 1 // 边线宽度
}
# properties
{Joint3d.Color} color
:颜色{Joint3d.Color} outlineColor
:边线颜色{Number} outlineWidth
:边线宽度
# Joint3d.PolylineGlowMaterialProperty
光晕材质
# example
let material = new Joint3d.PolylineGlowMaterialProperty({
color: Joint3d.Color.WHITE,
glowPower: 0.25,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"glowPower": 0.25, // 发光强度,以总线宽的百分比表示
"taperPower": 1 // 渐缩效果的强度
}
# properties
{Joint3d.Color} color
:颜色{Number} glowPower
:发光强度{Number} taperPower
:渐缩效果的强度
# Joint3d.PolylineFlickerMaterialProperty
闪烁线材质
# example
let material = new Joint3d.PolylineFlickerMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10 // 速度
}
# properties
{Joint3d.Color} color
:颜色{Number} speed
:速度
# Joint3d.PolylineFlowMaterialProperty
流动线材质
# example
let material = new Joint3d.PolylineFlowMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10, // 速度,
"percent": 0.3, // 比例
"gradient": 0.1 // 透明程度
}
# properties
{Joint3d.Color} color
:颜色{Number} speed
:速度{Number} percent
:比例,{Number} gradient
:透明程度,
# Joint3d.PolylineImageTrailMaterialProperty
图片轨迹线材质
# example
let material = new Joint3d.PolylineImageTrailMaterialProperty({
color: Joint3d.Color.WHITE,
image: '**/*.png',
repeat: { x: 10, y: 1 },
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10, // 速度
"image": "**/*.png", // 图片地址
"repeat": { "x": 10, "y": 1 } //重复规则
}
# properties
{Joint3d.Color} color
:颜色{Number} speed
:速度{String} image
:图片地址{Object} repeat
:重复规则
# Joint3d.PolylineLightingMaterialProperty
发光线材质
# example
let material = new Joint3d.PolylineLightingMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE // 颜色
}
# properties
{Joint3d.Color} color
:颜色
# Joint3d.PolylineLightingTrailMaterialProperty
颜色轨迹线材质
# example
let material = new Joint3d.PolylineLightingTrailMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10 // 速度
}
# properties
{Joint3d.Color} color
:颜色{Number} speed
:速度
# Joint3d.PolylineTrailMaterialProperty
颜色轨迹线材质
# example
let material = new Joint3d.PolylineTrailMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10 // 速度
}
# properties
{Joint3d.Color} color
:颜色{Number} speed
:速度
# Joint3d.RadarLineMaterialProperty
雷达线材质
# example
let material = new Joint3d.RadarLineMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10 // 速度
}
# properties
{Joint3d.Color} color
:颜色{Number} speed
:速度
# Joint3d.RadarWaveMaterialProperty
波纹雷达材质
# example
let material = new Joint3d.RadarWaveMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10 // 速度
}
# properties
{Joint3d.Color} color
:颜色{Number} speed
:速度
# Joint3d.WallImageTrailMaterialProperty
图片轨迹墙体材质
# example
let material = new Joint3d.WallImageTrailMaterialProperty({
color: Joint3d.Color.WHITE,
image: '**/*.png',
repeat: { x: 10, y: 1 },
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10, // 速度
"image": "**/*.png", // 图片地址
"repeat": { "x": 10, "y": 1 } //重复规则
}
# properties
{Joint3d.Color} color
:颜色{Number} speed
:速度{String} image
:图片地址{Object} repeat
:重复规则
# Joint3d.WallTrailMaterialProperty
流动墙材质
# example
let material = new Joint3d.WallTrailMaterialProperty({
color: Joint3d.Color.WHITE,
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"color": Joint3d.Color.WHITE, // 颜色
"speed": 10 // 速度
}
# properties
{Joint3d.Color} color
:颜色{Number} speed
:速度
# Joint3d.WaterMaterialProperty
流动水材质
# example
let material = new Joint3d.WaterMaterialProperty({
baseWaterColor: Joint3d.Color.WHITE,
normalMap: '**/**.png',
})
# creation
constructor([options])
构造函数
- 参数
{Object} options
:属性
- 返回值
materialProperty
- 参数
// 属性参数(可选)
{
"baseWaterColor": Joint3d.Color.WHITE, // 水体颜色
"blendColor": Joint3d.Color.WHITE, // 混合颜色
"specularMap": "", // 镜面图
"normalMap": "", // 法线图
"frequency": 1000, //波纹数量
"animationSpeed": 0.03, // 动画速度
"amplitude": 10, //水波振幅
"specularIntensity": 10 //镜面反射强度
}
# properties
{Joint3d.Color} baseWaterColor
:颜色{Joint3d.Color} blendColor
:混合颜色{String} normalMap
:法线图{String} specularMap
:镜面图