| pig | R Documentation |
Builds an earless, low-poly mesh pig from compact data included in rayrender. The skiing outfit includes goggles, a scarf and skis; the spider variant has eight legs, four eyes and procedural copper-colored hair curves.
pig(
x = 0,
y = 0,
z = 0,
emotion = "neutral",
spider = FALSE,
angle = c(0, 0, 0),
order_rotation = c(1, 2, 3),
scale = c(1, 1, 1),
diffuse_sigma = 0,
ski = FALSE,
hair_count = 12000,
hair_length = 1,
hair_seed = 8,
hair_material = NULL
)
x |
Default |
y |
Default |
z |
Default |
emotion |
Default |
spider |
Default |
angle |
Default |
order_rotation |
Default |
scale |
Default |
diffuse_sigma |
Default |
ski |
Default |
hair_count |
Default |
hair_length |
Default |
hair_seed |
Default |
hair_material |
Default |
Geometry, expression heads and the ski pose are assembled in memory;
no OBJ paths, downloads, Blender or rgl installation are required. The
character faces +X, uses Y up, and retains the rotation/scale pivot at
c(0, 1, 0). Feet or skis rest approximately at y - 0.6 before rotation
and scaling. The mask and goggles can obscure eyebrows in skiing poses.
Hair uses tapered bezier_curve() objects with hair() materials. A
finite bounce limit, such as max_depth = 12, is useful for dense fur.
A scene tibble containing mesh objects and, for a hairy spider, curves.
generate_ground(depth = -0.6) |>
add_object(pig()) |>
render_scene(lookfrom = c(8, 5, 8), lookat = c(0, 1, 0), samples = 64)
generate_ground(depth = -0.6, material = glossy(color="white")) |>
add_object(pig(ski = TRUE)) |>
render_scene(lookfrom = c(8, 5, 8),
lookat = c(0, 1, 0),
fov=40,samples = 64)
generate_ground(depth = -0.6) |>
add_object(pig(spider = TRUE)) |>
render_scene(lookfrom = c(10, 7, 8), lookat = c(0, 1, 0),
samples = 64, max_depth = 12)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.