From e3d4a488a0c3eab68d4c77139f8d9b203e1ddafc Mon Sep 17 00:00:00 2001 From: weigao Date: Sun, 3 Aug 2014 18:55:54 +0800 Subject: make GL 3.0 support bars scroll Change-Id: I71d8d94f410e6c67d0e188ea2e0f79eb151758e0 --- chart2/opengl/shape3DVertexShaderV300.glsl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'chart2/opengl/shape3DVertexShaderV300.glsl') diff --git a/chart2/opengl/shape3DVertexShaderV300.glsl b/chart2/opengl/shape3DVertexShaderV300.glsl index 6737004cb914..a8da294fb3cd 100644 --- a/chart2/opengl/shape3DVertexShaderV300.glsl +++ b/chart2/opengl/shape3DVertexShaderV300.glsl @@ -16,12 +16,16 @@ uniform mat4 P; uniform mat4 M; uniform mat4 V; uniform mat3 normalMatrix; +uniform float minCoordX; +uniform float maxCoordX; void main() { - gl_Position = P * V * M * vec4(vertexPositionModelspace,1); + positionWorldspace = (M * vec4(vertexPositionModelspace,1)).xyz; - positionWorldspace = (M * vec4(vertexPositionModelspace,1)).xyz; + positionWorldspace.x = clamp(positionWorldspace.x, minCoordX, maxCoordX); + + gl_Position = P * V * vec4(positionWorldspace,1); normalCameraspace = normalize(mat3(V) * normalMatrix * vertexNormalModelspace); } -- cgit v1.2.3