-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArm.cpp
More file actions
45 lines (39 loc) · 666 Bytes
/
Arm.cpp
File metadata and controls
45 lines (39 loc) · 666 Bytes
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
//
// Arm.cpp
//
// Created by Hans Dulimarta on 02/18/13.
//
//
#include "Shapes/Cylinder.h"
#include "Arm.h"
const float LENGTH = 20.0;
Arm::Arm()
{
}
Arm::~Arm()
{
//gluDeleteQuadric(cyl_quad);
}
void Arm::build()
{
cyl.build(0.2, 0.2, LENGTH);
//gluCylinder(cyl_quad, 0.2, 0.2, LENGTH, 20, 25);
//glEndList();
}
void Arm::render() const
{
glPushMatrix();
glTranslatef (0, 0, -LENGTH/2);
glPushMatrix();
glTranslatef(0, -0.5, 0);
cyl.render();
glPopMatrix();
glPushMatrix();
glTranslatef(0, +0.5, 0);
cyl.render();
glPopMatrix();
glPopMatrix();
}
float Arm::length() const {
return LENGTH;
}