Skip to content
On this page

OBJLoader

This component allows you to load and display 3D models in the .obj file format.

<OBJLoader> behaves as a <Group>.

Example

Props

Prop nameDescriptionTypeDefault
castShadow Whether the object gets rendered into shadow map.booleanfalse
enableRaycastingComponent will emit mouse events when raycasting is enabledbooleanfalse
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.booleanfalse
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 namePropertiesDescription
loadgroup Group - An instance of THREE.GroupEmitted when OBJ file is successfuly loaded, parsed and added to the scene.
progressEmmited on XHR progress
errorEmitted on XHR error or OBJ parsing error

Slots

NameDescriptionBindings
default

Expose

three

Exposes THREE.Group entity containing Mesh[] loaded by the OBJLoader


Released under the MIT License.