diff --git a/Engine.cc b/Engine.cc index 1b3563f..79a2b2e 100644 --- a/Engine.cc +++ b/Engine.cc @@ -921,10 +921,12 @@ void Engine::Object::render() float half_span = num_sections * section_size / 2.0; float x_c = x * section_size - half_span; float y_c = y * section_size - half_span; + glTexCoord2f(0.0, y); glVertex3f(x_o + rotated_x[0] * x_c + rotated_y[0] * y_c, y_o + rotated_x[1] * x_c + rotated_y[1] * y_c, z_o + rotated_x[2] * x_c + rotated_y[2] * y_c); x_c += section_size; + glTexCoord2f(1.0, y); glVertex3f(x_o + rotated_x[0] * x_c + rotated_y[0] * y_c, y_o + rotated_x[1] * x_c + rotated_y[1] * y_c, z_o + rotated_x[2] * x_c + rotated_y[2] * y_c); diff --git a/tests/managed_objects.lua b/tests/managed_objects.lua index f745c9d..0f5b846 100644 --- a/tests/managed_objects.lua +++ b/tests/managed_objects.lua @@ -1,6 +1,8 @@ +crate_texture = ag.loadTexture("checker.jpg") ground = ag.createStaticPlane(0, 0, 1, 0) ground:setColor(0.2, 1.0, 0.2) +ground:setTexture(crate_texture) ag.setCamera(10, -10, 10, 0, 0, 0) if (ag.import("rot_camera") ~= true) then