2008-07-15 19:21:50 +00:00
|
|
|
/********************************************************************
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
2011-01-09 20:20:36 +00:00
|
|
|
Copyright (C) 2008, 2011 Martin Gräßlin <kde@martin-graesslin.com>
|
2008-07-15 19:21:50 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
2015-12-01 11:05:14 +00:00
|
|
|
uniform mat4 modelViewProjectionMatrix;
|
2008-07-15 19:21:50 +00:00
|
|
|
uniform float width;
|
|
|
|
uniform float cubeAngle;
|
|
|
|
uniform float xCoord;
|
2009-02-19 11:50:00 +00:00
|
|
|
uniform float timeLine;
|
2008-07-15 19:21:50 +00:00
|
|
|
|
2015-12-01 11:05:14 +00:00
|
|
|
attribute vec4 position;
|
|
|
|
attribute vec4 texcoord;
|
2011-01-09 20:20:36 +00:00
|
|
|
|
2015-12-01 11:05:14 +00:00
|
|
|
varying vec2 texcoord0;
|
2011-01-09 20:20:36 +00:00
|
|
|
|
2008-07-15 19:21:50 +00:00
|
|
|
void main()
|
|
|
|
{
|
2015-12-01 11:05:14 +00:00
|
|
|
texcoord0 = texcoord.st;
|
|
|
|
vec4 transformedVertex = vec4(position.x - ( width - xCoord ), position.yzw);
|
2011-01-09 20:20:36 +00:00
|
|
|
float radian = radians(cubeAngle);
|
|
|
|
float radius = (width)*tan(radian);
|
|
|
|
float azimuthAngle = radians(transformedVertex.x/(width)*(90.0 - cubeAngle));
|
|
|
|
|
|
|
|
transformedVertex.x = width - xCoord + radius * sin( azimuthAngle );
|
2015-12-01 11:05:14 +00:00
|
|
|
transformedVertex.z = position.z + radius * cos( azimuthAngle ) - radius;
|
2011-01-09 20:20:36 +00:00
|
|
|
|
2015-12-01 11:05:14 +00:00
|
|
|
vec3 diff = (position.xyz - transformedVertex.xyz)*timeLine;
|
2011-01-09 20:20:36 +00:00
|
|
|
transformedVertex.xyz += diff;
|
|
|
|
|
2015-12-01 11:05:14 +00:00
|
|
|
gl_Position = modelViewProjectionMatrix*transformedVertex;
|
2008-07-15 19:21:50 +00:00
|
|
|
}
|