FileDocCategorySizeDatePackage
PointCloud.javaAPI DocAndroid 1.5 API2030Wed May 06 22:41:08 BST 2009com.android.globaltime

PointCloud

public class PointCloud extends Shape
A class representing a set of GL_POINT objects. GlobalTime uses this class to draw city lights on the night side of the earth.

Fields Summary
Constructors Summary
public PointCloud(int[] vertices)
Constructs a PointCloud with a point at each of the given vertex (x, y, z) positions.

param
vertices an array of (x, y, z) positions given in fixed-point.

        this(vertices, 0, vertices.length);
    
public PointCloud(int[] vertices, int off, int len)
Constructs a PointCloud with a point at each of the given vertex (x, y, z) positions.

param
vertices an array of (x, y, z) positions given in fixed-point.
param
off the starting offset of the vertices array
param
len the number of elements of the vertices array to use

        super(GL10.GL_POINTS, GL10.GL_UNSIGNED_SHORT,
              false, false, false);

        int numPoints = len / 3;
        short[] indices = new short[numPoints];
        for (int i = 0; i < numPoints; i++) {
            indices[i] = (short)i;
        }
        
        allocateBuffers(vertices, null, null, null, indices);
        this.mNumIndices = mIndexBuffer.capacity();
    
Methods Summary
public intgetNumTriangles()

        return mNumIndices * 2;