From 99cbc32b63e3ae4d26d0387546155c563ba828ea Mon Sep 17 00:00:00 2001 From: Faerbit Date: Sat, 7 Mar 2015 12:48:07 +0100 Subject: [PATCH] Changed texture coordinates of water plane so that it can use the water texture properly. --- loader.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/loader.cc b/loader.cc index 965232d..f05c4c5 100644 --- a/loader.cc +++ b/loader.cc @@ -108,13 +108,13 @@ void Loader::load(std::string filePath, Level* level, std::string compositionsPa float heightmapHeight = level->getTerrain()->getHeightmapHeight(); float heightmapWidth = level->getTerrain()->getHeightmapWidth(); float planeData[] = { - -heightmapWidth/2.0f, waterHeight, -heightmapHeight/2.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, + -heightmapWidth/2.0f, waterHeight, -heightmapHeight/2.0f, 0.0f, heightmapHeight, 0.0f, 1.0f, 0.0f, -heightmapWidth/2.0f, waterHeight, heightmapHeight/2.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, - heightmapWidth/2.0f, waterHeight, -heightmapHeight/2.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, + heightmapWidth/2.0f, waterHeight, -heightmapHeight/2.0f, heightmapWidth, heightmapHeight, 0.0f, 1.0f, 0.0f, - heightmapWidth/2.0f, waterHeight, heightmapHeight/2.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, + heightmapWidth/2.0f, waterHeight, heightmapHeight/2.0f, heightmapWidth, 0.0f, 0.0f, 1.0f, 0.0f, -heightmapWidth/2.0f, waterHeight, heightmapHeight/2.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, - heightmapWidth/2.0f, waterHeight, -heightmapHeight/2.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f + heightmapWidth/2.0f, waterHeight, -heightmapHeight/2.0f, heightmapWidth, heightmapHeight, 0.0f, 1.0f, 0.0f }; ACGL::OpenGL::SharedArrayBuffer water_ab = ACGL::OpenGL::SharedArrayBuffer(new ACGL::OpenGL::ArrayBuffer()); water_ab->defineAttribute("aPosition", GL_FLOAT, 3);