Advertisement
Guest User

Untitled

a guest
Jan 25th, 2024
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.33 KB | None | 0 0
  1. int[] verts = {
  2.             0, 0, 0,
  3.             viewWidth, 0, 0,
  4.             viewWidth, viewHeight / 2, 0,
  5.            
  6.             0, 0, 0,
  7.             0, viewHeight / 2, 0,
  8.             viewWidth, viewHeight / 2, 0
  9.         };
  10.         int[] uv = {
  11.             0, 0,
  12.             255, 0,
  13.             255, 255,
  14.            
  15.             0, 0,
  16.             0, 255,
  17.             255, 255
  18.         };
  19.        
  20.         int color = ((128 << 16) | (128 << 8) | 128);
  21.        
  22.         int[] colors = {
  23.             color, color, color
  24.         };
  25.        
  26.         Effect3D ef = new Effect3D();
  27.        
  28.         affineMatrix.setIdentity();
  29.         matrix.setAffineTrans(affineMatrix);
  30.         matrix.setCenter(0, 0);
  31.         matrix.setParallelSize(viewWidth, viewHeight);
  32.        
  33.         g3d.renderPrimitives(tex.nativeHandle, 0, 0, matrix, ef, Graphics3D.PRIMITVE_TRIANGLES | Graphics3D.PDATA_TEXURE_COORD, 2, verts, verts, uv, verts);
  34.         g3d.flush();
  35.        
  36.         affineMatrix.setIdentity();
  37.         matrix.setAffineTrans(affineMatrix);
  38.         matrix.setCenter(0, viewHeight / 2);
  39.         matrix.setParallelSize(viewWidth, viewHeight);
  40.        
  41.         g3d.renderPrimitives(tex.nativeHandle, 0, 0, matrix, ef, Graphics3D.PRIMITVE_TRIANGLES | Graphics3D.PDATA_COLOR_PER_FACE, 2, verts, verts, uv, colors);
  42.         g3d.flush();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement