Project

General

Profile

« Previous | Next » 

Revision 04a21ed6

Added by Leszek Koltunski over 3 years ago

Progress with bandaged cubes.

View differences:

src/main/java/org/distorted/examples/meshfile/FactoryCubit.java
2015 2015
    VertexEffect[] effects = createCuboidEffects(dimensions);
2016 2016
    for( VertexEffect effect : effects ) mesh.apply(effect);
2017 2017

  
2018
    int X = dimensions[0];
2019
    int Y = dimensions[1];
2020
    int Z = dimensions[2];
2021

  
2022
    float strength = 0.04f;
2023
    float radius   = 0.15f;
2024

  
2025
    Static3D[] vertices = new Static3D[1];
2026
    Static3D center;
2027

  
2028
    vertices[0] = new Static3D(+0.5f*X,+0.5f*Y,+0.5f*Z);
2029
    center = new Static3D(+0.5f*(X-1),+0.5f*(Y-1),+0.5f*(Z-1));
2030
    roundCorners(mesh, center, vertices, strength, radius);
2031

  
2032
    vertices[0] = new Static3D(+0.5f*X,+0.5f*Y,-0.5f*Z);
2033
    center = new Static3D(+0.5f*(X-1),+0.5f*(Y-1),-0.5f*(Z-1));
2034
    roundCorners(mesh, center, vertices, strength, radius);
2035

  
2036
    vertices[0] = new Static3D(+0.5f*X,-0.5f*Y,+0.5f*Z);
2037
    center = new Static3D(+0.5f*(X-1),-0.5f*(Y-1),+0.5f*(Z-1));
2038
    roundCorners(mesh, center, vertices, strength, radius);
2039

  
2040
    vertices[0] = new Static3D(+0.5f*X,-0.5f*Y,-0.5f*Z);
2041
    center = new Static3D(+0.5f*(X-1),-0.5f*(Y-1),-0.5f*(Z-1));
2042
    roundCorners(mesh, center, vertices, strength, radius);
2043

  
2044
    vertices[0] = new Static3D(-0.5f*X,+0.5f*Y,+0.5f*Z);
2045
    center = new Static3D(-0.5f*(X-1),+0.5f*(Y-1),+0.5f*(Z-1));
2046
    roundCorners(mesh, center, vertices, strength, radius);
2047

  
2048
    vertices[0] = new Static3D(-0.5f*X,+0.5f*Y,-0.5f*Z);
2049
    center = new Static3D(-0.5f*(X-1),+0.5f*(Y-1),-0.5f*(Z-1));
2050
    roundCorners(mesh, center, vertices, strength, radius);
2051

  
2052
    vertices[0] = new Static3D(-0.5f*X,-0.5f*Y,+0.5f*Z);
2053
    center = new Static3D(-0.5f*(X-1),-0.5f*(Y-1),+0.5f*(Z-1));
2054
    roundCorners(mesh, center, vertices, strength, radius);
2055

  
2056
    vertices[0] = new Static3D(-0.5f*X,-0.5f*Y,-0.5f*Z);
2057
    center = new Static3D(-0.5f*(X-1),-0.5f*(Y-1),-0.5f*(Z-1));
2058
    roundCorners(mesh, center, vertices, strength, radius);
2059

  
2018 2060
  //  mesh.mergeEffComponents();
2019 2061

  
2020 2062
    return mesh;
src/main/java/org/distorted/examples/meshfile/MeshFileRenderer.java
133 133
      if( mTexture==null ) mTexture = new DistortedTexture();
134 134

  
135 135
      Effect.enableEffects(EffectType.VERTEX);
136
      DistortedLibrary.setMax(EffectType.VERTEX, 10);
136
      DistortedLibrary.setMax(EffectType.VERTEX, 20);
137 137
      DistortedLibrary.needTransformFeedback();
138 138
      DistortedLibrary.onSurfaceCreated(mView.getContext(), this);
139 139
      }
......
328 328

  
329 329
    private void createMesh()
330 330
      {
331
      int[] dimensions = new int[] {1,2,3};
331
      int[] dimensions = new int[] {1,1,1};
332 332

  
333 333
      FactoryCubit factory = FactoryCubit.getInstance();
334 334
      mMesh = factory.createCuboidMesh(dimensions);

Also available in: Unified diff