Exemplo n.º 1
0
 @Override
 public Polygon construct(
     Polygon out, float x, float y, float z, float width, float height, Plane plane) {
   Vector pos = new Vector(x, y, z);
   for (int i = 0; i < lod; i++) {
     Vector v = plane.map(width * trigs[lod + i], height * trigs[i]);
     v = Vector.add(v, pos, v);
     out.vertices[i] = new Vertex3D(v);
   }
   return out;
 }
Exemplo n.º 2
0
 @Override
 public Polygon construct(
     Polygon out,
     Image texture,
     float x,
     float y,
     float z,
     float width,
     float height,
     Plane plane) {
   Vector pos = new Vector(x, y, z);
   for (int i = 0; i < lod; i++) {
     Vector v = plane.map(width * trigs[lod + i], height * trigs[i]);
     Vector2 texV = new Vector2(0.5f + (trigs[lod + i] / 2), 0.5f + (trigs[i] / 2));
     v = Vector.add(v, pos, v);
     texV = texture.transformCoords(texV, texV);
     out.vertices[i] = new Vertex3D(v, texV);
   }
   return out;
 }