Package javax.vecmath

Examples of javax.vecmath.TexCoord3f


/* 1045 */     this.texCoordDim = 3;
/* 1046 */     this.texCoordSets = new TexCoord3f[1][];
/* 1047 */     if (texCoords != null) {
/* 1048 */       TexCoord3f[] tex = new TexCoord3f[texCoords.length];
/* 1049 */       for (int i = 0; i < texCoords.length; i++)
/* 1050 */         tex[i] = new TexCoord3f(texCoords[i]);
/* 1051 */       this.texCoordSets[0] = tex;
/*      */     }
/*      */   }
View Full Code Here


/*      */       }
/* 1107 */       setTextureCoordinates(texCoordSet, tcoords);
/* 1108 */     } else if (this.texCoordDim == 3) {
/* 1109 */       TexCoord3f[] tcoords = new TexCoord3f[texCoords.length / 3];
/* 1110 */       for (int i = 0; i < tcoords.length; i++) {
/* 1111 */         tcoords[i] = new TexCoord3f(texCoords[(i * 3)], texCoords[(i * 3 + 1)], texCoords[(i * 3 + 2)]);
/*      */       }
/*      */
/* 1114 */       setTextureCoordinates(texCoordSet, tcoords);
/* 1115 */     } else if (this.texCoordDim == 4) {
/* 1116 */       TexCoord4f[] tcoords = new TexCoord4f[texCoords.length / 4];
View Full Code Here

/* 1022 */       this.primitiveTexCoords = new TexCoord3f[this.primitiveVertexIndices.length];
/* 1023 */       int[] indices = getPrimitiveTexCoordIndices(index);
/* 1024 */       int vformat = this.geom.getVertexFormat();
/* 1025 */       if ((vformat & 0x80) == 0) {
/* 1026 */         for (int i = 0; i < indices.length; i++) {
/* 1027 */           this.primitiveTexCoords[i] = new TexCoord3f();
/* 1028 */           this.geom.getTextureCoordinate(index, indices[i], this.primitiveTexCoords[i]);
/*      */         }
/*      */
/*      */       }
/* 1032 */       else if ((vformat & 0x100) == 0)
/*      */       {
/* 1034 */         float[] floatTexCoords = this.geom.getTexCoordRefFloat(index);
/* 1035 */         if (floatTexCoords != null) {
/* 1036 */           if ((vformat & 0x20) == 32) {
/* 1037 */             for (int i = 0; i < indices.length; i++) {
/* 1038 */               int val = indices[i] << 1;
/* 1039 */               this.primitiveTexCoords[i] = new TexCoord3f(floatTexCoords[val], floatTexCoords[(val + 1)], 0.0F);
/*      */             }
/*      */
/*      */           }
/*      */           else
/*      */           {
/* 1045 */             for (int i = 0; i < indices.length; i++) {
/* 1046 */               int val = indices[i] * 3;
/* 1047 */               this.primitiveTexCoords[i] = new TexCoord3f(floatTexCoords[val], floatTexCoords[(val + 1)], floatTexCoords[(val + 2)]);
/*      */             }
/*      */           }
/*      */
/*      */         }
/*      */         else
/*      */         {
/* 1054 */           TexCoord2f[] texCoord2f = this.geom.getTexCoordRef2f(index);
/* 1055 */           if (texCoord2f != null) {
/* 1056 */             for (int i = 0; i < indices.length; i++) {
/* 1057 */               this.primitiveTexCoords[i] = new TexCoord3f(texCoord2f[indices[i]].x, texCoord2f[indices[i]].y, 0.0F);
/*      */             }
/*      */
/*      */           }
/*      */           else
/*      */           {
/* 1063 */             TexCoord3f[] texCoord3f = this.geom.getTexCoordRef3f(index);
/* 1064 */             for (int i = 0; i < indices.length; i++) {
/* 1065 */               this.primitiveTexCoords[i] = new TexCoord3f(texCoord3f[indices[i]].x, texCoord3f[indices[i]].y, texCoord3f[indices[i]].z);
/*      */             }
/*      */           }
/*      */
/*      */         }
/*      */
/*      */       }
/*      */       else
/*      */       {
/* 1074 */         float[] floatData = this.geom.getInterleavedVertices();
/* 1075 */         int stride = getInterleavedStride(this.geom);
/*      */         int offset;
/*      */         int offset;
/* 1078 */         if ((vformat & 0x20) == 32)
/*      */         {
/* 1080 */           offset = index << 1;
/*      */         }
/*      */         else {
/* 1083 */           offset = index * 3;
/*      */         }
/* 1085 */         for (int i = 0; i < indices.length; i++) {
/* 1086 */           int val = stride * indices[i];
/* 1087 */           if ((vformat & 0x20) == 32)
/*      */           {
/* 1089 */             this.primitiveTexCoords[i] = new TexCoord3f(floatData[(val + offset)], floatData[(val + 1 + offset)], 0.0F);
/*      */           }
/*      */           else {
/* 1092 */             this.primitiveTexCoords[i] = new TexCoord3f(floatData[(val + offset)], floatData[(val + 1 + offset)], floatData[(val + 2 + offset)]);
/*      */           }
/*      */         }
/*      */       }
/*      */     }
/*      */
View Full Code Here

