-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFenrys.c
190 lines (134 loc) · 3.77 KB
/
Fenrys.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#include<stdio.h>
#include<stdlib.h>
#include<GL/gl.h>
#include<GL/glu.h>
#include<GL/glut.h>
#include<stdbool.h>
#include "Fenrys.h"
//he is a very good boy
void draw_wolf(){
//material parameters
//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.208273f, 0.208273f, 0.208273f, 1.0f };
float shine_Silver = 12.1f;
//Obsidian
float mat_ambient_Obsidian[] = { 0.05375f, 0.05f, 0.06625f, 0.82f };
float mat_diffuse_Obsidian[] = { 0.18275f, 0.17f, 0.22525f, 0.82f};
float mat_specular_Obsidian[] = {0.332741f, 0.328634f, 0.346435f, 0.82f };
float shine_Obsidian = 12.1f ;
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);
//Fenrys
//body
glPushMatrix();
glTranslatef(0, 0, 1.2);
glScalef(2.6, 4, 1.7);
glutSolidCube(1);
glPopMatrix();
//tail and tail movement animation
glPushMatrix();
glTranslatef(0, 0, 1.7);
glRotatef(wolf_move, 0, 0, 1);
glTranslatef(0, 0, -1.7);
glTranslatef(0, -2.5, 1.2);
glRotatef(25, 1, 0, 0);
glScalef(0.6, 2.5, 0.6);
glutSolidCube(1);
glPopMatrix();
//legs and movement animation
glPushMatrix();
glTranslatef(0, 0, 1.7);
glRotatef(wolf_move, 1, 0, 0);
glTranslatef(0, 0, -1.7);
glTranslatef(-1, -1, 0);
glScalef(0.5, 0.5, 3);
glutSolidCube(1);
glPopMatrix();
glPushMatrix();
glTranslatef(0, 0, 1.7);
glRotatef(-wolf_move, 1, 0, 0);
glTranslatef(0, 0, -1.7);
glTranslatef(-1, 1, 0);
glScalef(0.5, 0.5, 3);
glutSolidCube(1);
glPopMatrix();
glPushMatrix();
glTranslatef(0, 0, 1.7);
glRotatef(-wolf_move, 1, 0, 0);
glTranslatef(0, 0, -1.7);
glTranslatef(1, -1, 0);
glScalef(0.5, 0.5, 3);
glutSolidCube(1);
glPopMatrix();
glPushMatrix();
glTranslatef(0, 0, 1.7);
glRotatef(wolf_move, 1, 0, 0);
glTranslatef(0, 0, -1.7);
glTranslatef(1, 1, 0);
glScalef(0.5, 0.5, 3);
glutSolidCube(1);
glPopMatrix();
//head
glPushMatrix();
glTranslatef(0, 2.5, 2.2);
glScalef(0.8, 0.8, 0.8);
glRotatef(-5, 1, 0, 0);
//base
glPushMatrix();
glTranslatef(0, -0.5, 0.5);
glScalef(2, 2, 2);
glutSolidCube(1);
glPopMatrix();
glPushMatrix();
glTranslatef(0, 0.3, 0);
glScalef(1, 3, 1);
glutSolidCube(1);
glPopMatrix();
//ears
glPushMatrix();
glTranslatef(0.6, -0.5, 1.5);
glScalef(0.5, 0.5, 0.6);
glutSolidCube(1);
glPopMatrix();
glPushMatrix();
glTranslatef(-0.6, -0.5, 1.5);
glScalef(0.5, 0.5, 0.6);
glutSolidCube(1);
glPopMatrix();
//eyes
glPushMatrix();
glTranslatef(0.5, 0.5, 1);
glScalef(0.2, 0.2, 0.2);
glutSolidCube(1);
glPopMatrix();
glPushMatrix();
glTranslatef(-0.5, 0.5, 1);
glScalef(0.2, 0.2, 0.2);
glutSolidCube(1);
glPopMatrix();
glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient_Obsidian);
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse_Obsidian);
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular_Obsidian);
glMaterialf(GL_FRONT, GL_SHININESS, shine_Obsidian);
glPushMatrix();
glTranslatef(0.4, 0.5, 1);
glScalef(0.2, 0.2, 0.2);
glutSolidCube(1);
glPopMatrix();
glPushMatrix();
glTranslatef(-0.4, 0.5, 1);
glScalef(0.2, 0.2, 0.2);
glutSolidCube(1);
glPopMatrix();
//nose
glPushMatrix();
glTranslatef(0, 1.8, 0.5);
glScalef(0.3, 0.3, 0.3);
glutSolidCube(1);
glPopMatrix();
glPopMatrix();
}