-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
53 lines (39 loc) · 1.82 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
title: "Interactive Voxels Rendering"
---
[![Build Status](https://travis-ci.org/javierluraschi/pins.svg?branch=master)](https://travis-ci.org/javierluraschi/pins) [![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/pins)](https://cran.r-project.org/package=pins) ![](https://img.shields.io/badge/lifecycle-experimental-red.svg)
The [voxels](https://github.com/javierluraschi/voxels) is under-development R package that provides interacte voxels rendering.
## Installation
Install the package as follows:
```{r eval=FALSE}
install.packages("remotes")
remotes::install_github("javierluraschi/voxels")
```
## Getting Started
You can easily launch a voxel explorer and editor,
```{r fig.height=7, fig.width=9}
voxels::voxels()
```
pass your own 3D matrix to render voxels from it,
```{r fig.width=9}
voxels::voxels(array(c(
0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1,
0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1,
0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1,
0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1,
0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1,
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
), dim=c(19, 5, 2)), offset = c(-10, 0, 0))
```
or use many interesting R packages to perform interactive visualizations. For instance, we can add some perlin noise to simulate terrain generation:
```{r fig.width=9}
library(magrittr)
set.seed(123245)
ceiling(ambient::noise_perlin(c(20, 6, 20)) * 10) %>%
voxels::voxels(offset = c(-20, 0, -20))
```
Please note that this package is still under-development!