-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWhirly.c
75 lines (52 loc) · 1.55 KB
/
Whirly.c
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include<stdio.h>
#include<stdlib.h>
#include<GL/gl.h>
#include<GL/glu.h>
#include<GL/glut.h>
#include<stdbool.h>
#include "Whirly.h"
//I ran out of ideas for this one
void draw_Whirly(){
//whirlly
//Silver
float mat_ambient_Silver[] ={ 0.19225f, 0.19225f, 0.19225f, 1.0f };
float mat_diffuse_Silver[] ={ 0.50754f, 0.50754f, 0.50754f, 1.0f};
float mat_specular_Silver[] ={0.508273f, 0.508273f, 0.508273f, 1.0f };
float shine_Silver = 51.2f;
glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient_Silver);
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse_Silver);
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular_Silver);
glMaterialf(GL_FRONT, GL_SHININESS, shine_Silver);
GLUquadricObj *quadObj = gluNewQuadric();
//body
glPushMatrix();
glRotatef(Whirly_move, 0, 0, 1);
gluCylinder(quadObj, 0, 6, 12, 30, 30);
glPopMatrix();
//arms
glPushMatrix();
glTranslatef(-4, -1, 6);
glRotatef(-125, 1, 0, 0);
glRotatef(Whirly_move, 0, 0, 1);
gluCylinder(quadObj, 0, 2, 7, 30, 30);
glPopMatrix();
glPushMatrix();
glTranslatef(4, -1, 6);
glRotatef(-125, 1, 0, 0);
glRotatef(Whirly_move, 0, 0, 1);
gluCylinder(quadObj, 0, 2, 7, 30, 30);
glPopMatrix();
//eyes
glPushMatrix();
glTranslatef(2, 5, 10);
glRotatef(-25, 0, 1, 0);
glScalef(2.4, 0.2, 0.2);
glutSolidCube(1);
glPopMatrix();
glPushMatrix();
glTranslatef(-2, 5, 10);
glRotatef(25, 0, 1, 0);
glScalef(2.4, 0.2, 0.2);
glutSolidCube(1);
glPopMatrix();
}