## From \$ROOTSYS/tutorials/geom/robot.C

```#include "TGeoManager.h"

void robot()
{
// Drawing a famous Korean robot, TaekwonV, using ROOT geometry class.
// Name: robot.C
// Author: Jin Hui Hwang, Dept. of Physics, Univ. of Seoul
// Reviewed by Sunman Kim (sunman98@hanmail.net)
// Supervisor: Prof. Inkyu Park (icpark@physics.uos.ac.kr)
//
// How to run: .x robot.C in ROOT terminal, then use OpenGL
//
// This macro was created for the evaluation of Computational Physics course in 2006.
// We thank to Prof. Inkyu Park for his special lecture on ROOT and to all of ROOT team
//

TGeoManager *Robot = new TGeoManager("Robot","This is Taegwon V");

TGeoMaterial *vacuum=new TGeoMaterial("vacuum",0,0,0);
TGeoMaterial *Fe=new TGeoMaterial("Fe",55.845,26,7.87);

TGeoMedium *Air=new TGeoMedium("Vacuum",0,vacuum);
TGeoMedium *Iron=new TGeoMedium("Iron",1,Fe);

// create volume

TGeoVolume *top=Robot->MakeBox("top",Air,1000,1000,1000);
Robot->SetTopVolume(top);
Robot->SetTopVisible(0);
// If you want to see the boundary, please input the number, 1 instead of 0.
// Like this, geom->SetTopVisible(1);

TGeoVolume *Band=Robot->MakeEltu("Band",Iron,20,20,2.5);
Band->SetLineColor(12);
Band->SetFillColor(12);
TGeoVolume *Band_b=Robot->MakeSphere("Band_b",Iron,0,2,0,180,180,360);
Band_b->SetLineColor(2);
Band_b->SetFillColor(2);
TGeoVolume *Horn=Robot->MakeSphere("Horn",Iron,0,10,60,180,240,300);

float Phi = 3.14;
int N = 10;

for (int i=0; i<=N;i++){
new TGeoRotation("R1",-90+(360/N*i),-90,90)));
}

char name[50];
float pcs = 30;
for (int i=1; i<pcs; i++){
sprintf(name,"Horn%d",i);
Horn=Robot->MakeSphere(name,Iron,
10- 10/pcs*i ,10,180-(120/pcs)*i,180-((120/pcs) * (i-1)),240,300);
Horn->SetLineColor(2);
Horn->SetFillColor(2);
}

// face
TGeoVolume *Migan=Robot->MakeGtra("Migan",Iron,3,0,0,0,3,2,11,0,3,3,11,0);
Migan->SetLineColor(17);
Migan->SetFillColor(17);
TGeoVolume *Ko=Robot->MakeGtra("Ko",Iron,7,0,0,0,3,1,5,0,3,2,5,0);
Ko->SetLineColor(17);
Ko->SetFillColor(17);
TGeoVolume *Ko_m=Robot->MakeBox("Ko_m",Iron,2,8,4);
Ko_m->SetLineColor(17);
Ko_m->SetFillColor(17);
TGeoVolume *Bol_1=Robot->MakeBox("Bol_1",Iron,7,5.5,7);
Bol_1->SetLineColor(17);
Bol_1->SetFillColor(17);
TGeoVolume *Bol_2=Robot->MakeGtra("Bol_2",Iron,1,0,0,0,7,0,9,0,7,0,9,0);
Bol_2->SetLineColor(17);
Bol_2->SetFillColor(17);
TGeoVolume *Noon=Robot->MakeBox("Noon",Iron,1,10,5);
Noon->SetLineColor(12);
Noon->SetFillColor(12);
TGeoVolume *Tuck=Robot->MakeBox("Tuck",Iron,2,10,5.5);
Tuck->SetLineColor(2);
Tuck->SetFillColor(2);
TGeoVolume *Tuck_1=Robot->MakeBox("Tuck_1",Iron,2,9,1);
Tuck_1->SetLineColor(2);
Tuck_1->SetFillColor(2);
TGeoVolume *Tuck_2=Robot->MakeBox("Tuck_2",Iron,3,1,14);
Tuck_2->SetLineColor(2);
Tuck_2->SetFillColor(2);
TGeoVolume *Tuck_j=Robot->MakeSphere("Tuck_j",Iron,0,3.5,0,180,0,360);
Tuck_j->SetLineColor(5);
Tuck_j->SetFillColor(5);
TGeoVolume *Ear=Robot->MakeCons("Ear",Iron,1,0,3,0,3,0,360);
Ear->SetLineColor(5);
Ear->SetFillColor(5);
TGeoVolume *Ear_2=Robot->MakeCone("Ear_2",Iron,5,0,0,0,3);
Ear_2->SetLineColor(5);
Ear_2->SetFillColor(5);

// drawing face
for (int i=0; i<10;i++) {
}

for (int i=1; i<28; i+=1) {
float a=i*0.2;
TGeoVolume *Hear=Robot->MakeCons("Hear",Iron,3,13+a,16+a,13+a,16+a,-60-a,60+a);
if (i<27) {
Hear->SetLineColor(12);
Hear->SetFillColor(12);
}
else {
Hear->SetLineColor(2);
Hear->SetFillColor(2);
}
}
for (int i=1; i<28; i+=1) {
float a=i*0.2;
TGeoVolume *Hear=Robot->MakeCons("Hear",Iron,3,13+a,16+a,13+a,16+a,-70-a,-60-a);
Hear->SetLineColor(2);
Hear->SetFillColor(2);
}
for (int i=1; i<28; i+=1) {
float a=i*0.2;
TGeoVolume *Hear=Robot->MakeCons("Hear",Iron,3,13+a,16+a,13+a,16+a,60+a,70+a);
Hear->SetLineColor(2);
Hear->SetFillColor(2);
}

// neck
TGeoVolume *Mock=Robot->MakeTrd2("Mock",Iron,1,1,7,6.5,20);
Mock->SetLineColor(17);
Mock->SetFillColor(17);
TGeoVolume *Mock_1=Robot->MakeTrd2("Mock_1",Iron,1,1,6,5,20);
Mock_1->SetLineColor(17);
Mock_1->SetFillColor(17);
TGeoVolume *Mock_s=Robot->MakeTrd2("Mock_s",Iron,1,1,5,4.5,20);
Mock_s->SetLineColor(17);
Mock_s->SetFillColor(17);

// drawing neck

// chest
TGeoVolume *Gasem=Robot->MakeBox("Gasem",Iron,16,50,20);
Gasem->SetLineColor(12);
Gasem->SetFillColor(12);
TGeoVolume *Gasem_b1=Robot->MakeSphere("Gasem_b1",Iron,0,15,0,180,0,360);
Gasem_b1->SetLineColor(12);
Gasem_b1->SetFillColor(12);
TGeoVolume *Gasem_b2=Robot->MakeSphere("Gasem_b2",Iron,0,13,0,180,0,360);
Gasem_b2->SetLineColor(12);
Gasem_b2->SetFillColor(12);
TGeoVolume *Gasem_1=Robot->MakeEltu("Gasem_1",Iron,13,13,20);
Gasem_1->SetLineColor(12);
Gasem_1->SetFillColor(12);
TGeoVolume *Gasem_2=Robot->MakeEltu("Gasem_2",Iron,13,13,19);
Gasem_2->SetLineColor(12);
Gasem_2->SetFillColor(12);
TGeoVolume *Gasem_3=Robot->MakeCone("Gasem_3",Iron,19,0,13,0,15);
Gasem_3->SetLineColor(12);
Gasem_3->SetFillColor(12);
TGeoVolume *Gasem_4=Robot->MakeEltu("Gasem_4",Iron,15,15,16);
Gasem_4->SetLineColor(12);
Gasem_4->SetFillColor(12);
TGeoVolume *Gasem_5=Robot->MakeEltu("Gasem_5",Iron,13,13,16);
Gasem_5->SetLineColor(12);
Gasem_5->SetFillColor(12);
TGeoVolume *Gasem_m1=Robot->MakeBox("Gasem_m1",Iron,19,19,5);
Gasem_m1->SetLineColor(12);
Gasem_m1->SetFillColor(12);
TGeoVolume *Gasem_m2=Robot->MakeTrd2("Gasem_m2",Iron,13,15,2,2,19);
Gasem_m2->SetLineColor(12);
Gasem_m2->SetFillColor(12);
TGeoVolume *V=Robot->MakeTrd2("V",Iron,2,2,22,30,4);
V->SetLineColor(2);
V->SetFillColor(2);
TGeoVolume *V_m=Robot->MakeBox("V_m",Iron,2,7,1);
V_m->SetLineColor(2);
V_m->SetFillColor(2);

// drawing chest

// abdomen
TGeoVolume *Bea=Robot->MakeEltu("Bea",Iron,20,37,25);
Bea->SetLineColor(17);
Bea->SetFillColor(17);
TGeoVolume *Bea_d=Robot->MakeEltu("Bea_d",Iron,21,36,5);
Bea_d->SetLineColor(12);
Bea_d->SetFillColor(12);
TGeoVolume *Beakop=Robot->MakeEltu("Beakop",Iron,15,25,5);
Beakop->SetLineColor(10);
Beakop->SetFillColor(10);

// drawing abdomen

// Gungdi
TGeoVolume *Gungdi=Robot->MakeEltu("Gungdi",Iron,25,50,18);
Gungdi->SetLineColor(12);
Gungdi->SetFillColor(12);
TGeoVolume *Gungdi_d=Robot->MakeEltu("Gungdi_d",Iron,5,5,5);
Gungdi_d->SetLineColor(2);
Gungdi_d->SetFillColor(2);

// drawing Gungdi
for (int i=0; i<30; i++) {
TGeoVolume *Gungdi_j=Robot->MakeEltu("Gungdi_j",Iron,24-0.2*i,49-0.5*i,1);
Gungdi_j->SetLineColor(12);
Gungdi_j->SetFillColor(12);
}
for (int i=0; i<40; i++) {
if (i<16) {
TGeoVolume *Gungdi_h=Robot->MakeEltu("Gungdi_h",Iron,24-0.1*i,49-0.3*i,1);
Gungdi_h->SetLineColor(12);
Gungdi_h->SetFillColor(12);
}
else {
TGeoVolume *Gungdi_h=Robot->MakeEltu("Gungdi_h",Iron,27-0.3*i,52-0.5*i,1);
Gungdi_h->SetLineColor(12);
Gungdi_h->SetFillColor(12);
}
}

// feet
TGeoVolume *Jang=Robot->MakeEltu("Jang",Iron,18,18,50);
Jang->SetLineColor(17);
Jang->SetFillColor(17);
TGeoVolume *Jong=Robot->MakeEltu("Jong",Iron,22,22,50);
Jong->SetLineColor(12);
Jong->SetFillColor(12);
TGeoVolume *Bal=Robot->MakeSphere("Bal",Iron,0,22,0,180,180,360);
Bal->SetLineColor(12);
Bal->SetFillColor(12);

// drawing Dary
for (int i=0; i<30; i++) {
TGeoVolume *Mu=Robot->MakeCons("Mu",Iron,1,0,22.1,0,22.1,120+2*i,-120-2*i);
Mu->SetLineColor(4);
Mu->SetFillColor(4);

}

// arms
TGeoVolume *S=Robot->MakeSphere("S",Iron,0,25,0,180,180,360);
S->SetLineColor(17);
S->SetFillColor(17);
TGeoVolume *S_1=Robot->MakeSphere("S_1",Iron,0,15,0,180,0,360);
S_1->SetLineColor(17);
S_1->SetFillColor(17);
TGeoVolume *Pal=Robot->MakeEltu("Pal",Iron,15,15,30);
Pal->SetLineColor(17);
Pal->SetFillColor(17);
TGeoVolume *Fal=Robot->MakeEltu("Fal",Iron,17,17,30);
Fal->SetLineColor(4);
Fal->SetFillColor(4);
TGeoVolume *Bbul=Robot->MakeCone("Bbul",Iron,8,0,0,0,5);
Bbul->SetLineColor(17);
Bbul->SetFillColor(17);

// drawing arms

// hands
TGeoVolume *Son_d=Robot->MakeBox("Son_d",Iron,15,15,7);
Son_d->SetLineColor(4);
Son_d->SetFillColor(4);
TGeoVolume *Son_g=Robot->MakeBox("Son_g",Iron,4,10,4);
Son_g->SetLineColor(4);
Son_g->SetFillColor(4);
TGeoVolume *Son_g1=Robot->MakeBox("Son_g1",Iron,6,6,6);
Son_g1->SetLineColor(4);
Son_g1->SetFillColor(4);
TGeoVolume *Son_g2=Robot->MakeBox("Son_g2",Iron,8,3,3);
Son_g2->SetLineColor(4);
Son_g2->SetFillColor(4);
TGeoVolume *Last_b=Robot->MakeCone("Last_b",Iron,10,0,0,0,4);
Last_b->SetLineColor(17);
Last_b->SetFillColor(17);
TGeoVolume *Last=Robot->MakeSphere("Last",Iron,0,3,0,180,0,360);
Last->SetLineColor(2);
Last->SetFillColor(2);

//drawing hands
for (int i=0; i<4; i++) {
}
for (int i=0; i<4; i++) {
}
for (int i=0; i<4; i++) {
}
for (int i=0; i<4; i++) {
}

for (int i=1; i<20; i+=1) {
if (i<7) {
TGeoVolume *Effect=Robot->MakeCons("Effect",Iron,3,20/sin(i),21/sin(i),20/sin(i),21/sin(i),0,70);
Effect->SetLineColor(9);
Effect->SetFillColor(9);
}
if (6<i && i<10) {
TGeoVolume *Effect=Robot->MakeCons("Effect",Iron,5,20/sin(i),21/sin(i),20/sin(i),21/sin(i),50,120);
Effect->SetLineColor(38);
Effect->SetFillColor(38);
}
if (9<i && i<20) {
TGeoVolume *Effect=Robot->MakeCons("Effect",Iron,4,20/sin(i),21/sin(i),20/sin(i),21/sin(i),200,330);
Effect->SetLineColor(33);
Effect->SetFillColor(33);
}
}

//close geometry
top->SetVisibility(0);
Robot->CloseGeometry();

// in GL viewer
top->Draw("ogl");
}
```
robot.C:1
robot.C:2
robot.C:3
robot.C:4
robot.C:5
robot.C:6
robot.C:7
robot.C:8
robot.C:9
robot.C:10
robot.C:11
robot.C:12
robot.C:13
robot.C:14
robot.C:15
robot.C:16
robot.C:17
robot.C:18
robot.C:19
robot.C:20
robot.C:21
robot.C:22
robot.C:23
robot.C:24
robot.C:25
robot.C:26
robot.C:27
robot.C:28
robot.C:29
robot.C:30
robot.C:31
robot.C:32
robot.C:33
robot.C:34
robot.C:35
robot.C:36
robot.C:37
robot.C:38
robot.C:39
robot.C:40
robot.C:41
robot.C:42
robot.C:43
robot.C:44
robot.C:45
robot.C:46
robot.C:47
robot.C:48
robot.C:49
robot.C:50
robot.C:51
robot.C:52
robot.C:53
robot.C:54
robot.C:55
robot.C:56
robot.C:57
robot.C:58
robot.C:59
robot.C:60
robot.C:61
robot.C:62
robot.C:63
robot.C:64
robot.C:65
robot.C:66
robot.C:67
robot.C:68
robot.C:69
robot.C:70
robot.C:71
robot.C:72
robot.C:73
robot.C:74
robot.C:75
robot.C:76
robot.C:77
robot.C:78
robot.C:79
robot.C:80
robot.C:81
robot.C:82
robot.C:83
robot.C:84
robot.C:85
robot.C:86
robot.C:87
robot.C:88
robot.C:89
robot.C:90
robot.C:91
robot.C:92
robot.C:93
robot.C:94
robot.C:95
robot.C:96
robot.C:97
robot.C:98
robot.C:99
robot.C:100
robot.C:101
robot.C:102
robot.C:103
robot.C:104
robot.C:105
robot.C:106
robot.C:107
robot.C:108
robot.C:109
robot.C:110
robot.C:111
robot.C:112
robot.C:113
robot.C:114
robot.C:115
robot.C:116
robot.C:117
robot.C:118
robot.C:119
robot.C:120
robot.C:121
robot.C:122
robot.C:123
robot.C:124
robot.C:125
robot.C:126
robot.C:127
robot.C:128
robot.C:129
robot.C:130
robot.C:131
robot.C:132
robot.C:133
robot.C:134
robot.C:135
robot.C:136
robot.C:137
robot.C:138
robot.C:139
robot.C:140
robot.C:141
robot.C:142
robot.C:143
robot.C:144
robot.C:145
robot.C:146
robot.C:147
robot.C:148
robot.C:149
robot.C:150
robot.C:151
robot.C:152
robot.C:153
robot.C:154
robot.C:155
robot.C:156
robot.C:157
robot.C:158
robot.C:159
robot.C:160
robot.C:161
robot.C:162
robot.C:163
robot.C:164
robot.C:165
robot.C:166
robot.C:167
robot.C:168
robot.C:169
robot.C:170
robot.C:171
robot.C:172
robot.C:173
robot.C:174
robot.C:175
robot.C:176
robot.C:177
robot.C:178
robot.C:179
robot.C:180
robot.C:181
robot.C:182
robot.C:183
robot.C:184
robot.C:185
robot.C:186
robot.C:187
robot.C:188
robot.C:189
robot.C:190
robot.C:191
robot.C:192
robot.C:193
robot.C:194
robot.C:195
robot.C:196
robot.C:197
robot.C:198
robot.C:199
robot.C:200
robot.C:201
robot.C:202
robot.C:203
robot.C:204
robot.C:205
robot.C:206
robot.C:207
robot.C:208
robot.C:209
robot.C:210
robot.C:211
robot.C:212
robot.C:213
robot.C:214
robot.C:215
robot.C:216
robot.C:217
robot.C:218
robot.C:219
robot.C:220
robot.C:221
robot.C:222
robot.C:223
robot.C:224
robot.C:225
robot.C:226
robot.C:227
robot.C:228
robot.C:229
robot.C:230
robot.C:231
robot.C:232
robot.C:233
robot.C:234
robot.C:235
robot.C:236
robot.C:237
robot.C:238
robot.C:239
robot.C:240
robot.C:241
robot.C:242
robot.C:243
robot.C:244
robot.C:245
robot.C:246
robot.C:247
robot.C:248
robot.C:249
robot.C:250
robot.C:251
robot.C:252
robot.C:253
robot.C:254
robot.C:255
robot.C:256
robot.C:257
robot.C:258
robot.C:259
robot.C:260
robot.C:261
robot.C:262
robot.C:263
robot.C:264
robot.C:265
robot.C:266
robot.C:267
robot.C:268
robot.C:269
robot.C:270
robot.C:271
robot.C:272
robot.C:273
robot.C:274
robot.C:275
robot.C:276
robot.C:277
robot.C:278
robot.C:279
robot.C:280
robot.C:281
robot.C:282
robot.C:283
robot.C:284
robot.C:285
robot.C:286
robot.C:287
robot.C:288
robot.C:289
robot.C:290
robot.C:291
robot.C:292
robot.C:293
robot.C:294
robot.C:295
robot.C:296
robot.C:297
robot.C:298
robot.C:299
robot.C:300
robot.C:301
robot.C:302
robot.C:303
robot.C:304
robot.C:305
robot.C:306
robot.C:307
robot.C:308
robot.C:309
robot.C:310
robot.C:311
robot.C:312
robot.C:313
robot.C:314
robot.C:315
robot.C:316
robot.C:317
robot.C:318
robot.C:319
robot.C:320
robot.C:321
robot.C:322
robot.C:323
robot.C:324
robot.C:325
robot.C:326
robot.C:327
robot.C:328
robot.C:329
robot.C:330
robot.C:331
robot.C:332
robot.C:333
robot.C:334
robot.C:335
robot.C:336
robot.C:337
robot.C:338
robot.C:339
robot.C:340
robot.C:341
robot.C:342
robot.C:343
robot.C:344
robot.C:345
robot.C:346
robot.C:347
robot.C:348
robot.C:349
robot.C:350
robot.C:351
robot.C:352
robot.C:353
robot.C:354
robot.C:355
robot.C:356
robot.C:357
robot.C:358
robot.C:359
robot.C:360
robot.C:361
robot.C:362
robot.C:363
robot.C:364
robot.C:365
robot.C:366
robot.C:367
robot.C:368
robot.C:369
robot.C:370
robot.C:371
robot.C:372
robot.C:373
robot.C:374
robot.C:375
robot.C:376
robot.C:377
robot.C:378
robot.C:379
robot.C:380
robot.C:381
robot.C:382
robot.C:383
robot.C:384
robot.C:385
robot.C:386
robot.C:387
robot.C:388
robot.C:389
robot.C:390
robot.C:391
robot.C:392
robot.C:393
robot.C:394
robot.C:395
robot.C:396
robot.C:397
robot.C:398
robot.C:399
robot.C:400
robot.C:401
robot.C:402
robot.C:403
robot.C:404
robot.C:405
robot.C:406
robot.C:407
robot.C:408
robot.C:409
robot.C:410
robot.C:411
robot.C:412
robot.C:413
robot.C:414
robot.C:415
robot.C:416
robot.C:417
robot.C:418
robot.C:419
robot.C:420
robot.C:421
robot.C:422
robot.C:423
robot.C:424
robot.C:425
robot.C:426
robot.C:427
robot.C:428
robot.C:429
robot.C:430
robot.C:431
robot.C:432
robot.C:433
robot.C:434
robot.C:435
robot.C:436
robot.C:437
robot.C:438
robot.C:439
robot.C:440
robot.C:441
robot.C:442
robot.C:443
robot.C:444
robot.C:445
robot.C:446
robot.C:447
robot.C:448
robot.C:449
robot.C:450
robot.C:451
robot.C:452
robot.C:453
robot.C:454
robot.C:455
robot.C:456
robot.C:457
robot.C:458
robot.C:459
robot.C:460
robot.C:461
robot.C:462
robot.C:463