Project

General

Profile

« Previous | Next » 

Revision 2dacdeb2

Added by Leszek Koltunski almost 8 years ago

remove the 'Color' vertex attribute.

View differences:

src/main/java/org/distorted/library/DistortedCubesGrid.java
713 713
      buildGrid(cols,desc,frontOnly);
714 714
       
715 715
      int numVertices=0;
716
      float[] colorData   = new float[COLOR_DATA_SIZE   *dataLength];
717 716
      float[] positionData= new float[POSITION_DATA_SIZE*dataLength];
718 717
      float[] normalData  = new float[NORMAL_DATA_SIZE  *dataLength];
719 718
      float[] textureData = new float[TEX_DATA_SIZE     *dataLength];
720
      
721
      for(int i=0; i<dataLength; i++)
722
        {
723
        colorData[COLOR_DATA_SIZE*i  ] = 1.0f; // r
724
        colorData[COLOR_DATA_SIZE*i+1] = 1.0f; // g
725
        colorData[COLOR_DATA_SIZE*i+2] = 1.0f; // b
726
        colorData[COLOR_DATA_SIZE*i+3] = 1.0f; // a
727
        }
728 719

  
729 720
      numVertices = buildFrontBackGrid(true, numVertices,positionData,normalData,textureData);
730 721
      
......
741 732
      android.util.Log.d("CUBES", "normal: "  +debug(  normalData,3) );
742 733
      android.util.Log.d("CUBES", "texture: " +debug( textureData,2) );
743 734
      */
744
      mGridColors = ByteBuffer.allocateDirect(COLOR_DATA_SIZE*dataLength*BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();                                                        
745
      mGridColors.put(colorData).position(0); 
746 735

  
747 736
      mGridPositions = ByteBuffer.allocateDirect(POSITION_DATA_SIZE*dataLength*BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();                                                        
748 737
      mGridPositions.put(positionData).position(0); 

Also available in: Unified diff