A Model is a drawable object loaded from a 3D file format. The supported 3D file formats are OBJ, glTF, and STL.

Constructors a new Model.
lovr.headset.newModelGet a Model for a device.


Model:getAABBGet the Model's axis aligned bounding box.
Model:animateApply an animation to the pose of the Model.
Model:getAnimationCountGet the number of animations in the Model.
Model:getAnimationDurationGet the duration of an animation in the Model.
Model:getAnimationNameGet the name of an animation in the Model.
Model:drawDraw the Model.
Model:hasJointsCheck if a Model has joints.
Model:getMaterialGet a Material from the Model.
Model:getMaterialCountGet the number of materials in the Model.
Model:getMaterialNameGet the name of a material in the Model.
Model:getNodeCountGet the number of nodes in the Model.
Model:getNodeNameGet the name of a node in the Model.
Model:getNodePoseGet the pose of a single node.
Model:poseSet the pose of a single node, or clear the pose.


local model

function lovr.load()
  model ='assets/model.gltf', 'assets/texture.png')

function lovr.draw()
  model:draw(0, 1, -1, 1, lovr.timer.getTime())

See also