Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.41 KB | None | 0 0
  1. private void DrawLineRender()
  2.     {
  3.         Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);              
  4.         cam.update();
  5.         Gdx.gl10.glMatrixMode(GL10.GL_PROJECTION);
  6.         Gdx.gl10.glLoadMatrixf(cam.projection.val, 0);
  7.         Gdx.gl10.glMatrixMode(GL10.GL_MODELVIEW);
  8.         Gdx.gl10.glLoadMatrixf(cam.view.val, 0);
  9.        
  10.         for (int splineIdx = 0; splineIdx < splines.size(); splineIdx++)
  11.         {
  12.             Vector3[] path = new Vector3[5000];
  13.             for(int i = 0; i < path.length; i++)
  14.             {
  15.                 path[i] = new Vector3();
  16.             }
  17.            
  18.             //splines.get(splineIdx).getPath(path, 5);
  19.             CatmullRomSpline curSpline = splines.get(splineIdx);
  20.             curSpline.getPath(path, 50);
  21.  
  22.             Gdx.gl10.glPointSize(10);
  23.             renderer.begin(GL10.GL_POINTS);
  24.             for (int i = 0; i < 50; i++)
  25.             {
  26.                 Vector3 point1 = path[i];
  27.                 Vector3 point2 = path[i + 1];
  28.                
  29.                 renderer.color(1, 1, 1, 1);
  30.                 renderer.vertex(point1.x, point1.y, 0);
  31.                
  32. //              renderer.color(1, 1, 1, 1);
  33. //              renderer.vertex(point1.x, point1.y, 0);
  34. //              renderer.color(1, 1, 1, 1);
  35. //              renderer.vertex(point1.x, 0, 0);
  36. //              renderer.color(1, 1, 1, 1);
  37. //              renderer.vertex(point2.x, point2.y, 0);
  38. //
  39. //              renderer.color(1, 1, 1, 1);
  40. //              renderer.vertex(point2.x, point2.y, 0);
  41. //              renderer.color(1, 1, 1, 1);
  42. //              renderer.vertex(point1.x, 0, 0);
  43. //              renderer.color(1, 1, 1, 1);
  44. //              renderer.vertex(point2.x, 0, 0);
  45.             }
  46.             renderer.end();
  47.         }
  48.  
  49.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement