uniform vec3 fvLightPosition;
uniform vec3 fvEyePosition;

uniform float control;
uniform float value;
uniform float power;
uniform float fTime0_X;

varying vec2 Texcoord;
varying vec3 ViewDirection;
varying vec3 LightDirection;
varying vec3 Normal;
   
void main( void )
{
  
   Texcoord    = gl_MultiTexCoord0.xy;
    
   float d = sqrt(gl_Vertex.x*gl_Vertex.x+gl_Vertex.y*gl_Vertex.y+gl_Vertex.z*gl_Vertex.z);

   d = d*control;

     d = pow(d, power);

   float v = sin(fTime0_X-d*d*value);

   vec4 fvObjectPosition = gl_ModelViewProjectionMatrix * vec4(gl_Vertex.x*cos(v)+gl_Vertex.y*sin(v), gl_Vertex.y*cos(v)-gl_Vertex.x*sin(v), gl_Vertex.z, 1);
  // gl_Position = fvObjectPosition;//  vec4(ftransform().x*sin(fTime0_X),-ftransform().y*cos(fTime0_X),ftransform().z,ftransform().w);
   
   ViewDirection  = fvEyePosition - fvObjectPosition.xyz;
   LightDirection = fvLightPosition - fvObjectPosition.xyz;
   Normal         = gl_NormalMatrix * gl_Normal;
   
gl_Position = fvObjectPosition + vec4(Normal,0.0)*(1.0-d);   
   
}