Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 1.20 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Why can't I translate my plane downwards?
  2. private Vertex[] planeVertices = new[]
  3.         {
  4.             /*0*/new Vertex(-1, 0, 1,  0,0,   0, 1, 0),
  5.             /*1*/new Vertex( 1, 0, 1,  1,0,   0, 1, 0),
  6.             /*2*/new Vertex( 1, 0,-1,  1,1,   0, 1, 0),
  7.             /*3*/new Vertex(-1, 0,-1,  0,1,   0, 1, 0),
  8.         };
  9.        
  10. planeVao.Bind();
  11.         textureSampler.Value = 1;
  12.         modelMatrix.Value = new Matrix4(
  13.             5, 0, 0, 0,
  14.             0, 1, 0, -3,
  15.             0, 0, 5, 0,
  16.             0, 0, 0, 1);
  17.         GL.DrawElements(BeginMode.Triangles, planeIndices.Length,
  18.             DrawElementsType.UnsignedInt, IntPtr.Zero);
  19.        
  20. gl_Position = ProjectionMatrix * ViewMatrix * ModelMatrix * vec4(Position, 1.0);
  21.        
  22. modelMatrix.Value = new Matrix4(
  23.             5, 0, 0, 1,
  24.             0, 1, 0, -3,
  25.             0, 0, 5, 0,
  26.             0, 0, 0, 1);
  27.        
  28. {(0.8192319, -0.2529707, 0.5146502, 0)
  29. (0, 0.8974438, 0.4411287, 0)
  30. (-0.5734624, -0.3613867, 0.7352146, 0)
  31. (8.940697E-08, -2.235174E-07, -6.800735, 1)}
  32.        
  33. {(1.299038, 0, 0, 0)
  34. (0, 1.732051, 0, 0)
  35. (0, 0, -1.020202, -1)
  36. (0, 0, -2.020202, 0)}
  37.        
  38. modelMatrix.Value = new Matrix4(
  39.         5, 0, 0, 0,
  40.         0, 1, 0, 0,
  41.         0, 0, 5, 0,
  42.         0, 0, -3, 1);