struct appdata 
{
  float4 position: POSITION;
  float4 color   : COLOR0;
  float3 wave    : COLOR1;
  float2 tc0     : TEXCOORD0;
};

struct vfconn
{
  float4 HPos : POSITION;
  float4 Col0 : COLOR0;
  float2 tc0  : TEXCOORD0;
};

vfconn main(appdata IN,	uniform float4x4 modelViewProj,uniform float time)
{
	vfconn OUT;			// Variable to handle our output from the vertex
					// shader (goes to a fragment shader if available).

      float d;

	// Change The Y Position Of The Vertex Based On Sine Waves
	//IN.position.y = ( sin(IN.wave.x + (IN.position.x / 5.0) ) + sin(IN.wave.x + (IN.position.z / 4.0) ) ) * 2.5f;
	//IN.position.y = ( sin(t + (IN.position.x / 5.0) ) + sin(t + (IN.position.z / 4.0) ) ) * 2.5f;
	//IN.position.y = sin(time+IN.position.x+IN.position.z)* 1.0f;
      // Wobble
	//IN.position.y = IN.position.y+sin(time*5.0f+IN.position.x+IN.position.z+IN.position.y)* 0.1f;
	//IN.position.x = IN.position.x+sin(time*3.0f+IN.position.x+IN.position.z+IN.position.y)* 0.1f;
	//IN.position.z = IN.position.z+sin(time*7.0f+IN.position.x+IN.position.z+IN.position.y)* 0.1f;
      // Magnet move
	d=(IN.position.x+IN.position.z);
      //d=d*d;
      //if(d<1.0)d=0;
	IN.position.y = IN.position.y+sin(time*5.0f+IN.position.x+IN.position.z+IN.position.y)*d*0.1f;
	
	// Transform The Vertex Position Into Homogenous Clip-Space (Required)
	OUT.HPos = mul(modelViewProj, IN.position);
      //OUT.HPos.y=1.5;

	// Set The Color To The Value Specified In IN.color
	OUT.Col0.xyz = IN.color.xyz;

  // Texture coordinates
  OUT.tc0=IN.tc0;

  return OUT;
}

