/// <summary> /// Set the data for the water's vertex buffer /// </summary> private void LensCreated(object sender, EventArgs e) { VertexBuffer vb = (VertexBuffer)sender; BumpVertex[] v = new BumpVertex[4]; v[0].p = new Vector3(-256.0f, -256.0f, 0.0f); v[1].p = new Vector3(-256.0f, 256.0f, 0.0f); v[2].p = new Vector3(256.0f, -256.0f, 0.0f); v[3].p = new Vector3(256.0f, 256.0f, 0.0f); v[0].tu1 = 0.0f; v[0].tv1 = 1.0f; v[1].tu1 = 0.0f; v[1].tv1 = 0.0f; v[2].tu1 = 1.0f; v[2].tv1 = 1.0f; v[3].tu1 = 1.0f; v[3].tv1 = 0.0f; vb.SetData(v, 0, 0); }
/// <summary> /// Set the data for the water's vertex buffer /// </summary> private void WaterBufferCreated(object sender, EventArgs e) { VertexBuffer vb = (VertexBuffer)sender; BumpVertex[] v = new BumpVertex[4]; v[0].p = new Vector3(-60.0f, -60.0f, 0.0f); v[0].n = new Vector3(0, 1, 0); v[1].p = new Vector3(-60.0f, 60.0f, 0.0f); v[1].n = new Vector3(0, 1, 0); v[2].p = new Vector3(60.0f, -60.0f, 0.0f); v[2].n = new Vector3(0, 1, 0); v[3].p = new Vector3(60.0f, 60.0f, 0.0f); v[3].n = new Vector3(0, 1, 0); v[0].tu2 = 0.000f; v[0].tv2 = 1.0f; v[1].tu2 = 0.000f; v[1].tv2 = 0.0f; v[2].tu2 = 1.000f; v[2].tv2 = 1.0f; v[3].tu2 = 1.000f; v[3].tv2 = 0.0f; vb.SetData(v, 0, 0); }