.. | .. |
---|
15 | 15 | { |
---|
16 | 16 | this(0, 0); |
---|
17 | 17 | } |
---|
18 | | - |
---|
| 18 | + |
---|
19 | 19 | void SaveSupports() |
---|
20 | 20 | { |
---|
21 | 21 | transientsupport = support; |
---|
.. | .. |
---|
172 | 172 | bufV = other.bufV; |
---|
173 | 173 | bufF = other.bufF; |
---|
174 | 174 | |
---|
175 | | - positions = (float[]) GraphreeD.clone(other.positions); |
---|
176 | | - normals = (float[]) GraphreeD.clone(other.normals); |
---|
177 | | - colors = (float[]) GraphreeD.clone(other.colors); |
---|
178 | | - uvmap = (float[]) GraphreeD.clone(other.uvmap); |
---|
179 | | - triangles = (int[]) GraphreeD.clone(other.triangles); |
---|
| 175 | + positions = (float[]) Grafreed.clone(other.positions); |
---|
| 176 | + normals = (float[]) Grafreed.clone(other.normals); |
---|
| 177 | + colors = (float[]) Grafreed.clone(other.colors); |
---|
| 178 | + uvmap = (float[]) Grafreed.clone(other.uvmap); |
---|
| 179 | + triangles = (int[]) Grafreed.clone(other.triangles); |
---|
180 | 180 | |
---|
181 | | - indices = (int[]) GraphreeD.clone(other.indices); |
---|
| 181 | + indices = (int[]) Grafreed.clone(other.indices); |
---|
182 | 182 | |
---|
183 | | - vertices = (Vector<Vertex>) GraphreeD.clone(other.vertices); |
---|
184 | | - faces = (Vector<Face>) GraphreeD.clone(other.faces); |
---|
| 183 | + vertices = (Vector<Vertex>) Grafreed.clone(other.vertices); |
---|
| 184 | + faces = (Vector<Face>) Grafreed.clone(other.faces); |
---|
185 | 185 | } |
---|
186 | 186 | else |
---|
187 | 187 | { |
---|
.. | .. |
---|
497 | 497 | return dist2; |
---|
498 | 498 | } |
---|
499 | 499 | |
---|
500 | | - static Vertex vertextemp = new Vertex(); |
---|
501 | | - static Vertex vertextemp2 = new Vertex(); |
---|
| 500 | + static Vertex vertextemp = new Vertex(true); |
---|
| 501 | + static Vertex vertextemp2 = new Vertex(true); |
---|
502 | 502 | |
---|
503 | | - static double SEUIL = 0.1; // 0.1 for rag doll; 0.07; |
---|
| 503 | + static double SEUIL = 0.1f; // 0.1 for rag doll; 0.07; |
---|
504 | 504 | |
---|
505 | 505 | // Compute weight of point w/r to this |
---|
506 | 506 | float ComputeWeight(Vertex v, double[][] toRoot, int k) |
---|
.. | .. |
---|
570 | 570 | |
---|
571 | 571 | if (dot > distmax) |
---|
572 | 572 | dot = distmax; |
---|
| 573 | + //return 0; // patch for strange behavior |
---|
573 | 574 | if (dot < -distmax) |
---|
574 | 575 | dot = -distmax; |
---|
| 576 | + //return 0; // patch for strange behavior |
---|
575 | 577 | |
---|
576 | 578 | // v3 = GetVertex(this.startvertices[subsupport] + 16); |
---|
577 | 579 | // |
---|
.. | .. |
---|
609 | 611 | |
---|
610 | 612 | float dist2 = (float)Distance2(v, v2, 1E10, toRoot, k); |
---|
611 | 613 | |
---|
612 | | - if (dist2 >= 2 * SEUIL*SEUIL) // && !CameraPane.CROWD) // weightmode |
---|
| 614 | + double seuil = SEUIL * 2; |
---|
| 615 | + |
---|
| 616 | + if (dist2 >= 2 * seuil*seuil) // && !CameraPane.CROWD) // weightmode |
---|
613 | 617 | return 0; |
---|
614 | 618 | |
---|
615 | | - dist2 /= 2 * SEUIL*SEUIL; // multiplied by two because center of support |
---|
| 619 | + dist2 /= 2 * seuil*seuil; // multiplied by two because center of support |
---|
616 | 620 | // could be far from closest point |
---|
617 | 621 | |
---|
618 | 622 | // dist2 = Math.pow(dist2, 2); |
---|
.. | .. |
---|
786 | 790 | v.weights[k] = other.ComputeWeight(v, toRoot, k); // (float)(supportsize * normalweight * nz / Math.pow(tx*tx+ty*ty+tz*tz, 1)); |
---|
787 | 791 | v.totalweight += v.weights[k]; |
---|
788 | 792 | |
---|
789 | | - if (CameraPane.CROWD) |
---|
| 793 | + if (Globals.CROWD) |
---|
790 | 794 | { |
---|
791 | 795 | // System.out.print("weight = " + v.weights[k]); |
---|
792 | 796 | // System.out.println("; totalweight = " + v.totalweight); |
---|
.. | .. |
---|
946 | 950 | |
---|
947 | 951 | int nbsupports; |
---|
948 | 952 | |
---|
949 | | - SEUIL = 0.1; // aout 2013 |
---|
| 953 | + // sept 2017 SEUIL = 0.1; // aout 2013 |
---|
950 | 954 | |
---|
951 | 955 | supports = InitConnections(other); |
---|
952 | 956 | |
---|
.. | .. |
---|
982 | 986 | |
---|
983 | 987 | int subsupports = 0; |
---|
984 | 988 | |
---|
985 | | - SEUIL = 0.1; // aout 2013 |
---|
| 989 | + // sept 2017 SEUIL = 0.1; // aout 2013 |
---|
986 | 990 | |
---|
987 | 991 | while (subsupports == 0) |
---|
988 | 992 | { |
---|
.. | .. |
---|
1006 | 1010 | |
---|
1007 | 1011 | vect.set(v); |
---|
1008 | 1012 | vect.sub(vect2); |
---|
| 1013 | + |
---|
| 1014 | +// vertextemp.x = other.averagepoints[c*3]; |
---|
| 1015 | +// vertextemp.y = other.averagepoints[c*3+1]; |
---|
| 1016 | +// vertextemp.z = other.averagepoints[c*3+2]; |
---|
| 1017 | +// |
---|
| 1018 | +// Vertex v3 = vertextemp2; |
---|
| 1019 | +// v3.x = other.extremepoints[c*3]; |
---|
| 1020 | +// v3.y = other.extremepoints[c*3+1]; |
---|
| 1021 | +// v3.z = other.extremepoints[c*3+2]; |
---|
| 1022 | +// |
---|
| 1023 | +// vect3.set(v3); // "X" axis apex |
---|
| 1024 | +// vect3.sub(vertextemp); // origin (center) |
---|
| 1025 | +// |
---|
| 1026 | +// double distmax = vect3.length(); |
---|
| 1027 | +// |
---|
| 1028 | +// vect3.set(v2); // "X" axis apex |
---|
| 1029 | +// vect3.sub(vertextemp); // origin (center) |
---|
| 1030 | +// |
---|
| 1031 | +// if (vect3.length() >= distmax) |
---|
| 1032 | +// continue; |
---|
1009 | 1033 | |
---|
1010 | 1034 | if (mindistance > vect.dot(vect)) |
---|
1011 | 1035 | { |
---|
.. | .. |
---|
1017 | 1041 | |
---|
1018 | 1042 | subsupports = v.closestsupport==-1 ? 0 : supports[v.closestsupport].Length(); |
---|
1019 | 1043 | |
---|
1020 | | - SEUIL *= 2; |
---|
| 1044 | + // previously for "contains", now for weights. |
---|
| 1045 | + assert(subsupports > 0); |
---|
| 1046 | + //SEUIL *= 2; |
---|
1021 | 1047 | } |
---|
1022 | 1048 | |
---|
1023 | 1049 | assert(subsupports > 0); |
---|
.. | .. |
---|
1492 | 1518 | InitFaceIndices(); |
---|
1493 | 1519 | } |
---|
1494 | 1520 | |
---|
1495 | | - BoundaryRep rep = (BoundaryRep) GraphreeD.clone(this); |
---|
| 1521 | + BoundaryRep rep = (BoundaryRep) Grafreed.clone(this); |
---|
1496 | 1522 | //float[] v = new float[100]; |
---|
1497 | 1523 | |
---|
1498 | 1524 | for (int loops=1; --loops>=0;) |
---|
.. | .. |
---|
1522 | 1548 | InitFaceIndices(); |
---|
1523 | 1549 | } |
---|
1524 | 1550 | |
---|
1525 | | - BoundaryRep rep = (BoundaryRep) GraphreeD.clone(this); |
---|
| 1551 | + BoundaryRep rep = (BoundaryRep) Grafreed.clone(this); |
---|
1526 | 1552 | //float[] v = new float[100]; |
---|
1527 | 1553 | |
---|
1528 | 1554 | for (int loops=10; --loops>=0;) |
---|
.. | .. |
---|
2163 | 2189 | // if (slow) |
---|
2164 | 2190 | // aout 2013 |
---|
2165 | 2191 | // sept 2013 merde... |
---|
2166 | | - W = 13; |
---|
| 2192 | + W = 3; // 13; |
---|
2167 | 2193 | |
---|
2168 | 2194 | // POSERATE |
---|
2169 | 2195 | if (CameraPane.tickcount > 0 || CameraPane.SLOWPOSE) |
---|
.. | .. |
---|
2600 | 2626 | // if (stepout && !playedonce) |
---|
2601 | 2627 | // { |
---|
2602 | 2628 | // // sound |
---|
2603 | | -// GraphreeD.wav.play(); |
---|
| 2629 | +// GrafreeD.wav.play(); |
---|
2604 | 2630 | // playedonce = true; |
---|
2605 | 2631 | // } |
---|
2606 | 2632 | // |
---|
.. | .. |
---|
2635 | 2661 | if (false) // slow && stepout && onein) |
---|
2636 | 2662 | { |
---|
2637 | 2663 | // sound |
---|
2638 | | - cVector eye = CameraPane.theRenderer.eyeCamera.location; |
---|
| 2664 | + cVector eye = Globals.theRenderer.EyeCamera().location; |
---|
2639 | 2665 | |
---|
2640 | 2666 | Vertex v = GetVertex(0); |
---|
2641 | 2667 | |
---|
2642 | 2668 | tmp.set(v); |
---|
2643 | 2669 | tmp.sub(eye); |
---|
2644 | 2670 | |
---|
2645 | | - if (CameraPane.framecount - lastsoundtime > 30) // 0.25 secs |
---|
| 2671 | + if (Globals.framecount - lastsoundtime > 30) // 0.25 secs |
---|
2646 | 2672 | { |
---|
2647 | | - GraphreeD.wav.play((Math.random()+0.5)/Math.max(tmp.length2(),0.2)); //, 1); |
---|
| 2673 | + Grafreed.wav.play((Math.random()+0.5)/Math.max(tmp.length2(),0.2)); //, 1); |
---|
2648 | 2674 | |
---|
2649 | | - lastsoundtime = CameraPane.framecount; |
---|
| 2675 | + lastsoundtime = Globals.framecount; |
---|
2650 | 2676 | } |
---|
2651 | 2677 | |
---|
2652 | 2678 | stepout = false; |
---|
.. | .. |
---|
3129 | 3155 | */ |
---|
3130 | 3156 | } |
---|
3131 | 3157 | |
---|
3132 | | - void GenUV() |
---|
| 3158 | + void UnfoldUV() |
---|
| 3159 | + { |
---|
| 3160 | + for (int i = 0; i < VertexCount(); i++) |
---|
| 3161 | + { |
---|
| 3162 | + Vertex v = GetVertex(i); |
---|
| 3163 | + |
---|
| 3164 | + v.x = v.s; |
---|
| 3165 | + v.y = v.t; |
---|
| 3166 | + v.z = 0; |
---|
| 3167 | + |
---|
| 3168 | + v.norm.x = 0; |
---|
| 3169 | + v.norm.y = 0; |
---|
| 3170 | + v.norm.z = 1; |
---|
| 3171 | + |
---|
| 3172 | + SetVertex(v, i); |
---|
| 3173 | + } |
---|
| 3174 | + } |
---|
| 3175 | + |
---|
| 3176 | + float power = 2; |
---|
| 3177 | + |
---|
| 3178 | + void GenUV() // float power) |
---|
3133 | 3179 | { |
---|
3134 | 3180 | Trim(); |
---|
3135 | 3181 | |
---|
.. | .. |
---|
3193 | 3239 | y -= 0.5; |
---|
3194 | 3240 | z -= 0.5; |
---|
3195 | 3241 | |
---|
| 3242 | + double ax = Math.abs(x); |
---|
| 3243 | + double ay = Math.abs(y); |
---|
| 3244 | + double max = ax; |
---|
| 3245 | + if (max < ay) |
---|
| 3246 | + { |
---|
| 3247 | + max = ay; |
---|
| 3248 | + } |
---|
| 3249 | + |
---|
| 3250 | + if (max == 0) |
---|
| 3251 | + { |
---|
| 3252 | + uvmap[i2] = 0.5f; |
---|
| 3253 | + uvmap[i2+1] = 0.5f; |
---|
| 3254 | + continue; |
---|
| 3255 | + } |
---|
| 3256 | + |
---|
| 3257 | + x /= max; |
---|
| 3258 | + y /= max; |
---|
| 3259 | + |
---|
| 3260 | + double angle = Math.acos(Math.abs(z*2)); |
---|
| 3261 | + |
---|
| 3262 | + double k = angle / Math.PI * 2; |
---|
| 3263 | + |
---|
| 3264 | + assert(k >= 0); |
---|
| 3265 | + |
---|
| 3266 | + // k == 0 => uv = 0 (center) |
---|
| 3267 | + // k == 1 => uv = -1,1 (border) |
---|
| 3268 | + |
---|
| 3269 | + if (i == 0) |
---|
| 3270 | + System.out.println("power = " + power); |
---|
| 3271 | + |
---|
| 3272 | + double length1 = (ax+ay)/max; |
---|
| 3273 | + double length2 = Math.sqrt(ax*ax + ay*ay) / max; |
---|
| 3274 | + |
---|
| 3275 | + double t = k; |
---|
| 3276 | + |
---|
| 3277 | + t = Math.pow(t, 3); |
---|
| 3278 | + |
---|
| 3279 | + // Interpolate between k/length2 (center) and k (border) |
---|
| 3280 | + if (length2 > 0) |
---|
| 3281 | + k *= (1 - t) / length2 + t; |
---|
| 3282 | + |
---|
| 3283 | + double u = k*x; |
---|
| 3284 | + double v = k*y; |
---|
| 3285 | + |
---|
| 3286 | + u /= 2; |
---|
| 3287 | + v /= 2; |
---|
| 3288 | + u += 0.5; |
---|
| 3289 | + v += 0.5; |
---|
| 3290 | + |
---|
| 3291 | + uvmap[i2] = (float) u; |
---|
| 3292 | + uvmap[i2+1] = (float) v; |
---|
| 3293 | + } |
---|
| 3294 | + } |
---|
| 3295 | + |
---|
| 3296 | + void GenUVold(float power) |
---|
| 3297 | + { |
---|
| 3298 | + Trim(); |
---|
| 3299 | + |
---|
| 3300 | + cVector boxcenter = null; |
---|
| 3301 | + cVector minima, maxima; |
---|
| 3302 | + minima = new cVector(); |
---|
| 3303 | + maxima = new cVector(); |
---|
| 3304 | + minima.x = minima.y = minima.z = Double.MAX_VALUE; |
---|
| 3305 | + maxima.x = maxima.y = maxima.z = -Double.MAX_VALUE; |
---|
| 3306 | + for (int i = 0; i < VertexCount(); i++) |
---|
| 3307 | + { |
---|
| 3308 | + Vertex v = GetVertex(i); |
---|
| 3309 | + |
---|
| 3310 | + if (minima.x > v.x) |
---|
| 3311 | + { |
---|
| 3312 | + minima.x = v.x; |
---|
| 3313 | + } |
---|
| 3314 | + if (minima.y > v.y) |
---|
| 3315 | + { |
---|
| 3316 | + minima.y = v.y; |
---|
| 3317 | + } |
---|
| 3318 | + if (minima.z > v.z) |
---|
| 3319 | + { |
---|
| 3320 | + minima.z = v.z; |
---|
| 3321 | + } |
---|
| 3322 | + |
---|
| 3323 | + if (maxima.x < v.x) |
---|
| 3324 | + { |
---|
| 3325 | + maxima.x = v.x; |
---|
| 3326 | + } |
---|
| 3327 | + if (maxima.y < v.y) |
---|
| 3328 | + { |
---|
| 3329 | + maxima.y = v.y; |
---|
| 3330 | + } |
---|
| 3331 | + if (maxima.z < v.z) |
---|
| 3332 | + { |
---|
| 3333 | + maxima.z = v.z; |
---|
| 3334 | + } |
---|
| 3335 | + } |
---|
| 3336 | + |
---|
| 3337 | + boxcenter = new cVector((maxima.x + minima.x) / 2, (maxima.y + minima.y) / 2, (maxima.z + minima.z) / 2); |
---|
| 3338 | + int i2 = 0, i3 = 0; |
---|
| 3339 | + for (int i = 0; i < positions.length/3; i++, i3 += 3, i2 += 2) |
---|
| 3340 | + { |
---|
| 3341 | +// //uvmap[i2] = (float) normals[i3]*0.5f + 0.5f; // v.x; |
---|
| 3342 | +// //uvmap[i2 + 1] = (float) normals[i3+1]*0.5f + 0.5f; //z; |
---|
| 3343 | +// uvmap[i2] = (float) (positions[i3] - boxcenter.x); |
---|
| 3344 | +// uvmap[i2 + 1] = (float) (positions[i3+2] - boxcenter.z); |
---|
| 3345 | +// uvmap[i2] = (float) Math.atan2(positions[i3+1] - boxcenter.y, positions[i3] - boxcenter.x); |
---|
| 3346 | +// uvmap[i2 + 1] = (float)(positions[i3+2] - boxcenter.z); |
---|
| 3347 | + // box UV |
---|
| 3348 | + double x = positions[i3] - minima.x; // - Math.floor(positions[i3]); |
---|
| 3349 | + double y = positions[i3+1] - minima.y; // - Math.floor(positions[i3+1]); |
---|
| 3350 | + double z = positions[i3+2] - minima.z; // - Math.floor(positions[i3+2]); |
---|
| 3351 | + |
---|
| 3352 | + // [-1/2, 1/2] |
---|
| 3353 | + x /= maxima.x - minima.x; |
---|
| 3354 | + y /= maxima.y - minima.y; |
---|
| 3355 | + z /= maxima.z - minima.z; |
---|
| 3356 | + |
---|
| 3357 | + x -= 0.5; |
---|
| 3358 | + y -= 0.5; |
---|
| 3359 | + z -= 0.5; |
---|
| 3360 | + |
---|
3196 | 3361 | // x *= 2; |
---|
3197 | 3362 | // y *= 2; |
---|
3198 | 3363 | // z *= 2; |
---|
.. | .. |
---|
3219 | 3384 | |
---|
3220 | 3385 | z = Math.cos(angle/2); |
---|
3221 | 3386 | |
---|
| 3387 | + assert(z >= 0); |
---|
| 3388 | + assert(z <= 1); |
---|
| 3389 | + |
---|
| 3390 | + /**/ |
---|
| 3391 | + //z = Math.pow(z, power); //1.08f); |
---|
| 3392 | + |
---|
| 3393 | + if (i == 0) |
---|
| 3394 | + System.out.println("power = " + power); |
---|
| 3395 | + |
---|
3222 | 3396 | // sqrt(k2*x2 + k2*z2 + y2) = length |
---|
3223 | 3397 | // k2*x2 + k2*z2 = length2 - y2 |
---|
3224 | 3398 | // k2 = (length2 - y2) / (x2 + z2) |
---|
.. | .. |
---|
3229 | 3403 | k /= x*x + y*y; |
---|
3230 | 3404 | } |
---|
3231 | 3405 | else |
---|
3232 | | - GraphreeD.Assert(z == 1); |
---|
| 3406 | + Grafreed.Assert(z == 1); |
---|
3233 | 3407 | |
---|
3234 | 3408 | if (k < 0) |
---|
3235 | 3409 | k = 0; |
---|
.. | .. |
---|
3238 | 3412 | |
---|
3239 | 3413 | x *= k; |
---|
3240 | 3414 | y *= k; |
---|
| 3415 | + /**/ |
---|
3241 | 3416 | |
---|
3242 | 3417 | double max = Math.abs(x); |
---|
3243 | 3418 | if (max < Math.abs(y)) |
---|
.. | .. |
---|
3250 | 3425 | } |
---|
3251 | 3426 | |
---|
3252 | 3427 | // max = Math.sqrt(max*2)/2; |
---|
| 3428 | +// double x2 = Math.pow(Math.abs(x), 1/power); |
---|
| 3429 | +// double y2 = Math.pow(Math.abs(y), 1/power); |
---|
| 3430 | +// double z2 = Math.pow(Math.abs(z), 1/power); |
---|
| 3431 | +// max = Math.pow(x2 + y2 + z2, power); |
---|
3253 | 3432 | |
---|
3254 | 3433 | // if (!(max > 0)) |
---|
3255 | | - assert(max > 0); |
---|
3256 | | - |
---|
| 3434 | + //assert(max > 0); |
---|
| 3435 | + assert(max >= 0); |
---|
| 3436 | + |
---|
3257 | 3437 | x /= max; |
---|
3258 | 3438 | y /= max; |
---|
3259 | 3439 | z /= max; |
---|
.. | .. |
---|
3531 | 3711 | e.printStackTrace(); |
---|
3532 | 3712 | } |
---|
3533 | 3713 | |
---|
3534 | | - Trim(wastrim,true,crease,wasstrip,false); |
---|
| 3714 | + Trim(true/*wastrim*/,true,crease,wasstrip,false); |
---|
3535 | 3715 | } |
---|
3536 | 3716 | |
---|
3537 | 3717 | void GenNormalsJME() |
---|
.. | .. |
---|
3722 | 3902 | tsa.getNormals(0, normals); |
---|
3723 | 3903 | tsa.getTextureCoordinates(0, 0, uvmap); |
---|
3724 | 3904 | // tsa.getColors(0, colors); |
---|
| 3905 | + |
---|
| 3906 | + for (int i=colors.length; --i>=0;) |
---|
| 3907 | + { |
---|
| 3908 | + colors[i] = 1; |
---|
| 3909 | + } |
---|
3725 | 3910 | |
---|
3726 | 3911 | int stripcount = tsa.getNumStrips(); |
---|
3727 | 3912 | triangles = new int[stripcount]; |
---|
.. | .. |
---|
3776 | 3961 | for (int i = 0; i < VertexCount(); i++) |
---|
3777 | 3962 | { |
---|
3778 | 3963 | Vertex v = GetVertex(i); |
---|
| 3964 | + |
---|
| 3965 | + vertextemp.set(v); |
---|
| 3966 | + |
---|
3779 | 3967 | //if (v.norm.x == 0 && v.norm.y == 0 && v.norm.z == 0) |
---|
3780 | 3968 | { |
---|
3781 | | - GenerateNormal(i, v); |
---|
3782 | | - SetVertex(v, i); |
---|
| 3969 | + if (!GenerateNormal(i, vertextemp)) |
---|
| 3970 | + continue; |
---|
| 3971 | + |
---|
| 3972 | + if (v.norm.dot(vertextemp.norm) < 0) |
---|
| 3973 | + vertextemp.norm.mul(-1); |
---|
| 3974 | + |
---|
| 3975 | + if (v.norm.dot(vertextemp.norm) < 0.9) |
---|
| 3976 | + SetVertex(vertextemp, i); |
---|
3783 | 3977 | } |
---|
3784 | 3978 | } |
---|
3785 | 3979 | |
---|
.. | .. |
---|
3790 | 3984 | static cVector temp2 = new cVector(); |
---|
3791 | 3985 | static cVector temp3 = new cVector(); |
---|
3792 | 3986 | |
---|
3793 | | - void GenerateNormal(int index, Vertex v) |
---|
| 3987 | + boolean GenerateNormal(int index, Vertex v) |
---|
3794 | 3988 | { |
---|
3795 | 3989 | //System.out.println("Old normal = " + v.norm); |
---|
3796 | 3990 | LA.setVector(v.norm, 0, 0, 0); |
---|
.. | .. |
---|
3819 | 4013 | LA.vecSub(p/*.pos*/, v/*.pos*/, temp1); |
---|
3820 | 4014 | LA.vecSub(q/*.pos*/, v/*.pos*/, temp2); |
---|
3821 | 4015 | } |
---|
| 4016 | + else |
---|
| 4017 | + { |
---|
| 4018 | + continue; |
---|
| 4019 | + } |
---|
3822 | 4020 | |
---|
3823 | 4021 | //LA.vecNormalize(temp1); |
---|
3824 | 4022 | //LA.vecNormalize(temp2); |
---|
.. | .. |
---|
3829 | 4027 | double s = temp3.length(); |
---|
3830 | 4028 | //double c = temp2.dot(temp1); |
---|
3831 | 4029 | |
---|
| 4030 | + if (s == 0) |
---|
| 4031 | + return false; |
---|
| 4032 | + |
---|
3832 | 4033 | float angle = 1; // (float) Math.atan2(s, c); |
---|
3833 | 4034 | //if(angle < 0) angle = -angle; |
---|
3834 | 4035 | |
---|
3835 | 4036 | //LA.vecNormalize(temp3); |
---|
3836 | 4037 | LA.vecScale(temp3, angle / s); |
---|
3837 | 4038 | |
---|
| 4039 | +// if (temp3.dot(v.norm) < 0) |
---|
| 4040 | +// assert(temp3.dot(v.norm) >= 0); |
---|
| 4041 | + |
---|
3838 | 4042 | LA.vecAdd(temp3, v.norm, v.norm); |
---|
3839 | 4043 | } |
---|
3840 | 4044 | |
---|
3841 | 4045 | LA.vecNormalize(v.norm); |
---|
3842 | 4046 | //System.out.println("New normal = " + v.norm); |
---|
| 4047 | + |
---|
| 4048 | + return true; |
---|
3843 | 4049 | } |
---|
3844 | 4050 | |
---|
3845 | 4051 | double Arccos(double x) |
---|
.. | .. |
---|
4233 | 4439 | int count = VertexCount(); |
---|
4234 | 4440 | |
---|
4235 | 4441 | // mars 2014 |
---|
4236 | | - while (step >= count) |
---|
| 4442 | + while (step > count) |
---|
4237 | 4443 | step /= 10; |
---|
4238 | 4444 | |
---|
4239 | 4445 | for (int i = 0; i < count; i+=step) |
---|
.. | .. |
---|
4381 | 4587 | } |
---|
4382 | 4588 | } |
---|
4383 | 4589 | |
---|
4384 | | - void CullVertex(javax.media.opengl.GL gl, boolean shadow) |
---|
| 4590 | + void CullVertex(javax.media.opengl.GL glNOTUSED, boolean shadowNOTUSED) |
---|
4385 | 4591 | { |
---|
4386 | 4592 | CameraPane.glu.gluProject(vect5.x,vect5.y,vect5.z, |
---|
4387 | 4593 | CameraPane.tempmat,0, CameraPane.tempmat2,0, |
---|
.. | .. |
---|
4413 | 4619 | // june 2014 |
---|
4414 | 4620 | // Camera parentcam = cam; |
---|
4415 | 4621 | // |
---|
4416 | | -// if (cam == CameraPane.theRenderer.cameras[0]) |
---|
| 4622 | +// if (cam == Globals.theRenderer.cameras[0]) |
---|
4417 | 4623 | // { |
---|
4418 | | -// parentcam = CameraPane.theRenderer.cameras[1]; |
---|
| 4624 | +// parentcam = Globals.theRenderer.cameras[1]; |
---|
4419 | 4625 | // } |
---|
4420 | 4626 | // |
---|
4421 | | -// if (cam == CameraPane.theRenderer.cameras[1]) |
---|
| 4627 | +// if (cam == Globals.theRenderer.cameras[1]) |
---|
4422 | 4628 | // { |
---|
4423 | | -// parentcam = CameraPane.theRenderer.cameras[0]; |
---|
| 4629 | +// parentcam = Globals.theRenderer.cameras[0]; |
---|
4424 | 4630 | // } |
---|
4425 | 4631 | |
---|
4426 | 4632 | gl.glGetDoublev(gl.GL_MODELVIEW_MATRIX, CameraPane.tempmat, 0); |
---|
.. | .. |
---|
4846 | 5052 | return verticesCopy; |
---|
4847 | 5053 | } |
---|
4848 | 5054 | |
---|
4849 | | - void PreprocessOcclusion(CameraPane cp, double[][] transform) |
---|
| 5055 | + void PreprocessOcclusion(iCameraPane cp, double[][] transform) |
---|
4850 | 5056 | { |
---|
4851 | 5057 | if (//!trimmed || |
---|
4852 | 5058 | AOdone) |
---|
.. | .. |
---|
4855 | 5061 | return; |
---|
4856 | 5062 | } |
---|
4857 | 5063 | |
---|
4858 | | - Camera keep = cp.renderCamera; |
---|
4859 | | - cp.renderCamera = localcamera; |
---|
4860 | | - |
---|
4861 | | - if (trimmed) |
---|
4862 | | - { |
---|
4863 | | - float[] colors = new float[positions.length / 3]; |
---|
4864 | | - |
---|
4865 | | - int i3 = 0; |
---|
4866 | | - for (int i = 0; i < positions.length / 3; i++, i3 += 3) |
---|
4867 | | - { |
---|
4868 | | - if (normals[i3] == 0 && normals[i3+1] == 0 && normals[i3+2] == 0) |
---|
4869 | | - continue; |
---|
4870 | | - |
---|
4871 | | - from.set(positions[i3], positions[i3 + 1], positions[i3 + 2]); |
---|
4872 | | - to.set(positions[i3] + normals[i3], |
---|
4873 | | - positions[i3 + 1] + normals[i3 + 1], |
---|
4874 | | - positions[i3 + 2] + normals[i3 + 2]); |
---|
4875 | | - LA.xformPos(from, transform, from); |
---|
4876 | | - LA.xformPos(to, transform, to); // RIGID ONLY |
---|
4877 | | - localcamera.setAim(from, to); |
---|
4878 | | - |
---|
4879 | | - CameraPane.occlusionbuffer.display(); |
---|
4880 | | - |
---|
4881 | | - if (CameraPane.DEBUG_OCCLUSION) |
---|
4882 | | - cp.display(); // debug |
---|
4883 | | - |
---|
4884 | | - colors[i] = cp.vertexOcclusion.r; |
---|
4885 | | - //colors[i3 + 1] = cp.vertexOcclusion.g; |
---|
4886 | | - //colors[i3 + 2] = cp.vertexOcclusion.b; |
---|
4887 | | - |
---|
4888 | | - if ((i % 1000) == 0 && i != 0) |
---|
4889 | | - { |
---|
4890 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
4891 | | - //System.out.println("Color = " + cp.vertexOcclusion.r + ", " + cp.vertexOcclusion.g + ", " + cp.vertexOcclusion.b + "; " + (int)(100.0*i/(positions.length/3)) + "% done"); |
---|
4892 | | - System.out.println((int) (100.0 * i / (positions.length / 3)) + "% (" + i + " of " + (positions.length / 3) + ")"); |
---|
4893 | | - } |
---|
4894 | | - } |
---|
4895 | | - |
---|
4896 | | - this.colors = colors; |
---|
4897 | | - } |
---|
4898 | | - else |
---|
4899 | | - { |
---|
4900 | | - for (int i = 0; i < VertexCount(); i++) |
---|
4901 | | - { |
---|
4902 | | - Vertex v = GetVertex(i); |
---|
4903 | | - |
---|
4904 | | - if (v.norm.x == 0 && v.norm.y == 0 && v.norm.z == 0) |
---|
4905 | | - continue; |
---|
4906 | | - |
---|
4907 | | - from.set(v.x, v.y, v.z); |
---|
4908 | | - to.set(v.x+v.norm.x, v.y+v.norm.y, v.z+v.norm.z); |
---|
4909 | | - LA.xformPos(from, transform, from); |
---|
4910 | | - LA.xformPos(to, transform, to); // RIGID ONLY |
---|
4911 | | - localcamera.setAim(from, to); |
---|
4912 | | - |
---|
4913 | | - CameraPane.occlusionbuffer.display(); |
---|
4914 | | - |
---|
4915 | | - if (CameraPane.DEBUG_OCCLUSION) |
---|
4916 | | - cp.display(); // debug |
---|
4917 | | - |
---|
4918 | | - v.AO = cp.vertexOcclusion.r; |
---|
4919 | | - |
---|
4920 | | - if ((i % 1000) == 0 && i != 0) |
---|
4921 | | - { |
---|
4922 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
4923 | | - //System.out.println("Color = " + cp.vertexOcclusion.r + ", " + cp.vertexOcclusion.g + ", " + cp.vertexOcclusion.b + "; " + (int)(100.0*i/(positions.length/3)) + "% done"); |
---|
4924 | | - System.out.println((int) (100.0 * i / VertexCount()) + "% (" + i + " of " + VertexCount() + ")"); |
---|
4925 | | - } |
---|
4926 | | - } |
---|
4927 | | - } |
---|
4928 | | - |
---|
4929 | | - System.out.println("done."); |
---|
4930 | | - |
---|
4931 | | - cp.renderCamera = keep; |
---|
| 5064 | + cp.PrepOcclusion(this, transform); |
---|
4932 | 5065 | |
---|
4933 | 5066 | AOdone = true; |
---|
4934 | 5067 | } |
---|
.. | .. |
---|
5036 | 5169 | } |
---|
5037 | 5170 | } |
---|
5038 | 5171 | colors = null; |
---|
| 5172 | + } |
---|
| 5173 | + |
---|
| 5174 | + void CreateMesh(iHeightField hf, int x, int y) |
---|
| 5175 | + { |
---|
| 5176 | + BoundaryRep tmp = new BoundaryRep(); |
---|
| 5177 | + |
---|
| 5178 | + int vc = 0; |
---|
| 5179 | + |
---|
| 5180 | + Vertex v = new Vertex(true); |
---|
| 5181 | + |
---|
| 5182 | + for (int i=0; i<x; i++) |
---|
| 5183 | + { |
---|
| 5184 | + for (int j=0; j<y; j++) |
---|
| 5185 | + { |
---|
| 5186 | +// Vertex v = tmp.GetVertex(vc++); |
---|
| 5187 | + |
---|
| 5188 | + v.s = v.x = i; |
---|
| 5189 | + v.t = v.z = j; |
---|
| 5190 | + v.s /= x; v.t /= y; |
---|
| 5191 | + v.y = hf.f(i,j); |
---|
| 5192 | + |
---|
| 5193 | + int iu = tmp.AddTableVertex(v); |
---|
| 5194 | + |
---|
| 5195 | + v.s = v.x = i+1; |
---|
| 5196 | + v.t = v.z = j; |
---|
| 5197 | + v.s /= x; v.t /= y; |
---|
| 5198 | + v.y = hf.f(i+1,j); |
---|
| 5199 | + |
---|
| 5200 | + int iv = tmp.AddTableVertex(v); |
---|
| 5201 | + |
---|
| 5202 | + v.s = v.x = i+1; |
---|
| 5203 | + v.t = v.z = j+1; |
---|
| 5204 | + v.s /= x; v.t /= y; |
---|
| 5205 | + v.y = hf.f(i+1,j+1); |
---|
| 5206 | + |
---|
| 5207 | + int iw = tmp.AddTableVertex(v); |
---|
| 5208 | + |
---|
| 5209 | + v.s = v.x = i; |
---|
| 5210 | + v.t = v.z = j+1; |
---|
| 5211 | + v.s /= x; v.t /= y; |
---|
| 5212 | + v.y = hf.f(i,j+1); |
---|
| 5213 | + |
---|
| 5214 | + int ix = tmp.AddTableVertex(v); |
---|
| 5215 | + |
---|
| 5216 | + tmp.AddFace(iu,iw,iv); |
---|
| 5217 | + tmp.AddFace(iu,ix,iw); |
---|
| 5218 | + } |
---|
| 5219 | + } |
---|
| 5220 | + |
---|
| 5221 | + Set(tmp); |
---|
| 5222 | + |
---|
| 5223 | + Trim(true,false,true); |
---|
| 5224 | + ClearColors(); |
---|
5039 | 5225 | } |
---|
5040 | 5226 | |
---|
5041 | 5227 | void Stripify() |
---|
.. | .. |
---|
5297 | 5483 | double minweight = 1E10; |
---|
5298 | 5484 | |
---|
5299 | 5485 | nbbadfaces = 0; |
---|
5300 | | - for (int i=faces.size(); (i-=8)>=0;) |
---|
| 5486 | + for (int i=0; i<faces.size(); i+=8) |
---|
| 5487 | +// for (int i=faces.size(); (i-=8)>=0;) |
---|
5301 | 5488 | { |
---|
5302 | 5489 | Face face = (Face) faces.get(i); |
---|
5303 | | - |
---|
5304 | | - //?? if (face.weight < 0) |
---|
5305 | | - // continue; |
---|
5306 | | - |
---|
5307 | | - double K = 1; // 0.01; // .25; |
---|
5308 | | - |
---|
5309 | | - double factor = (1-K)*face.nbiterations + K; //*face.weight; |
---|
5310 | | - |
---|
5311 | | - double weight = FaceWeight(face); // *Math.pow(PerimeterMax(face),0.25)*factor; |
---|
5312 | 5490 | |
---|
5313 | 5491 | if (!Valid(face)) |
---|
5314 | 5492 | { |
---|
.. | .. |
---|
5327 | 5505 | !ValidValence(face.r)) |
---|
5328 | 5506 | continue; |
---|
5329 | 5507 | |
---|
| 5508 | + //?? if (face.weight < 0) |
---|
| 5509 | + // continue; |
---|
| 5510 | + |
---|
| 5511 | + double K = 1; // 0.01; // .25; |
---|
| 5512 | + |
---|
| 5513 | + double factor = (1-K)*face.nbiterations + K; //*face.weight; |
---|
| 5514 | + |
---|
| 5515 | + double weight = FaceWeight(face); // *Math.pow(PerimeterMax(face),0.25)*factor; |
---|
| 5516 | + |
---|
5330 | 5517 | if (minweight > weight) |
---|
5331 | 5518 | { |
---|
5332 | 5519 | minweight = weight; |
---|
5333 | 5520 | chosen = i; |
---|
| 5521 | + if (minweight == 0) |
---|
| 5522 | + break; |
---|
5334 | 5523 | } |
---|
5335 | 5524 | } |
---|
5336 | 5525 | |
---|
.. | .. |
---|
6170 | 6359 | |
---|
6171 | 6360 | void InitWeights() |
---|
6172 | 6361 | { |
---|
| 6362 | + new Exception().printStackTrace(); |
---|
6173 | 6363 | System.exit(0); |
---|
6174 | 6364 | int n = 0; |
---|
6175 | 6365 | int b = 0; |
---|
.. | .. |
---|
7019 | 7209 | assert(f2.contains(i)); |
---|
7020 | 7210 | assert(f3.contains(i)); |
---|
7021 | 7211 | |
---|
| 7212 | + // when r is the "center", p is along the boundary |
---|
7022 | 7213 | while (f0.r != i) |
---|
7023 | 7214 | { |
---|
7024 | 7215 | int t = f0.p; |
---|
.. | .. |
---|
7075 | 7266 | f0 = f3; |
---|
7076 | 7267 | f3 = t; |
---|
7077 | 7268 | } |
---|
7078 | | - atleastone = true; |
---|
7079 | 7269 | |
---|
| 7270 | + int va = f0.q; |
---|
| 7271 | + int vb = f0.r; |
---|
| 7272 | + int vc = -1; |
---|
| 7273 | + |
---|
| 7274 | + Face toremove1 = null; |
---|
| 7275 | + Face toremove2 = null; |
---|
| 7276 | + |
---|
| 7277 | + // f0 is the buffer for the first new triangle, |
---|
| 7278 | + // and otherf is the other upper one. |
---|
7080 | 7279 | Face otherf = null; |
---|
7081 | 7280 | |
---|
7082 | 7281 | if (f1.contains(f0.p)) |
---|
7083 | 7282 | { |
---|
7084 | 7283 | if (f1.p == f0.p) |
---|
7085 | 7284 | { |
---|
| 7285 | + assert(false); |
---|
7086 | 7286 | f0.r = f1.q; |
---|
7087 | 7287 | } |
---|
7088 | 7288 | else |
---|
7089 | 7289 | { |
---|
7090 | 7290 | assert(f1.q == f0.p); |
---|
7091 | | - f0.r = f1.p; |
---|
| 7291 | + vc = f1.p; |
---|
7092 | 7292 | } |
---|
7093 | 7293 | |
---|
7094 | 7294 | otherf = f2; |
---|
7095 | | - faces.remove(f1); |
---|
7096 | | - faces.remove(f3); |
---|
| 7295 | + toremove1 = f1; |
---|
| 7296 | + toremove2 = f3; |
---|
7097 | 7297 | } |
---|
7098 | 7298 | else |
---|
7099 | 7299 | if (f2.contains(f0.p)) |
---|
7100 | 7300 | { |
---|
7101 | 7301 | if (f2.p == f0.p) |
---|
7102 | 7302 | { |
---|
| 7303 | + assert(false); |
---|
7103 | 7304 | f0.r = f2.q; |
---|
7104 | 7305 | } |
---|
7105 | 7306 | else |
---|
7106 | 7307 | { |
---|
7107 | 7308 | assert(f2.q == f0.p); |
---|
7108 | | - f0.r = f2.p; |
---|
| 7309 | + vc = f2.p; |
---|
7109 | 7310 | } |
---|
7110 | 7311 | |
---|
7111 | 7312 | otherf = f3; |
---|
7112 | | - faces.remove(f1); |
---|
7113 | | - faces.remove(f2); |
---|
| 7313 | + toremove1 = f1; |
---|
| 7314 | + toremove2 = f2; |
---|
7114 | 7315 | } |
---|
7115 | 7316 | if (f3.contains(f0.p)) |
---|
7116 | 7317 | { |
---|
7117 | 7318 | if (f3.p == f0.p) |
---|
7118 | 7319 | { |
---|
| 7320 | +// assert(false); |
---|
| 7321 | + new Exception().printStackTrace(); |
---|
7119 | 7322 | f0.r = f3.q; |
---|
7120 | 7323 | } |
---|
7121 | 7324 | else |
---|
7122 | 7325 | { |
---|
7123 | 7326 | assert(f3.q == f0.p); |
---|
7124 | | - f0.r = f3.p; |
---|
| 7327 | + vc = f3.p; |
---|
7125 | 7328 | } |
---|
7126 | 7329 | |
---|
7127 | 7330 | otherf = f1; |
---|
7128 | | - faces.remove(f2); |
---|
7129 | | - faces.remove(f3); |
---|
| 7331 | + toremove1 = f2; |
---|
| 7332 | + toremove2 = f3; |
---|
7130 | 7333 | } |
---|
| 7334 | + |
---|
| 7335 | + vertextemp.set(vertices.get(va)); |
---|
| 7336 | + vertextemp.sub(vertices.get(vb)); |
---|
| 7337 | + vertextemp.normalize(); |
---|
| 7338 | + vertextemp2.set(vertices.get(vc)); |
---|
| 7339 | + vertextemp2.sub(vertices.get(vb)); |
---|
| 7340 | + vertextemp2.normalize(); |
---|
| 7341 | + |
---|
| 7342 | + if (vertextemp.dot(vertextemp2) > -0.95) |
---|
| 7343 | + { |
---|
| 7344 | + continue; |
---|
| 7345 | + } |
---|
| 7346 | + |
---|
| 7347 | + atleastone = true; |
---|
| 7348 | + |
---|
| 7349 | + f0.r = vc; |
---|
| 7350 | + |
---|
| 7351 | + faces.remove(toremove1); |
---|
| 7352 | + faces.remove(toremove2); |
---|
7131 | 7353 | |
---|
7132 | 7354 | if (!f0.contains(otherf.p)) |
---|
7133 | 7355 | { |
---|
.. | .. |
---|
7335 | 7557 | Trim(); |
---|
7336 | 7558 | Untrim(); |
---|
7337 | 7559 | |
---|
7338 | | - BoundaryRep tmp = new BoundaryRep(); // (BoundaryRep) GraphreeD.clone(this); |
---|
| 7560 | + BoundaryRep tmp = new BoundaryRep(); // (BoundaryRep) GrafreeD.clone(this); |
---|
7339 | 7561 | |
---|
7340 | 7562 | double minx = Float.POSITIVE_INFINITY; |
---|
7341 | 7563 | double maxx = Float.NEGATIVE_INFINITY; |
---|
.. | .. |
---|
7373 | 7595 | if (max < maxz - minz) |
---|
7374 | 7596 | max = maxz - minz; |
---|
7375 | 7597 | |
---|
7376 | | - tmp.THRESHOLD = max/25; // 50; |
---|
| 7598 | + tmp.THRESHOLD = 0.5; // max/25; // 50; |
---|
7377 | 7599 | |
---|
7378 | 7600 | tmp.faces.clear(); |
---|
7379 | 7601 | |
---|
.. | .. |
---|
7498 | 7720 | s3 = new cVector(); |
---|
7499 | 7721 | } |
---|
7500 | 7722 | |
---|
7501 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 7723 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
7502 | 7724 | |
---|
7503 | 7725 | try |
---|
7504 | 7726 | { |
---|
.. | .. |
---|
7593 | 7815 | { |
---|
7594 | 7816 | if (i++%100 == 0) |
---|
7595 | 7817 | { |
---|
7596 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 7818 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
7597 | 7819 | System.out.println("#faces = " + faces.size()); |
---|
7598 | 7820 | // if (i != 1) |
---|
7599 | 7821 | // break; |
---|
.. | .. |
---|
7637 | 7859 | //Trim(true,cJME.gennormals,true,false); // doesn't work |
---|
7638 | 7860 | Trim(true,false,false,false,false); |
---|
7639 | 7861 | |
---|
7640 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 7862 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
7641 | 7863 | } |
---|
7642 | 7864 | |
---|
7643 | 7865 | void UpdateIndices(Face face, Face minface) |
---|
.. | .. |
---|
7932 | 8154 | |
---|
7933 | 8155 | minface.q = minface.r = minface.p; |
---|
7934 | 8156 | |
---|
| 8157 | + int count = 0; |
---|
| 8158 | + |
---|
7935 | 8159 | for (int i=0; i<faces.size(); i++) |
---|
7936 | 8160 | { |
---|
7937 | 8161 | Face face = (Face) faces.get(i); |
---|
.. | .. |
---|
7943 | 8167 | TouchVertex(face.r, true); // , minface.weight); |
---|
7944 | 8168 | // assert(!lock); |
---|
7945 | 8169 | faces.remove(i--); |
---|
| 8170 | + count++; |
---|
| 8171 | + if (count == 4) |
---|
| 8172 | + break; |
---|
7946 | 8173 | } |
---|
7947 | 8174 | } |
---|
7948 | 8175 | |
---|
.. | .. |
---|
8006 | 8233 | if (!trimmed) |
---|
8007 | 8234 | return; |
---|
8008 | 8235 | |
---|
8009 | | - GraphreeD.linkUV = false; |
---|
| 8236 | + Grafreed.linkUV = false; |
---|
8010 | 8237 | |
---|
8011 | 8238 | try |
---|
8012 | 8239 | { |
---|
.. | .. |
---|
8214 | 8441 | return "trim = " + trimmed + "; stripped = " + stripified + "; colors = " + colors + "; faces = " + (faces!=null?faces.size():null) + "; triangles = " + (triangles!=null?triangles.length:null) + "; indices = " + indices; |
---|
8215 | 8442 | } |
---|
8216 | 8443 | |
---|
8217 | | - static Camera localcamera = new Camera(); |
---|
8218 | | - static cVector from = new cVector(); |
---|
8219 | | - static cVector to = new cVector(); |
---|
8220 | 8444 | boolean trimmed = false; |
---|
8221 | 8445 | boolean stripified = false; |
---|
8222 | 8446 | transient boolean AOdone = false; |
---|
.. | .. |
---|
8224 | 8448 | /*transient*/ int maxIndexV = 0; |
---|
8225 | 8449 | /*transient*/ int bufV, bufF; |
---|
8226 | 8450 | // Raw version |
---|
8227 | | - private float[] positions; |
---|
8228 | | - private float[] normals; |
---|
| 8451 | + //private |
---|
| 8452 | + float[] positions; |
---|
| 8453 | + //private |
---|
| 8454 | + float[] normals; |
---|
8229 | 8455 | float[] colors; |
---|
8230 | 8456 | private float[] uvmap; |
---|
8231 | 8457 | private int[] triangles; |
---|