Project

General

Profile

« Previous | Next » 

Revision bebaab7b

Added by Leszek Koltunski over 1 year ago

Support drawing stickers with multiple holes in them.

View differences:

src/main/java/org/distorted/examples/meshfile/MeshFileRenderer.java
48 48
import org.distorted.objectlib.helpers.FactoryCubit;
49 49
import org.distorted.objectlib.helpers.ObjectFaceShape;
50 50
import org.distorted.objectlib.helpers.ObjectShape;
51
import org.distorted.objectlib.helpers.ObjectVertexEffects;
52 51

  
53 52
import java.io.DataInputStream;
54 53
import java.io.IOException;
......
314 313

  
315 314
      float C = 2f;
316 315
      float[] bands = { 1.0f, 0.00f*C, 0.9f, 0.04f*C,  0.8f, 0.07f*C, 0.5f, 0.09f*C, 0.0f, 0.10f*C};
317

  
318 316
/*
319 317
      int numBands      = 5;
320 318
      float[] bands = new float[2*numBands];
......
331 329

  
332 330
///////////////////////////////////////////////////////////////////////////////////////////////////
333 331

  
334
    private float[] gen(float x, float y)
332
    private float[][] gen(float x, float y)
335 333
      {
336
      return new float[] { x+0.1f, y-0.1f, x-0.1f, y-0.1f, x-0.1f, y+0.1f, x+0.1f, y+0.1f };
334
      return new float[][] { {x+0.1f,y-0.1f} , {x-0.1f,y-0.1f} , {x-0.1f,y+0.1f} , {x+0.1f,y+0.1f} };
337 335
      }
338 336

  
339 337
///////////////////////////////////////////////////////////////////////////////////////////////////
......
344 342
      int extraIndex    = 0;
345 343
      int extraVertices = 0;
346 344

  
347
      float[][] vertices = new float[19][];
345
      float[][][] vertices = new float[19][][];
348 346

  
349 347
      vertices[ 0] = gen( 0.4f,-0.4f);
350 348
      vertices[ 1] = gen( 0.2f,-0.4f);

Also available in: Unified diff