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;
|
Progress with bandaged cubes.