[도구 R과 3D 그래픽스] 1. rgl 패키지
R에서 OPEN GL을 사용할 수 있는 패키지가 있습니다. OPEN GL은 open graphics library 의 줄임말입니다. 2D, 3D 랜더링을 해주는 라이브러리입니다.
어떤 방향으로 공부할까 고민하다가, STL 파일을 다루는 것으로 방향을 잡았습니다. STL파일을 불러오고, 수정하고, 치수를 측정하고, 자르는 등의 작업을 해볼 생각입니다.
먼저 패키지를 설치하고, 패키지 안의 함수들을 간단하게 살펴봅시다.
패키지는 rgl 입니다. 설치합시다.
install.packages("rgl")
패키지 안의 함수를 보는 명령어는 아래와 같습니다 .
ls("package:rgl")
총 208개의 함수가 있습니다. 궁금한 함수가 있으면, 함수 앞에 물음표를 추가하여 콘솔창에 입력하면 help에 설명이 나옵니다.
> ls("package:rgl")
[1] "%>%"
[2] "abclines3d"
[3] "addNormals"
[4] "addToSubscene3d"
[5] "ageControl"
[6] "ageSetter"
[7] "arc3d"
[8] "arrow3d"
[9] "as.mesh3d"
[10] "as.triangles3d"
[11] "asEuclidean"
[12] "asHomogeneous"
[13] "aspect3d"
[14] "asRow"
[15] "axes3d"
[16] "axis3d"
[17] "bbox3d"
[18] "bg3d"
[19] "bgplot3d"
[20] "box3d"
[21] "clear3d"
[22] "clearSubsceneList"
[23] "clipMesh3d"
[24] "clipplaneControl"
[25] "clipplanes3d"
[26] "clipplaneSlider"
[27] "cube3d"
[28] "cuboctahedron3d"
[29] "currentSubscene3d"
[30] "cylinder3d"
[31] "decorate3d"
[32] "deform.mesh3d"
[33] "delFromSubscene3d"
[34] "divide.mesh3d"
[35] "dodecahedron3d"
[36] "dot3d"
[37] "elementId2Prefix"
[38] "ellipse3d"
[39] "extrude3d"
[40] "figHeight"
[41] "figWidth"
[42] "gc3d"
[43] "getr3dDefaults"
[44] "getWidgetId"
[45] "GramSchmidt"
[46] "grid3d"
[47] "highlevel"
[48] "hook_rgl"
[49] "hook_webgl"
[50] "icosahedron3d"
[51] "identify3d"
[52] "identityMatrix"
[53] "layout3d"
[54] "legend3d"
[55] "light3d"
[56] "lines3d"
[57] "lowlevel"
[58] "material3d"
[59] "matrixSetter"
[60] "mergeVertices"
[61] "mfrow3d"
[62] "movie3d"
[63] "mtext3d"
[64] "newSubscene3d"
[65] "next3d"
[66] "normalize.mesh3d"
[67] "observer3d"
[68] "octahedron3d"
[69] "oh3d"
[70] "open3d"
[71] "par3d"
[72] "par3dinterp"
[73] "par3dinterpControl"
[74] "par3dinterpSetter"
[75] "particles3d"
[76] "pch3d"
[77] "persp3d"
[78] "planes3d"
[79] "play3d"
[80] "playwidget"
[81] "playwidgetOutput"
[82] "plot3d"
[83] "plotmath3d"
[84] "points3d"
[85] "polygon3d"
[86] "pop3d"
[87] "propertyControl"
[88] "propertySetter"
[89] "propertySlider"
[90] "qmesh3d"
[91] "quads3d"
[92] "r3dDefaults"
[93] "readOBJ"
[94] "readSTL"
[95] "registerSceneChange"
[96] "renderPlaywidget"
[97] "renderRglwidget"
[98] "rgl.abclines"
[99] "rgl.attrib"
[100] "rgl.attrib.count"
[101] "rgl.attrib.info"
[102] "rgl.bbox"
[103] "rgl.bg"
[104] "rgl.bringtotop"
[105] "rgl.clear"
[106] "rgl.clipplanes"
[107] "rgl.close"
[108] "rgl.cur"
[109] "rgl.dev.list"
[110] "rgl.getMouseCallbacks"
[111] "rgl.getWheelCallback"
[112] "rgl.ids"
[113] "rgl.init"
[114] "rgl.light"
[115] "rgl.lines"
[116] "rgl.linestrips"
[117] "rgl.material"
[118] "rgl.open"
[119] "rgl.pixels"
[120] "rgl.planes"
[121] "rgl.points"
[122] "rgl.pop"
[123] "rgl.postscript"
[124] "rgl.primitive"
[125] "rgl.projection"
[126] "rgl.quads"
[127] "rgl.quit"
[128] "rgl.select"
[129] "rgl.select3d"
[130] "rgl.set"
[131] "rgl.setMouseCallbacks"
[132] "rgl.setWheelCallback"
[133] "rgl.snapshot"
[134] "rgl.spheres"
[135] "rgl.sprites"
[136] "rgl.surface"
[137] "rgl.Sweave"
[138] "rgl.Sweave.off"
[139] "rgl.texts"
[140] "rgl.triangles"
[141] "rgl.useNULL"
[142] "rgl.user2window"
[143] "rgl.viewpoint"
[144] "rgl.window2user"
[145] "rglFonts"
[146] "rglId"
[147] "rglMouse"
[148] "rglShared"
[149] "rglToBase"
[150] "rglToLattice"
[151] "rglwidget"
[152] "rglwidgetOutput"
[153] "rotate3d"
[154] "rotationMatrix"
[155] "scale3d"
[156] "scaleMatrix"
[157] "scene3d"
[158] "sceneChange"
[159] "segments3d"
[160] "select3d"
[161] "selectpoints3d"
[162] "setupKnitr"
[163] "setUserShaders"
[164] "shade3d"
[165] "shapelist3d"
[166] "shinyGetPar3d"
[167] "shinySetPar3d"
[168] "show2d"
[169] "snapshot3d"
[170] "spheres3d"
[171] "spin3d"
[172] "sprites3d"
[173] "subdivision3d"
[174] "subsceneInfo"
[175] "subsceneList"
[176] "subsetControl"
[177] "subsetSetter"
[178] "subsetSlider"
[179] "surface3d"
[180] "Sweave.snapshot"
[181] "terrain3d"
[182] "tetrahedron3d"
[183] "text3d"
[184] "texts3d"
[185] "thigmophobe3d"
[186] "title3d"
[187] "tkpar3dsave"
[188] "tkspin3d"
[189] "tkspinControl"
[190] "tmesh3d"
[191] "toggleButton"
[192] "toggleWidget"
[193] "transform3d"
[194] "translate3d"
[195] "translationMatrix"
[196] "triangles3d"
[197] "triangulate"
[198] "turn3d"
[199] "useSubscene3d"
[200] "vertexControl"
[201] "vertexSetter"
[202] "view3d"
[203] "wire3d"
[204] "writeASY"
[205] "writeOBJ"
[206] "writePLY"
[207] "writeSTL"
[208] "writeWebGL"
패키지 버전은 아래와 같습니다.
> packageVersion("rgl")
[1] ‘0.100.54’
'R 주제 > 3D그래픽스' 카테고리의 다른 글
[도구 R과 3D 그래픽스] 4. stl 파일 여는 방법 (0) | 2020.08.13 |
---|---|
[도구 R과 3D 그래픽스] 3. 표면을 그려주는 persp3d함수 (0) | 2020.08.12 |
[도구 R과 3D 그래픽스] 2. 점을 그려주는 plot3d 함수 (0) | 2020.08.12 |
댓글