File: display.r

package info (click to toggle)
mccode 3.5.19%2Bds5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,113,256 kB
  • sloc: ansic: 40,697; python: 25,137; yacc: 8,438; sh: 5,405; javascript: 4,596; lex: 1,632; cpp: 742; perl: 296; lisp: 273; makefile: 226; fortran: 132
file content (37 lines) | stat: -rwxr-xr-x 827 bytes parent folder | download
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
# built-in packages (tested with R v2.15.0)
require(utils)

# OpenGL for R (tested with rgl v0.92.880)
require(rgl)


.First <- function() {
  csvComps = commandArgs()[2]
  csvLines = commandArgs()[3]

  ## parse components
  tbl <- read.csv(csvComps)
  ## parse instrument lines
  lns <- read.csv(csvLines)

  ## prepare the OpenGL renderer
  rgl.open()
  rgl.clear()

  ## plot instrument names
  ## rgl.texts(tbl$x, tbl$y + 0.2, tbl$z, tbl$name, color="green")

  ## plot instrument lines
  rgl.lines(lns, color=lns$c)

  ## setup box around scene
  rgl.bbox(color=c('#333377', 'black'), emission='#333377',
           specular='#3333FF', shininess=5, alpha=0.8)

  ## output as EPS
  rgl.postscript('scene.eps', fmt='eps')

  ## output as WebGL (requires a recent version of rgl)
  ## writeWebGL(dir=file.path("webGL"))

}