API

属性

proptypedefaultexample
srcstring-'./exapmle.obj'
widthnumber-300
heightnumber-300
positionobject{ x: 0, y: 0, z: 0 }{ x: 100, y: 20, z: -10 }
rotationobject{ x: 0, y: 0, z: 0 }{ x: Math.PI / 2, y: 0, z: - Math.PI / 4 }
cameraPositionobject{ x: 0, y: 0, z: 0 }{ x: 1, y: 2, z: -3 }
cameraRotationobject{ x: 0, y: 0, z: 0 }{ x: 3, y: 2, z: -1 }
scaleobject{ x: 1, y: 1, z: 1 }{ x: 2, y: 2, z: 3 }
lightsarray-
backgroundColornumber/string0xffffff0xffffff/'#f00'/'rgb(255,255,255)'
backgroundAlphanumber10.5
controlsOptionsobject-see OrbitControls Propertiesopen in new window
crossOriginstringanonymousanonymous/use-credentials
requestHeaderobject-{ 'Authorization: Bearer token' }
outputEncodingnumberTHREE.LinearEncodingsee WebGLRenderer OutputEncodingopen in new window
glOptionsobject{ antialias: true, alpha: true }see WebGLRenderer Parametersopen in new window

事件

event
mousedown
mousemove
mouseup
click
load
progress
error

插槽

slots
progress-bar
poster
Last Updated:
Contributors: Jiulong Hu