OBJLoader
This component allows you to load and display 3D models in the .obj
file format.
<OBJLoader>
behaves as a <Group>
.
Example
Props
Prop name | Description | Type | Default |
---|---|---|---|
castShadow | Whether the object gets rendered into shadow map. | boolean | false |
enableRaycasting | Component will emit mouse events when raycasting is enabled | boolean | false |
name | Name of the Group. | string | "" |
onClick | Callback to be fired when Group content clicked. | TSFunctionType | () => null |
onMouseMove | Callback to be fired when mouse-moving over Group content. | TSFunctionType | () => null |
onMouseEnter | Callback to be fired when Group content entered by mouse. | TSFunctionType | () => null |
onMouseLeave | Callback to be fired when Group content left by mouse. | TSFunctionType | () => null |
position | A Vector3Like representing the object's local position. | Vector3Like | [0, 0, 0] |
receiveShadow | Whether the material receives shadows. | boolean | false |
rotation | A Vector3Like representing local rotation (see Euler angles), in radians. | Vector3Like | [0, 0, 0] |
scale | A Vector3Like representing the object's local scale. | Vector3Like | [1, 1, 1] |
url | A string containing the path/URL of the .obj file. | string |
Events
Event name | Properties | Description |
---|---|---|
load | group Group - An instance of THREE.Group | Emitted when OBJ file is successfuly loaded, parsed and added to the scene. |
progress | Emmited on XHR progress | |
error | Emitted on XHR error or OBJ parsing error |
Slots
Name | Description | Bindings |
---|---|---|
default |
Expose
three
Exposes
THREE.Group
entity containing Mesh[] loaded by theOBJLoader