Skip to content
Snippets Groups Projects
Commit 13796cb3 authored by Woohyung Choi's avatar Woohyung Choi
Browse files

Modify cube.obj

parent b3eec7d4
No related branches found
No related tags found
No related merge requests found
...@@ -335,7 +335,7 @@ GLuint allocate_VBO(const GLuint attribIndex, std::vector<glm::vec2> *VBO) ...@@ -335,7 +335,7 @@ GLuint allocate_VBO(const GLuint attribIndex, std::vector<glm::vec2> *VBO)
glBufferData(GL_ARRAY_BUFFER, VBO->size() * sizeof(glm::vec2), &(VBO->front()), GL_STATIC_DRAW); glBufferData(GL_ARRAY_BUFFER, VBO->size() * sizeof(glm::vec2), &(VBO->front()), GL_STATIC_DRAW);
glEnableVertexAttribArray(attribIndex); glEnableVertexAttribArray(attribIndex);
glVertexAttribPointer(attribIndex, 3, GL_FLOAT, GL_FALSE, 0, (void*)0); glVertexAttribPointer(attribIndex, 2, GL_FLOAT, GL_FALSE, 0, (void*)0);
glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ARRAY_BUFFER, 0);
......
...@@ -71,7 +71,7 @@ int main() ...@@ -71,7 +71,7 @@ int main()
auto defaultMaterial = new Material(lightmap, orange, transparent); auto defaultMaterial = new Material(lightmap, orange, transparent);
auto cubeMaterial = new Material(lightmap, container_diffuse, container_specular); auto cubeMaterial = new Material(lightmap, container_diffuse, container_specular);
auto planeMaterial = new Material(lightmap, magenta, white); auto planeMaterial = new Material(lightmap, container_diffuse, transparent);
auto teapot = make_render_object(make_mesh("teapot.obj")); auto teapot = make_render_object(make_mesh("teapot.obj"));
{ {
...@@ -120,6 +120,14 @@ int main() ...@@ -120,6 +120,14 @@ int main()
cube3->set_material(cubeMaterial); cube3->set_material(cubeMaterial);
} }
auto cube4 = make_render_object(cube);
{
cube4->set_translate(glm::vec3(0.0f, 10.0f, 0.0f));
}
{
cube4->set_material(cubeMaterial);
}
while (!glfwWindowShouldClose(window)) while (!glfwWindowShouldClose(window))
{ {
double currentFrame = glfwGetTime(); double currentFrame = glfwGetTime();
...@@ -137,6 +145,7 @@ int main() ...@@ -137,6 +145,7 @@ int main()
cube2->render(camera); cube2->render(camera);
cube3->render(camera); cube3->render(camera);
plane->render(camera); plane->render(camera);
cube4->render(camera);
} }
glfwSwapBuffers(window); glfwSwapBuffers(window);
......
...@@ -6,23 +6,15 @@ v 1.000000 -1.000000 1.000000 ...@@ -6,23 +6,15 @@ v 1.000000 -1.000000 1.000000
v -1.000000 -1.000000 1.000000 v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000 v -1.000000 -1.000000 -1.000000
v 1.000000 1.000000 -1.000000 v 1.000000 1.000000 -1.000000
v 0.999999 1.000000 1.000001 v 1.000000 1.000000 1.000000
v -1.000000 1.000000 1.000000 v -1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000 v -1.000000 1.000000 -1.000000
vt 0.748573 0.750412
vt 0.749279 0.501284 vt 0.000000 0.000000
vt 0.999110 0.501077 vt 0.000000 1.000000
vt 0.999455 0.750380 vt 1.000000 0.000000
vt 0.250471 0.500702 vt 1.000000 1.000000
vt 0.249682 0.749677
vt 0.001085 0.750380
vt 0.001517 0.499994
vt 0.499422 0.500239
vt 0.500149 0.750166
vt 0.748355 0.998230
vt 0.500193 0.998728
vt 0.498993 0.250415
vt 0.748953 0.250920
vn 0.000000 0.000000 -1.000000 vn 0.000000 0.000000 -1.000000
vn -1.000000 -0.000000 -0.000000 vn -1.000000 -0.000000 -0.000000
vn -0.000000 -0.000000 1.000000 vn -0.000000 -0.000000 1.000000
...@@ -32,15 +24,15 @@ vn 1.000000 0.000000 0.000001 ...@@ -32,15 +24,15 @@ vn 1.000000 0.000000 0.000001
vn 0.000000 1.000000 -0.000000 vn 0.000000 1.000000 -0.000000
vn -0.000000 -1.000000 0.000000 vn -0.000000 -1.000000 0.000000
f 5/1/1 1/2/1 4/3/1 f 5/4/1 1/3/1 4/1/1
f 5/1/1 4/3/1 8/4/1 f 5/4/1 4/1/1 8/2/1
f 3/5/2 7/6/2 8/7/2 f 3/3/2 7/4/2 8/2/2
f 3/5/2 8/7/2 4/8/2 f 3/3/2 8/2/2 4/1/2
f 2/9/3 6/10/3 3/5/3 f 2/3/3 6/4/3 3/1/3
f 6/10/4 7/6/4 3/5/4 f 6/4/4 7/2/4 3/1/4
f 1/2/5 5/1/5 2/9/5 f 1/3/5 5/4/5 2/1/5
f 5/1/6 6/10/6 2/9/6 f 5/4/6 6/2/6 2/1/6
f 5/1/7 8/11/7 6/10/7 f 5/4/7 8/2/7 6/3/7
f 8/11/7 7/12/7 6/10/7 f 8/2/7 7/1/7 6/3/7
f 1/2/8 2/9/8 3/13/8 f 1/4/8 2/3/8 3/1/8
f 1/2/8 3/13/8 4/14/8 f 1/4/8 3/1/8 4/2/8
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment