From 96ef0ef7acd6dcf29915fcb10257a0c5d7215ea2 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 3 Nov 2009 14:38:40 +0000 Subject: [PATCH] drawing textures on planes now git-svn-id: svn://anubis/anaglym/trunk@153 99a6e188-d820-4881-8870-2d33a10e2619 --- Engine.cc | 2 ++ tests/managed_objects.lua | 2 ++ 2 files changed, 4 insertions(+) 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