• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Point3i类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javax.vecmath.Point3i的典型用法代码示例。如果您正苦于以下问题:Java Point3i类的具体用法?Java Point3i怎么用?Java Point3i使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Point3i类属于javax.vecmath包,在下文中一共展示了Point3i类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: fillEllipsoid

import javax.vecmath.Point3i; //导入依赖的package包/类
public void fillEllipsoid(Point3f center, Point3f[] points, int x, int y,
                            int z, int diameter, Matrix3f mToEllipsoidal,
                            double[] coef, Matrix4f mDeriv,
                            int selectedOctant, Point3i[] octantPoints) {
  switch (diameter) {
  case 1:
    plotPixelClipped(argbCurrent, x, y, z);
    return;
  case 0:
    return;
  }
  if (diameter <= (antialiasThisFrame ? Sphere3D.maxSphereDiameter2
      : Sphere3D.maxSphereDiameter))
    sphere3d.render(shadesCurrent, !addAllPixels, diameter, x, y, z,
        mToEllipsoidal, coef, mDeriv, selectedOctant, octantPoints);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:17,代码来源:Graphics3D.java


示例2: drawTriangle

import javax.vecmath.Point3i; //导入依赖的package包/类
public void drawTriangle(Point3i screenA, Point3i screenB, Point3i screenC,
                         int check) {
  // primary method for unmapped monochromatic Mesh
  if ((check & 1) == 1)
    line3d.plotLine(argbCurrent, !addAllPixels, argbCurrent, !addAllPixels,
        screenA.x, screenA.y, screenA.z, screenB.x, screenB.y, screenB.z,
        true);
  if ((check & 2) == 2)
    line3d.plotLine(argbCurrent, !addAllPixels, argbCurrent, !addAllPixels,
        screenB.x, screenB.y, screenB.z, screenC.x, screenC.y, screenC.z,
        true);
  if ((check & 4) == 4)
    line3d.plotLine(argbCurrent, !addAllPixels, argbCurrent, !addAllPixels,
        screenA.x, screenA.y, screenA.z, screenC.x, screenC.y, screenC.z,
        true);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:17,代码来源:Graphics3D.java


示例3: fillTriangle

import javax.vecmath.Point3i; //导入依赖的package包/类
public void fillTriangle(Point3i screenA, short colixA,
                                 short normixA, Point3i screenB,
                                 short colixB, short normixB,
                                 Point3i screenC, short colixC,
                                 short normixC, float factor) {
  // isosurface test showing triangles
  boolean useGouraud;
  if (!isPass2 && normixA == normixB && normixA == normixC && colixA == colixB
      && colixA == colixC) {
    setTriangleColixAndShadeIndex(colixA, normix3d.getShadeIndex(normixA));
    useGouraud = false;
  } else {
    if (!setTriangleTranslucency(colixA, colixB, colixC))
      return;
    triangle3d.setGouraud(getShades(colixA)[normix3d.getShadeIndex(normixA)],
        getShades(colixB)[normix3d.getShadeIndex(normixB)],
        getShades(colixC)[normix3d.getShadeIndex(normixC)]);
    useGouraud = true;
  }
  triangle3d.fillTriangle(screenA, screenB, screenC, factor,
      useGouraud);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:23,代码来源:Graphics3D.java


示例4: setNoisySurfaceShade

import javax.vecmath.Point3i; //导入依赖的package包/类
/**
 *  used by CartoonRenderer (DNA surface) and GeoSurfaceRenderer (face) to
 *  assign a noisy shade to the surface it will render
 * @param screenA 
 * @param screenB 
 * @param screenC 
 */
public void setNoisySurfaceShade(Point3i screenA, Point3i screenB, Point3i screenC) {
  vectorAB.set(screenB.x - screenA.x, screenB.y - screenA.y, screenB.z
      - screenA.z);
  int shadeIndex;
  if (screenC == null) {
    shadeIndex = Shade3D.getShadeIndex(-vectorAB.x, -vectorAB.y, vectorAB.z);
  } else {
    vectorAC.set(screenC.x - screenA.x, screenC.y - screenA.y, screenC.z
        - screenA.z);
    vectorAB.cross(vectorAB, vectorAC);
    shadeIndex = vectorAB.z >= 0 ? Shade3D.getShadeIndex(-vectorAB.x,
        -vectorAB.y, vectorAB.z) : Shade3D.getShadeIndex(vectorAB.x,
        vectorAB.y, -vectorAB.z);
  }
  if (shadeIndex > Shade3D.shadeIndexNoisyLimit)
    shadeIndex = Shade3D.shadeIndexNoisyLimit;
  setColorNoisy(shadeIndex);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:26,代码来源:Graphics3D.java


示例5: fillTriangle

import javax.vecmath.Point3i; //导入依赖的package包/类
void fillTriangle(Point3i screenA, Point3i screenB, Point3i screenC,
                  float factor, boolean useGouraud) {
  ax[0] = screenA.x;
  ax[1] = screenB.x;
  ax[2] = screenC.x;
  ay[0] = screenA.y;
  ay[1] = screenB.y;
  ay[2] = screenC.y;
  az[0] = screenA.z;
  az[1] = screenB.z;
  az[2] = screenC.z;
  adjustVertex(ax, factor);
  adjustVertex(ay, factor);
  adjustVertex(az, factor);
  fillTriangle(useGouraud);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:17,代码来源:Triangle3D.java


示例6: extractVectorInfo

import javax.vecmath.Point3i; //导入依赖的package包/类
private String extractVectorInfo(String name) {
  // (nx ny nz)  where n is 1/12 of the edge. 
  // also allows for (nz), though that is not standard
  vector12ths = new Point3i();
  vectorCode = "";
  int i = name.indexOf("(");
  int j = name.indexOf(")", i);
  if (i > 0 && j > i) {
    String term = name.substring(i + 1, j);
    vectorCode = " (" + term + ")";
    name = name.substring(0, i).trim();
    i = term.indexOf(" ");
    if (i >= 0) {
      vector12ths.x = Integer.parseInt(term.substring(0, i));
      term = term.substring(i + 1).trim();
      i = term.indexOf(" ");
      if (i >= 0) {
        vector12ths.y = Integer.parseInt(term.substring(0, i));
        term = term.substring(i + 1).trim();
      }
    }
    vector12ths.z = Integer.parseInt(term);
  }
  return name;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:26,代码来源:HallInfo.java


示例7: setMinMaxLatticeParameters

import javax.vecmath.Point3i; //导入依赖的package包/类
void setMinMaxLatticeParameters(Point3i minXYZ, Point3i maxXYZ) {
  if (maxXYZ.x <= 555 && maxXYZ.y >= 555) {
    //alternative format for indicating a range of cells:
    //{111 666}
    //555 --> {0 0 0}
    minXYZ.x = (maxXYZ.x / 100) - 5;
    minXYZ.y = (maxXYZ.x % 100) / 10 - 5;
    minXYZ.z = (maxXYZ.x % 10) - 5;
    //555 --> {1 1 1}
    maxXYZ.x = (maxXYZ.y / 100) - 4;
    maxXYZ.z = (maxXYZ.y % 10) - 4;
    maxXYZ.y = (maxXYZ.y % 100) / 10 - 4;
  }
  switch (dimension) {
  case 1: // polymer
    minXYZ.y = 0;
    maxXYZ.y = 1;
    // fall through
  case 2: // slab
    minXYZ.z = 0;
    maxXYZ.z = 1;
  }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:24,代码来源:UnitCell.java


示例8: renderLine

import javax.vecmath.Point3i; //导入依赖的package包/类
protected void renderLine(Point3f p0, Point3f p1, int diameter,
                          Point3i pt0, Point3i pt1, boolean drawTicks) {
  // used by Bbcage, Uccage, and axes
  pt0.set((int) p0.x, (int) p0.y, (int) p0.z);
  pt1.set((int) p1.x, (int) p1.y, (int) p1.z);
  if (diameter < 0)
    g3d.drawDottedLine(pt0, pt1);
  else
    g3d.fillCylinder(endcap, diameter, pt0, pt1);
  if (!drawTicks || tickInfo == null)
    return;
  // AtomA and AtomB molecular coordinates must be set previously
  atomA.screenX = pt0.x;
  atomA.screenY = pt0.y;
  atomA.screenZ = pt0.z;
  atomB.screenX = pt1.x;
  atomB.screenY = pt1.y;
  atomB.screenZ = pt1.z;
  drawTicks(atomA, atomB, diameter, true);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:21,代码来源:FontLineShapeRenderer.java


示例9: transformScreenPoint

import javax.vecmath.Point3i; //导入依赖的package包/类
private Point3i transformScreenPoint(Point3f ptXyp) {
  // just does the processing for [x y] and [x y %]
  if (ptXyp.z == -Float.MAX_VALUE) {
    point3iScreenTemp.x = (int) (ptXyp.x / 100 * screenWidth);
    point3iScreenTemp.y = (int) ((1 - ptXyp.y / 100) * screenHeight);
  } else {
    point3iScreenTemp.x = (int) ptXyp.x;
    point3iScreenTemp.y = (screenHeight - (int) ptXyp.y);
  }
  if (antialias) {
    point3iScreenTemp.x <<= 1;
    point3iScreenTemp.y <<= 1;
  }
  matrixTransform.transform(fixedRotationCenter, pointTsp);
  point3iScreenTemp.z = (int) pointTsp.z;
  return point3iScreenTemp;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:18,代码来源:TransformManager.java


示例10: tessellate

import javax.vecmath.Point3i; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public void tessellate(VertexBuffer vb){
    vb.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_TEX_NORMAL);
    for (Triple<Point3i, Point3i, Point3i> face : faces) {
        vb.pos(vertices.get(face.getLeft().x).x, vertices.get(face.getLeft().x).y, vertices.get(face.getLeft().x).z)
                .tex(uvs.get(face.getLeft().y).x, uvs.get(face.getLeft().y).y)
                .normal(normals.get(face.getLeft().z).x, normals.get(face.getLeft().z).y, normals.get(face.getLeft().z).z).endVertex();
        vb.pos(vertices.get(face.getMiddle().x).x, vertices.get(face.getMiddle().x).y, vertices.get(face.getMiddle().x).z)
                .tex(uvs.get(face.getMiddle().y).x, uvs.get(face.getMiddle().y).y)
                .normal(normals.get(face.getMiddle().z).x, normals.get(face.getMiddle().z).y, normals.get(face.getMiddle().z).z).endVertex();
        vb.pos(vertices.get(face.getRight().x).x, vertices.get(face.getRight().x).y, vertices.get(face.getRight().x).z)
                .tex(uvs.get(face.getRight().y).x, uvs.get(face.getRight().y).y)
                .normal(normals.get(face.getRight().z).x, normals.get(face.getRight().z).y, normals.get(face.getRight().z).z).endVertex();
    }
}
 
开发者ID:sedlak477,项目名称:MrglgaghCore,代码行数:16,代码来源:OBJModel.java


示例11: render

import javax.vecmath.Point3i; //导入依赖的package包/类
@Override
protected void render() {
  Polyhedra polyhedra = (Polyhedra) shape;
  Polyhedra.Polyhedron[] polyhedrons = polyhedra.polyhedrons;
  drawEdges = polyhedra.drawEdges;
  short[] colixes = polyhedra.colixes;
  Point3i[] screens = null;
  for (int i = polyhedra.polyhedronCount; --i >= 0;) {
    int iAtom = polyhedrons[i].centralAtom.getIndex();
    short colix = (colixes == null || iAtom >= colixes.length ? 
        Graphics3D.INHERIT_ALL : polyhedra.colixes[iAtom]);
    screens = render1(polyhedrons[i], colix, screens);
  }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:15,代码来源:PolyhedraRenderer.java


示例12: render1

import javax.vecmath.Point3i; //导入依赖的package包/类
private Point3i[] render1(Polyhedra.Polyhedron p, short colix, Point3i[] screens) {
  if (p.visibilityFlags == 0)
    return screens;
  colix = Graphics3D.getColixInherited(colix, p.centralAtom.getColix());
  Point3f[] vertices = p.vertices;
  byte[] planes;
  if (screens == null || screens.length < vertices.length) {
    screens = new Point3i[vertices.length];
    for (int i = vertices.length; --i >= 0;)
      screens[i] = new Point3i();
  }
  planes = p.planes;
  for (int i = vertices.length; --i >= 0;) {
    Atom atom = (vertices[i] instanceof Atom ? (Atom) vertices[i] : null);
    if (atom == null)
      viewer.transformPoint(vertices[i], screens[i]);
    else
      screens[i].set(atom.screenX, atom.screenY, atom.screenZ);
  }

  isAll = (drawEdges == Polyhedra.EDGES_ALL);
  frontOnly = (drawEdges == Polyhedra.EDGES_FRONT);

  // no edges to new points when not collapsed
  if (g3d.setColix(colix))
    for (int i = 0, j = 0; j < planes.length;)
      fillFace(p.normixes[i++], screens[planes[j++]], screens[planes[j++]],
          screens[planes[j++]]);
  if (g3d.setColix(Graphics3D.getColixTranslucent(colix, false, 0)))
  for (int i = 0, j = 0; j < planes.length;)
    drawFace(p.normixes[i++], screens[planes[j++]],
        screens[planes[j++]], screens[planes[j++]]);
  return screens;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:35,代码来源:PolyhedraRenderer.java


示例13: drawTriangle

import javax.vecmath.Point3i; //导入依赖的package包/类
public void drawTriangle(Point3i screenA, short colixA, Point3i screenB,
                         short colixB, Point3i screenC, short colixC,
                         int check) {
  // primary method for mapped Mesh
  if ((check & 1) == 1)
    drawLine(colixA, colixB, screenA.x, screenA.y, screenA.z, screenB.x,
        screenB.y, screenB.z);
  if ((check & 2) == 2)
    drawLine(colixB, colixC, screenB.x, screenB.y, screenB.z, screenC.x,
        screenC.y, screenC.z);
  if ((check & 4) == 4)
    drawLine(colixA, colixC, screenA.x, screenA.y, screenA.z, screenC.x,
        screenC.y, screenC.z);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:15,代码来源:Export3D.java


示例14: fillTriangle

import javax.vecmath.Point3i; //导入依赖的package包/类
public void fillTriangle(Point3i pointA, short colixA, short normixA,
                         Point3i pointB, short colixB, short normixB,
                         Point3i pointC, short colixC, short normixC) {
  // mesh, isosurface
  if (colixA != colixB || colixB != colixC) {
    // shouldn't be here, because that uses renderIsosurface
    return;
  }
  ptA.set(pointA.x, pointA.y, pointA.z);
  ptB.set(pointB.x, pointB.y, pointB.z);
  ptC.set(pointC.x, pointC.y, pointC.z);
  exporter.fillTriangle(colixA, ptA, ptB, ptC, false);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:14,代码来源:Export3D.java


示例15: fillCylinder

import javax.vecmath.Point3i; //导入依赖的package包/类
public void fillCylinder(byte endcaps, int diameter,
                         Point3i screenA, Point3i screenB) {
  //axes, bbcage, uccage, cartoon, dipoles, mesh
  cylinder3d.render(colixCurrent, colixCurrent, !addAllPixels, !addAllPixels, endcaps, diameter,
                    screenA.x, screenA.y, screenA.z,
                    screenB.x, screenB.y, screenB.z);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:8,代码来源:Graphics3D.java


示例16: drawQuadrilateral

import javax.vecmath.Point3i; //导入依赖的package包/类
public void drawQuadrilateral(short colix, Point3i pointA, Point3i pointB,
                              Point3i pointC, Point3i screenD) {
  // mesh only -- translucency has been checked
  setColix(colix);
  drawLine(pointA, pointB);
  drawLine(pointB, pointC);
  drawLine(pointC, screenD);
  drawLine(screenD, pointA);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:10,代码来源:Export3D.java


示例17: drawQuadrilateral

import javax.vecmath.Point3i; //导入依赖的package包/类
public void drawQuadrilateral(short colix, Point3i screenA, Point3i screenB,
                              Point3i screenC, Point3i screenD) {
  //mesh only -- translucency has been checked
  setColix(colix);
  drawLine(screenA, screenB);
  drawLine(screenB, screenC);
  drawLine(screenC, screenD);
  drawLine(screenD, screenA);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:10,代码来源:Graphics3D.java


示例18: fillQuadrilateral

import javax.vecmath.Point3i; //导入依赖的package包/类
public void fillQuadrilateral(Point3i screenA, short colixA, short normixA,
                              Point3i screenB, short colixB, short normixB,
                              Point3i screenC, short colixC, short normixC,
                              Point3i screenD, short colixD, short normixD) {
  // mesh
  fillTriangle(screenA, colixA, normixA,
               screenB, colixB, normixB,
               screenC, colixC, normixC);
  fillTriangle(screenA, colixA, normixA,
               screenC, colixC, normixC,
               screenD, colixD, normixD);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:13,代码来源:Graphics3D.java


示例19: drawHermite

import javax.vecmath.Point3i; //导入依赖的package包/类
public void drawHermite(boolean fill, boolean border, int tension,
                        Point3i s0, Point3i s1, Point3i s2, Point3i s3,
                        Point3i s4, Point3i s5, Point3i s6, Point3i s7,
                        int aspectRatio) {
  hermite3d.renderHermiteRibbon(fill, border, tension, s0, s1, s2, s3, s4,
      s5, s6, s7, aspectRatio);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:8,代码来源:Export3D.java


示例20: fillEllipsoid

import javax.vecmath.Point3i; //导入依赖的package包/类
public void fillEllipsoid(Point3f center, Point3f[] points, int x, int y,
                          int z, int diameter, Matrix3f mToEllipsoidal,
                          double[] coef, Matrix4f mDeriv, int selectedOctant,
                          Point3i[] octantPoints) {
  exporter.fillEllipsoid(center, points, colix, x, y, z, diameter,
      mToEllipsoidal, coef, mDeriv, octantPoints);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:8,代码来源:Export3D.java



注:本文中的javax.vecmath.Point3i类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PDFParser类代码示例发布时间:2022-05-23
下一篇:
Java Response类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap