Load an PLY file via a filepath. Note: light importance sampling currently not supported for this shape.

ply_model(
  filename,
  x = 0,
  y = 0,
  z = 0,
  scale_ply = 1,
  material = diffuse(),
  angle = c(0, 0, 0),
  order_rotation = c(1, 2, 3),
  flipped = FALSE,
  scale = c(1, 1, 1)
)

Arguments

filename

Filename and path to the `ply` file. Can also be a `txt` file, if it's in the correct `ply` internally.

x

Default `0`. x-coordinate to offset the model.

y

Default `0`. y-coordinate to offset the model.

z

Default `0`. z-coordinate to offset the model.

scale_ply

Default `1`. Amount to scale the model. Use this to scale the object up or down on all axes, as it is more robust to numerical precision errors than the generic scale option.

material

Default diffuse.The material, called from one of the material functions diffuse, metal, or dielectric.

angle

Default `c(0, 0, 0)`. Angle of rotation around the x, y, and z axes, applied in the order specified in `order_rotation`.

order_rotation

Default `c(1, 2, 3)`. The order to apply the rotations, referring to "x", "y", and "z".

flipped

Default `FALSE`. Whether to flip the normals.

scale

Default `c(1, 1, 1)`. Scale transformation in the x, y, and z directions. If this is a single value, number, the object will be scaled uniformly. Note: emissive objects may not currently function correctly when scaled.

Value

Single row of a tibble describing the obj model in the scene.

Examples

#See the documentation for `obj_model()`--no example PLY models are included with this package,
#but the process of loading a model is the same (without support for vertex colors).