Description Usage Arguments Value Examples
piece3d
draws board games pieces using the rgl package.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
piece_side |
A string with piece and side separated by a underscore e.g. "coin_face" |
suit |
Number of suit (starting from 1). |
rank |
Number of rank (starting from 1) |
cfg |
Piecepack configuration list or |
x |
Where to place piece on x axis of viewport |
y |
Where to place piece on y axis of viewport |
z |
z-coordinate of the piece. Has no effect if |
angle |
Angle (on xy plane) to draw piece at |
axis_x |
Ignored for now. |
axis_y |
Ignored for now. |
width |
Width of piece |
height |
Height of piece |
depth |
Depth (thickness) of piece. Has no effect if |
envir |
Environment (or named list) containing configuration list(s). |
... |
Ignored. |
scale |
Multiplicative scaling factor to apply to width, height, and depth. |
res |
Resolution of the faces. |
A numeric vector of rgl object IDs.
1 2 3 4 5 6 7 8 9 10 |
if (require("rgl")) {
rgl.open()
cfg <- pp_cfg()
piece3d("tile_face", suit = 3, rank = 3, cfg = cfg, x = 0, y = 0, z = 0)
piece3d("coin_back", suit = 4, rank = 2, cfg = cfg, x = 2, y = 0, z = 0)
piece3d("saucer_back", suit = 1, cfg = cfg, x = 2, y = 2, z=-2)
piece3d("pawn_face", suit = 2, cfg = cfg, x = 1, y = 1, z = 2)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.