drawing textures on planes now

git-svn-id: svn://anubis/anaglym/trunk@153 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
Josh Holtrop 2009-11-03 14:38:40 +00:00
parent 9319b39d2a
commit 96ef0ef7ac
2 changed files with 4 additions and 0 deletions

View File

@ -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);

View File

@ -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