Advertisement
Guest User

Untitled

a guest
Nov 26th, 2012
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. package com.example.dipl_stickman_dirt_jumping;
  2.  
  3. import java.nio.ByteBuffer;
  4. import java.nio.ByteOrder;
  5. import java.nio.FloatBuffer;
  6. import java.nio.ShortBuffer;
  7.  
  8. import javax.microedition.khronos.opengles.GL10;
  9.  
  10. public class Stickman extends Mesh{
  11.    
  12.     public Stickman(float width, float height, float depth)
  13.     {
  14.         width   /= 2;
  15.         height  /= 2;
  16.         depth   /= 2;
  17.        
  18.         float vertices[] = {    -width,height,depth,
  19.                                 -width,-height,depth,
  20.                                 width,-height,depth,
  21.                                 width,height,depth
  22.         };
  23.        
  24.         short indices[] = { 0,1,2,
  25.                             0,2,3
  26.         };
  27.        
  28.         setVertices(vertices);
  29.         setIndices(indices);
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement