1
0
Fork 0

Add car model

This commit is contained in:
Meoweg 2015-11-12 00:57:08 +00:00
parent a59238fa80
commit a5a109be6f
4 changed files with 13051 additions and 1 deletions

22
data/materials/car.mtl Normal file
View File

@ -0,0 +1,22 @@
# Blender MTL File: 'None'
# Material Count: 2
newmtl moskvitchMAT0
Ns 92.156863
Ka 0.000000 0.000000 0.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2
map_Kd car.png
newmtl moskvitchMAT1
Ns 92.156863
Ka 0.000000 0.000000 0.000000
Kd 0.640000 0.640000 0.640000
Ks 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
map_Kd car.png

13021
data/models/car.obj Normal file

File diff suppressed because it is too large Load Diff

BIN
data/textures/car.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@ -32,11 +32,13 @@ static Camera camera(scene);
static float camera_angles_x = 0;
static const Model *protagonist;
static const Model *car;
static const Model *suzanne;
static const Model *teapot;
static const Model *bunny;
static Object *protagonist1;
static Object *car1;
static Object *suzanne1;
static Object *teapot1;
static Object *bunny1;
@ -71,10 +73,11 @@ int main()
texture_uniform = program->get_uniform_location("texture");
glUniform1i(texture_uniform, 0);
camera.projection = glm::perspective(45.0f, (float)640 / (float)480, 0.1f, 10.0f);
camera.projection = glm::perspective(45.0f, (float)640 / (float)480, 0.1f, 100.0f);
camera.position.z = 2;
protagonist = store.load<Model>("protagonist.obj");
car = store.load<Model>("car.obj");
suzanne = store.load<Model>("suzanne.obj");
teapot = store.load<Model>("teapot.obj");
bunny = store.load<Model>("bunny.obj");
@ -82,6 +85,9 @@ int main()
protagonist1 = new Object(*protagonist);
protagonist1->position.z = 4;
car1 = new Object(*car);
car1->position.z = -10;
suzanne1 = new Object(*suzanne);
suzanne1->position.z = -2;
suzanne1->position.y = 2;
@ -95,6 +101,7 @@ int main()
bunny1->position.x = 2.0;
scene << protagonist1
<< car1
<< suzanne1
<< teapot1
<< bunny1;