/*      */   public TexCoord3f getPointTextureCoordinate(int index)
/*      */   {
/* 1178 */     if ((this.hasTexCoords) && (this.pointTexCoord == null)) {
/* 1179 */       double[] weights = getInterpWeights();
/* 1180 */       TexCoord3f[] texCoords = getPrimitiveTexCoords(index);
/* 1181 */       this.pointTexCoord = new TexCoord3f();
/* 1182 */       for (int i = 0; i < weights.length; i++) {
/* 1183 */         this.pointTexCoord.x += (float)weights[i] * texCoords[i].x;
/* 1184 */         this.pointTexCoord.y += (float)weights[i] * texCoords[i].y;
/* 1185 */         this.pointTexCoord.z += (float)weights[i] * texCoords[i].z;
/*      */       }
View Full Code Here

/* 195 */         geomArray.getTexCoordSetMap(map);
/* 196 */         geomInfo.setTexCoordSetMap(map);
/* 197 */         for (int i = 0; i < texSets; i++) {
/* 198 */           TexCoord3f[] tex = new TexCoord3f[valid];
/* 199 */           for (int j = 0; j < valid; j++) {
/* 200 */             tex[j] = new TexCoord3f(d[(wpv * (j + initial) + offset)], d[(wpv * (j + initial) + offset + 1)], d[(wpv * (j + initial) + offset + 2)]);
/*     */           }
/*     */
/* 204 */           geomInfo.setTextureCoordinates(i, tex);
/* 205 */           offset += 3;
/*     */         }
/* 207 */       } else if ((vertexFormat & 0x400) != 0) {
/* 208 */         geomInfo.setTextureCoordinateParams(texSets, 4);
/* 209 */         int[] map = new int[geomArray.getTexCoordSetMapLength()];
/* 210 */         geomArray.getTexCoordSetMap(map);
/* 211 */         geomInfo.setTexCoordSetMap(map);
/* 212 */         for (int i = 0; i < texSets; i++) {
/* 213 */           TexCoord4f[] tex = new TexCoord4f[valid];
/* 214 */           for (int j = 0; j < valid; j++) {
/* 215 */             tex[j] = new TexCoord4f(d[(wpv * (j + initial) + offset)], d[(wpv * (j + initial) + offset + 1)], d[(wpv * (j + initial) + offset + 2)], d[(wpv * (j + initial) + offset + 3)]);
/*     */           }
/*     */
/* 220 */           geomInfo.setTextureCoordinates(i, tex);
/* 221 */           offset += 4;
/*     */         }
/*     */       }
/*     */
/* 225 */       if ((vertexFormat & 0xC) == 12) {
/* 226 */         Color4f[] color = new Color4f[valid];
/* 227 */         for (int i = 0; i < valid; i++) {
/* 228 */           color[i] = new Color4f(d[(wpv * (i + initial) + offset)], d[(wpv * (i + initial) + offset + 1)], d[(wpv * (i + initial) + offset + 2)], d[(wpv * (i + initial) + offset + 3)]);
/*     */         }
/*     */
/* 233 */         geomInfo.setColors(color);
/* 234 */         offset += 4;
/* 235 */       } else if ((vertexFormat & 0x4) != 0) {
/* 236 */         Color3f[] color = new Color3f[valid];
/* 237 */         for (int i = 0; i < valid; i++) {
/* 238 */           color[i] = new Color3f(d[(wpv * (i + initial) + offset)], d[(wpv * (i + initial) + offset + 1)], d[(wpv * (i + initial) + offset + 2)]);
/*     */         }
/*     */
/* 242 */         geomInfo.setColors(color);
/* 243 */         offset += 3;
/*     */       }
/*     */
/* 246 */       if ((vertexFormat & 0x2) != 0) {
/* 247 */         Vector3f[] normals = new Vector3f[valid];
/* 248 */         for (int i = 0; i < valid; i++) {
/* 249 */           normals[i] = new Vector3f(d[(wpv * (i + initial) + offset)], d[(wpv * (i + initial) + offset + 1)], d[(wpv * (i + initial) + offset + 2)]);
/*     */         }
/*     */
/* 253 */         geomInfo.setNormals(normals);
/* 254 */         offset += 3;
/*     */       }
/*     */
/* 257 */       Point3f[] coords = new Point3f[valid];
/* 258 */       for (int i = 0; i < valid; i++) {
/* 259 */         coords[i] = new Point3f(d[(wpv * (i + initial) + offset)], d[(wpv * (i + initial) + offset + 1)], d[(wpv * (i + initial) + offset + 2)]);
/*     */       }
/*     */
/* 263 */       geomInfo.setCoordinates(coords);
/*     */     }
/*     */     else {
/* 266 */       boolean byRef = (vertexFormat & 0x80) != 0;
/* 267 */       boolean nio = (vertexFormat & 0x800) != 0;
/*     */
/* 269 */       Point3f[] coords = null;
/* 270 */       if (byRef)
/*     */       {
/*     */         int initial;
/*     */         int initial;
/* 273 */         if (!(geomArray instanceof IndexedGeometryArray))
/* 274 */           initial = geomArray.getInitialCoordIndex();
/* 275 */         else initial = 0;
/*     */         int i;
/* 277 */         if (nio) {
/* 278 */           J3DBuffer buf = geomArray.getCoordRefBuffer();
/*     */
/* 280 */           switch (BufferWrapper.getBufferType(buf))
/*     */           {
/*     */           case 3:
/* 283 */             FloatBufferWrapper bb = new FloatBufferWrapper(buf);
/* 284 */             float[] c = new float[valid * 3];
/* 285 */             bb.position(initial * 3);
/* 286 */             bb.get(c, 0, valid * 3);
/* 287 */             coords = new Point3f[valid];
/* 288 */             for (i = 0; i < valid; i++) {
/* 289 */               coords[i] = new Point3f(c[(i * 3 + 0)], c[(i * 3 + 1)], c[(i * 3 + 2)]);
/*     */             }
/*     */
/* 294 */             break;
/*     */           case 4:
/* 297 */             DoubleBufferWrapper bb = new DoubleBufferWrapper(buf);
/* 298 */             double[] c = new double[valid * 3];
/* 299 */             bb.position(initial * 3);
/* 300 */             bb.get(c, 0, valid * 3);
/* 301 */             coords = new Point3f[valid];
/* 302 */             for (i = 0; i < valid; i++) {
/* 303 */               coords[i] = new Point3f((float)c[(i * 3 + 0)], (float)c[(i * 3 + 1)], (float)c[(i * 3 + 2)]);
/*     */             }
/*     */
/*     */           }
/*     */
/*     */         }
/* 310 */         else if (geomArray.getCoordRef3f() != null) {
/* 311 */           if (initial != 0) {
/* 312 */             Point3f[] c = geomArray.getCoordRef3f();
/* 313 */             coords = new Point3f[valid];
/* 314 */             for (i = 0; i < valid; i++)
/* 315 */               coords[i] = new Point3f(c[(i + initial)]);
/*     */           } else {
/* 317 */             coords = geomArray.getCoordRef3f();
/*     */           } } else if (geomArray.getCoordRef3d() != null) {
/* 319 */           Point3d[] c = geomArray.getCoordRef3d();
/* 320 */           coords = new Point3f[valid];
/* 321 */           for (int i = 0; i < valid; i++)
/* 322 */             coords[i] = new Point3f(c[(i + initial)]);
/*     */         }
/* 324 */         else if (geomArray.getCoordRefFloat() != null) {
/* 325 */           float[] c = geomArray.getCoordRefFloat();
/* 326 */           coords = new Point3f[valid];
/* 327 */           for (int i = 0; i < valid; i++) {
/* 328 */             coords[i] = new Point3f(c[((i + initial) * 3)], c[((i + initial) * 3 + 1)], c[((i + initial) * 3 + 2)]);
/*     */           }
/*     */
/*     */         }
/* 332 */         else if (geomArray.getCoordRefDouble() != null) {
/* 333 */           double[] c = geomArray.getCoordRefDouble();
/* 334 */           coords = new Point3f[valid];
/* 335 */           for (int i = 0; i < valid; i++)
/* 336 */             coords[i] = new Point3f((float)c[((i + initial) * 3)], (float)c[((i + initial) * 3 + 1)], (float)c[((i + initial) * 3 + 2)]);
/*     */         }
/*     */       }
/*     */       else
/*     */       {
/*     */         int initial;
/*     */         int initial;
/* 345 */         if (!(geomArray instanceof IndexedGeometryArray))
/* 346 */           initial = geomArray.getInitialVertexIndex();
/* 347 */         else initial = 0;
/* 348 */         coords = new Point3f[valid];
/* 349 */         for (int i = 0; i < valid; i++) coords[i] = new Point3f();
/* 350 */         geomArray.getCoordinates(initial, coords);
/*     */       }
/* 352 */       geomInfo.setCoordinates(coords);
/*     */
/* 354 */       if ((vertexFormat & 0x2) != 0) {
/* 355 */         Vector3f[] normals = null;
/* 356 */         if (byRef)
/*     */         {
/*     */           int initial;
/*     */           int initial;
/* 359 */           if (!(geomArray instanceof IndexedGeometryArray))
/* 360 */             initial = geomArray.getInitialNormalIndex();
/* 361 */           else initial = 0;
/*     */
/* 363 */           if (nio) {
/* 364 */             J3DBuffer buf = geomArray.getNormalRefBuffer();
/*     */
/* 366 */             if (BufferWrapper.getBufferType(buf) == 3) {
/* 367 */               FloatBufferWrapper bb = new FloatBufferWrapper(buf);
/* 368 */               float[] c = new float[valid * 3];
/* 369 */               bb.position(initial * 3);
/* 370 */               bb.get(c, 0, valid * 3);
/* 371 */               normals = new Vector3f[valid];
/* 372 */               for (int i = 0; i < valid; i++) {
/* 373 */                 normals[i] = new Vector3f(c[(i * 3 + 0)], c[(i * 3 + 1)], c[(i * 3 + 2)]);
/*     */               }
/*     */
/*     */             }
/*     */
/*     */           }
/* 379 */           else if (geomArray.getNormalRef3f() != null) {
/* 380 */             if (initial != 0) {
/* 381 */               Vector3f[] n = geomArray.getNormalRef3f();
/* 382 */               normals = new Vector3f[valid];
/* 383 */               for (int i = 0; i < valid; i++)
/* 384 */                 normals[i] = new Vector3f(n[(i + initial)]);
/*     */             } else {
/* 386 */               normals = geomArray.getNormalRef3f();
/*     */             } } else if (geomArray.getNormalRefFloat() != null) {
/* 388 */             float[] n = geomArray.getNormalRefFloat();
/* 389 */             normals = new Vector3f[valid];
/* 390 */             for (int i = 0; i < valid; i++)
/* 391 */               normals[i] = new Vector3f(n[((i + initial) * 3)], n[((i + initial) * 3 + 1)], n[((i + initial) * 3 + 2)]);
/*     */           }
/*     */         }
/*     */         else
/*     */         {
/*     */           int initial;
/*     */           int initial;
/* 400 */           if (!(geomArray instanceof IndexedGeometryArray))
/* 401 */             initial = geomArray.getInitialVertexIndex();
/* 402 */           else initial = 0;
/* 403 */           normals = new Vector3f[valid];
/* 404 */           for (int i = 0; i < valid; i++) normals[i] = new Vector3f();
/* 405 */           geomArray.getNormals(initial, normals);
/*     */         }
/* 407 */         geomInfo.setNormals(normals);
/*     */       }
/*     */
/* 410 */       if ((vertexFormat & 0xC) == 12) {
/* 411 */         Color4f[] colors = null;
/* 412 */         if (byRef)
/*     */         {
/*     */           int initial;
/*     */           int initial;
/* 415 */           if (!(geomArray instanceof IndexedGeometryArray))
/* 416 */             initial = geomArray.getInitialColorIndex();
/* 417 */           else initial = 0;
/*     */           int i;
/* 419 */           if (nio) {
/* 420 */             J3DBuffer buf = geomArray.getColorRefBuffer();
/*     */
/* 422 */             switch (BufferWrapper.getBufferType(buf))
/*     */             {
/*     */             case 3:
/* 425 */               FloatBufferWrapper bb = new FloatBufferWrapper(buf);
/* 426 */               float[] c = new float[valid * 4];
/* 427 */               bb.position(initial * 4);
/* 428 */               bb.get(c, 0, valid * 4);
/* 429 */               colors = new Color4f[valid];
/* 430 */               for (i = 0; i < valid; i++) {
/* 431 */                 colors[i] = new Color4f(c[(i * 4 + 0)], c[(i * 4 + 1)], c[(i * 4 + 2)], c[(i * 4 + 3)]);
/*     */               }
/*     */
/* 437 */               break;
/*     */             case 2:
/* 440 */               ByteBufferWrapper bb = new ByteBufferWrapper(buf);
/* 441 */               byte[] c = new byte[valid * 4];
/* 442 */               bb.position(initial * 4);
/* 443 */               bb.get(c, 0, valid * 4);
/* 444 */               colors = new Color4f[valid];
/* 445 */               for (i = 0; i < valid; i++) {
/* 446 */                 colors[i] = new Color4f((c[(i * 4 + 0)] & 0xFF) / 255.0F, (c[(i * 4 + 1)] & 0xFF) / 255.0F, (c[(i * 4 + 2)] & 0xFF) / 255.0F, (c[(i * 4 + 3)] & 0xFF) / 255.0F);
/*     */               }
/*     */
/*     */             }
/*     */
/*     */           }
/* 454 */           else if (geomArray.getColorRef4f() != null) {
/* 455 */             if (initial != 0) {
/* 456 */               Color4f[] c = geomArray.getColorRef4f();
/* 457 */               colors = new Color4f[valid];
/* 458 */               for (i = 0; i < valid; i++)
/* 459 */                 colors[i] = new Color4f(c[(i + initial)]);
/*     */             } else {
/* 461 */               colors = geomArray.getColorRef4f();
/*     */             } } else if (geomArray.getColorRefFloat() != null) {
/* 463 */             float[] c = geomArray.getColorRefFloat();
/* 464 */             colors = new Color4f[valid];
/* 465 */             for (int i = 0; i < valid; i++) {
/* 466 */               colors[i] = new Color4f(c[((i + initial) * 4 + 0)], c[((i + initial) * 4 + 1)], c[((i + initial) * 4 + 2)], c[((i + initial) * 4 + 3)]);
/*     */             }
/*     */
/*     */           }
/* 471 */           else if (geomArray.getColorRefByte() != null) {
/* 472 */             byte[] c = geomArray.getColorRefByte();
/* 473 */             colors = new Color4f[valid];
/* 474 */             for (int i = 0; i < valid; i++) {
/* 475 */               colors[i] = new Color4f((c[((i + initial) * 4 + 0)] & 0xFF) / 255.0F, (c[((i + initial) * 4 + 1)] & 0xFF) / 255.0F, (c[((i + initial) * 4 + 2)] & 0xFF) / 255.0F, (c[((i + initial) * 4 + 3)] & 0xFF) / 255.0F);
/*     */             }
/*     */
/*     */           }
/* 480 */           else if (geomArray.getColorRef4b() != null) {
/* 481 */             Color4b[] c = geomArray.getColorRef4b();
/* 482 */             colors = new Color4f[valid];
/* 483 */             for (int i = 0; i < valid; i++)
/* 484 */               colors[i] = new Color4f((c[(i + initial)].x & 0xFF) / 255.0F, (c[(i + initial)].y & 0xFF) / 255.0F, (c[(i + initial)].z & 0xFF) / 255.0F, (c[(i + initial)].w & 0xFF) / 255.0F);
/*     */           }
/*     */         }
/*     */         else
/*     */         {
/*     */           int initial;
/*     */           int initial;
/* 494 */           if (!(geomArray instanceof IndexedGeometryArray))
/* 495 */             initial = geomArray.getInitialVertexIndex();
/* 496 */           else initial = 0;
/* 497 */           colors = new Color4f[valid];
/* 498 */           for (int i = 0; i < valid; i++) colors[i] = new Color4f();
/* 499 */           geomArray.getColors(initial, colors);
/*     */         }
/* 501 */         geomInfo.setColors(colors);
/* 502 */       } else if ((vertexFormat & 0x4) != 0) {
/* 503 */         Color3f[] colors = null;
/* 504 */         if (byRef)
/*     */         {
/*     */           int initial;
/*     */           int initial;
/* 507 */           if (!(geomArray instanceof IndexedGeometryArray))
/* 508 */             initial = geomArray.getInitialColorIndex();
/* 509 */           else initial = 0;
/*     */           int i;
/* 511 */           if (nio) {
/* 512 */             J3DBuffer buf = geomArray.getColorRefBuffer();
/*     */
/* 514 */             switch (BufferWrapper.getBufferType(buf))
/*     */             {
/*     */             case 3:
/* 517 */               FloatBufferWrapper bb = new FloatBufferWrapper(buf);
/* 518 */               float[] c = new float[valid * 3];
/* 519 */               bb.position(initial * 3);
/* 520 */               bb.get(c, 0, valid * 3);
/* 521 */               colors = new Color3f[valid];
/* 522 */               for (i = 0; i < valid; i++) {
/* 523 */                 colors[i] = new Color3f(c[(i * 3 + 0)], c[(i * 3 + 1)], c[(i * 3 + 2)]);
/*     */               }
/*     */
/* 528 */               break;
/*     */             case 2:
/* 531 */               ByteBufferWrapper bb = new ByteBufferWrapper(buf);
/* 532 */               byte[] c = new byte[valid * 3];
/* 533 */               bb.position(initial * 3);
/* 534 */               bb.get(c, 0, valid * 3);
/* 535 */               colors = new Color3f[valid];
/* 536 */               for (i = 0; i < valid; i++) {
/* 537 */                 colors[i] = new Color3f((c[(i * 3 + 0)] & 0xFF) / 255.0F, (c[(i * 3 + 1)] & 0xFF) / 255.0F, (c[(i * 3 + 2)] & 0xFF) / 255.0F);
/*     */               }
/*     */
/*     */             }
/*     */
/*     */           }
/* 544 */           else if (geomArray.getColorRef3f() != null) {
/* 545 */             if (initial != 0) {
/* 546 */               Color3f[] c = geomArray.getColorRef3f();
/* 547 */               colors = new Color3f[valid];
/* 548 */               for (i = 0; i < valid; i++)
/* 549 */                 colors[i] = new Color3f(c[(i + initial)]);
/*     */             } else {
/* 551 */               colors = geomArray.getColorRef3f();
/*     */             } } else if (geomArray.getColorRefFloat() != null) {
/* 553 */             float[] c = geomArray.getColorRefFloat();
/* 554 */             colors = new Color3f[valid];
/* 555 */             for (int i = 0; i < valid; i++) {
/* 556 */               colors[i] = new Color3f(c[((i + initial) * 3 + 0)], c[((i + initial) * 3 + 1)], c[((i + initial) * 3 + 2)]);
/*     */             }
/*     */
/*     */           }
/* 560 */           else if (geomArray.getColorRefByte() != null) {
/* 561 */             byte[] c = geomArray.getColorRefByte();
/* 562 */             colors = new Color3f[valid];
/* 563 */             for (int i = 0; i < valid; i++) {
/* 564 */               colors[i] = new Color3f((c[((i + initial) * 3 + 0)] & 0xFF) / 255.0F, (c[((i + initial) * 3 + 1)] & 0xFF) / 255.0F, (c[((i + initial) * 3 + 2)] & 0xFF) / 255.0F);
/*     */             }
/*     */
/*     */           }
/* 568 */           else if (geomArray.getColorRef3b() != null) {
/* 569 */             Color3b[] c = geomArray.getColorRef3b();
/* 570 */             colors = new Color3f[valid];
/* 571 */             for (int i = 0; i < valid; i++)
/* 572 */               colors[i] = new Color3f((c[(i + initial)].x & 0xFF) / 255.0F, (c[(i + initial)].y & 0xFF) / 255.0F, (c[(i + initial)].z & 0xFF) / 255.0F);
/*     */           }
/*     */         }
/*     */         else
/*     */         {
/*     */           int initial;
/*     */           int initial;
/* 581 */           if (!(geomArray instanceof IndexedGeometryArray))
/* 582 */             initial = geomArray.getInitialVertexIndex();
/* 583 */           else initial = 0;
/* 584 */           colors = new Color3f[valid];
/* 585 */           for (int i = 0; i < valid; i++) colors[i] = new Color3f();
/* 586 */           geomArray.getColors(initial, colors);
/*     */         }
/* 588 */         geomInfo.setColors(colors);
/*     */       }
/*     */
/* 591 */       if ((vertexFormat & 0x400) != 0) {
/* 592 */         geomInfo.setTextureCoordinateParams(texSets, 4);
/* 593 */         for (int i = 0; i < texSets; i++) {
/* 594 */           TexCoord4f[] tex = null;
/* 595 */           if (byRef)
/*     */           {
/*     */             int initial;
/*     */             int initial;
/* 598 */             if (!(geomArray instanceof IndexedGeometryArray))
/* 599 */               initial = geomArray.getInitialTexCoordIndex(i);
/* 600 */             else initial = 0;
/*     */
/* 602 */             if (nio) {
/* 603 */               J3DBuffer buf = geomArray.getTexCoordRefBuffer(i);
/*     */
/* 605 */               if (BufferWrapper.getBufferType(buf) == 3) {
/* 606 */                 FloatBufferWrapper bb = new FloatBufferWrapper(buf);
/* 607 */                 float[] c = new float[valid * 4];
/* 608 */                 bb.position(initial * 4);
/* 609 */                 bb.get(c, 0, valid * 4);
/* 610 */                 tex = new TexCoord4f[valid];
/* 611 */                 for (int j = 0; j < valid; j++) {
/* 612 */                   tex[j] = new TexCoord4f(c[(j * 4 + 0)], c[(j * 4 + 1)], c[(j * 4 + 2)], c[(j * 4 + 3)]);
/*     */                 }
/*     */
/*     */               }
/*     */
/*     */             }
/*     */             else
/*     */             {
/* 621 */               float[] t = geomArray.getTexCoordRefFloat(i);
/* 622 */               tex = new TexCoord4f[valid];
/* 623 */               for (int j = 0; j < valid; j++)
/* 624 */                 tex[j] = new TexCoord4f(t[((j + initial) * 4)], t[((j + initial) * 4 + 1)], t[((j + initial) * 4 + 2)], t[((j + initial) * 4 + 3)]);
/*     */             }
/*     */           }
/*     */           else
/*     */           {
/*     */             int initial;
/*     */             int initial;
/* 633 */             if (!(geomArray instanceof IndexedGeometryArray))
/* 634 */               initial = geomArray.getInitialVertexIndex();
/* 635 */             else initial = 0;
/* 636 */             tex = new TexCoord4f[valid];
/* 637 */             for (int j = 0; j < valid; j++) tex[j] = new TexCoord4f();
/* 638 */             geomArray.getTextureCoordinates(i, initial, tex);
/*     */           }
/* 640 */           geomInfo.setTextureCoordinates(i, tex);
/*     */         }
/* 642 */         int[] map = new int[geomArray.getTexCoordSetMapLength()];
/* 643 */         geomArray.getTexCoordSetMap(map);
/* 644 */         geomInfo.setTexCoordSetMap(map);
/* 645 */       } else if ((vertexFormat & 0x40) != 0) {
/* 646 */         geomInfo.setTextureCoordinateParams(texSets, 3);
/* 647 */         for (int i = 0; i < texSets; i++) {
/* 648 */           TexCoord3f[] tex = null;
/* 649 */           if (byRef)
/*     */           {
/*     */             int initial;
/*     */             int initial;
/* 652 */             if (!(geomArray instanceof IndexedGeometryArray))
/* 653 */               initial = geomArray.getInitialTexCoordIndex(i);
/* 654 */             else initial = 0;
/*     */
/* 656 */             if (nio) {
/* 657 */               J3DBuffer buf = geomArray.getTexCoordRefBuffer(i);
/*     */
/* 659 */               if (BufferWrapper.getBufferType(buf) == 3) {
/* 660 */                 FloatBufferWrapper bb = new FloatBufferWrapper(buf);
/* 661 */                 float[] c = new float[valid * 3];
/* 662 */                 bb.position(initial * 3);
/* 663 */                 bb.get(c, 0, valid * 3);
/* 664 */                 tex = new TexCoord3f[valid];
/* 665 */                 for (int j = 0; j < valid; j++) {
/* 666 */                   tex[j] = new TexCoord3f(c[(j * 3 + 0)], c[(j * 3 + 1)], c[(j * 3 + 2)]);
/*     */                 }
/*     */
/*     */               }
/*     */
/*     */             }
/* 672 */             else if (geomArray.getTexCoordRef3f(i) != null) {
/* 673 */               if (initial != 0) {
/* 674 */                 TexCoord3f[] t = geomArray.getTexCoordRef3f(i);
/* 675 */                 tex = new TexCoord3f[valid];
/* 676 */                 for (int j = 0; j < valid; j++)
/* 677 */                   tex[j] = new TexCoord3f(t[(j + initial)]);
/*     */               } else {
/* 679 */                 tex = geomArray.getTexCoordRef3f(i);
/*     */               } } else if (geomArray.getTexCoordRefFloat(i) != null) {
/* 681 */               float[] t = geomArray.getTexCoordRefFloat(i);
/* 682 */               tex = new TexCoord3f[valid];
/* 683 */               for (int j = 0; j < valid; j++)
/* 684 */                 tex[j] = new TexCoord3f(t[((j + initial) * 3)], t[((j + initial) * 3 + 1)], t[((j + initial) * 3 + 2)]);
/*     */             }
/*     */           }
/*     */           else
/*     */           {
/*     */             int initial;
/*     */             int initial;
/* 693 */             if (!(geomArray instanceof IndexedGeometryArray))
/* 694 */               initial = geomArray.getInitialVertexIndex();
/* 695 */             else initial = 0;
/* 696 */             tex = new TexCoord3f[valid];
/* 697 */             for (int j = 0; j < valid; j++) tex[j] = new TexCoord3f();
/* 698 */             geomArray.getTextureCoordinates(i, initial, tex);
/*     */           }
/* 700 */           geomInfo.setTextureCoordinates(i, tex);
/*     */         }
/* 702 */         int[] map = new int[geomArray.getTexCoordSetMapLength()];
View Full Code Here

/*  386 */         this.texCoord2fArray = new TexCoord2f[1];
/*  387 */         this.texCoord2fScratch = new TexCoord2f();
/*      */       }
/*  389 */       else if ((vertexFormat & 0x40) != 0) {
/*  390 */         this.texCoord3fArray = new TexCoord3f[1];
/*  391 */         this.texCoord3fScratch = new TexCoord3f();
/*  392 */       } else if ((vertexFormat & 0x400) != 0) {
/*  393 */         this.texCoord4fArray = new TexCoord4f[1];
/*      */       }
/*      */     }
/*      */
View Full Code Here

/*  548 */         this.texCoord2fArray = new TexCoord2f[1];
/*  549 */         this.texCoord2fScratch = new TexCoord2f();
/*      */       }
/*  551 */       else if ((vertexFormat & 0x40) != 0) {
/*  552 */         this.texCoord3fArray = new TexCoord3f[1];
/*  553 */         this.texCoord3fScratch = new TexCoord3f();
/*      */       }
/*  555 */       else if ((vertexFormat & 0x400) != 0) {
/*  556 */         this.texCoord4fArray = new TexCoord4f[1];
/*      */       }
/*      */     }
View Full Code Here

TOP

Related Classes of javax.vecmath.TexCoord3f

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.