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

Java QuadArray类代码示例

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

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



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

示例1: createColoredGradientSheet

import javax.media.j3d.QuadArray; //导入依赖的package包/类
/**
 * Function to create a colored gradient sheet by a QuadArray, could be
 * used in Background.
 */
public static Shape3D createColoredGradientSheet(Color3f colorTop, Color3f colorBottom) {
    QuadArray qa = new QuadArray(4, QuadArray.COORDINATES | QuadArray.COLOR_3);
    qa.setCoordinate(0, new Point3f(-1, -1, 0));
    qa.setCoordinate(1, new Point3f(1, -1, 0));
    qa.setCoordinate(2, new Point3f(1, 1, 0));
    qa.setCoordinate(3, new Point3f(-1, 1, 0));
    for (int i = 0; i < 2; ++i) {
        qa.setColor(i, colorBottom);
    }
    for (int i = 2; i < 4; ++i) {
        qa.setColor(i, colorTop);
    }
    return new Shape3D(qa);
}
 
开发者ID:NeuroBox3D,项目名称:NeuGen,代码行数:19,代码来源:Utils3D.java


示例2: createQuadArrayFromPoints

import javax.media.j3d.QuadArray; //导入依赖的package包/类
private QuadArray createQuadArrayFromPoints(Point3f p1, Point3f p2, Point3f p3, Point3f p4) {
    QuadArray qa = new QuadArray(4, QuadArray.COORDINATES | QuadArray.NORMALS);
    qa.setCoordinate(0, p1);
    qa.setCoordinate(1, p2);
    qa.setCoordinate(2, p3);
    qa.setCoordinate(3, p4);
    return qa;
}
 
开发者ID:NeuroBox3D,项目名称:NeuGen,代码行数:9,代码来源:Cube3dCreator.java


示例3: setupFinished

import javax.media.j3d.QuadArray; //导入依赖的package包/类
/**
 * Notification that the construction phase of this node has finished.
 * If the node would like to do any internal processing, such as setting
 * up geometry, then go for it now.
 */
public void setupFinished() {
    if(!inSetup)
        return;

    super.setupFinished();

    float size_x = vfSize[0] / 2;
    float size_y = vfSize[1] / 2;

    float[] coords = {
        -size_x, -size_y, 0,
         size_x, -size_y, 0,
         size_x,  size_y, 0,
        -size_x,  size_y, 0,
    };

    float[] normals = {
        0, 0, 1,
        0, 0, 1,
        0, 0, 1,
        0, 0, 1
    };

    implGeom = new QuadArray(4, QuadArray.COORDINATES | QuadArray.NORMALS);
    implGeom.setCoordinates(0, coords);
    implGeom.setNormals(0, normals);
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:33,代码来源:J3DRectangle2D.java


示例4: ColouredTiles

import javax.media.j3d.QuadArray; //导入依赖的package包/类
public ColouredTiles(ArrayList<Point3f> coords, Color3f col) {
	plane = new QuadArray(coords.size(), GeometryArray.COORDINATES | GeometryArray.COLOR_3);
	createGeometry(coords, col);
	createAppearance();
}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:6,代码来源:ColouredTiles.java


示例5: addBox

import javax.media.j3d.QuadArray; //导入依赖的package包/类
public void addBox(TransformGroup scene) {
    QuadArray box = new QuadArray(16, QuadArray.COORDINATES);
    Point3d verts[] = new Point3d[16];

    /*
    verts[0] = new Point3d(0, 0, 0);
    verts[1] = new Point3d(0.6, 0, 0);
    verts[2] = new Point3d(0.6, 0, -0.6);
    verts[3] = new Point3d(0, 0, -0.6);

    verts[4] = new Point3d(0, 1.6, 0);
    verts[5] = new Point3d(0.6, 1.6, 0);
    verts[6] = new Point3d(0.6, 1.6, -0.6);
    verts[7] = new Point3d(0, 1.6, -0.6);

    verts[8] = new Point3d(0, 0.8, 0);
    verts[9] = new Point3d(0.6, 0.8, 0);
    verts[10] = new Point3d(0.6, 0.8, -0.6);
    verts[11] = new Point3d(0, 0.8, -0.6);

    verts[12] = new Point3d(0, 1.0, 0);
    verts[13] = new Point3d(0.6, 1.0, 0);
    verts[14] = new Point3d(0.6, 1.0, -0.6);
    verts[15] = new Point3d(0, 1.0, -0.6);
     *
     */

    //float leftPos = -100 * scale;
    verts[0] = new Point3d(0, 0, 0);
    verts[1] = new Point3d(lengthX, 0, 0);
    verts[2] = new Point3d(lengthX, widthY, 0);
    verts[3] = new Point3d(0, widthY, 0);

    verts[4] = new Point3d(0, 0, heightZ);
    verts[5] = new Point3d(lengthX, 0, heightZ);
    verts[6] = new Point3d(lengthX, widthY, heightZ);
    verts[7] = new Point3d(0, widthY, heightZ);

    float layer4End = layer6 + layer5B + layer5A;
    verts[8] = new Point3d(0, 0, layer4End);
    verts[9] = new Point3d(lengthX, 0, layer4End);
    verts[10] = new Point3d(lengthX, widthY, layer4End);
    verts[11] = new Point3d(0, widthY, layer4End);

    float layer4Start = layer4End + layer4;
    verts[12] = new Point3d(0, 0, layer4Start);
    verts[13] = new Point3d(lengthX, 0, layer4Start);
    verts[14] = new Point3d(lengthX, widthY, layer4Start);
    verts[15] = new Point3d(0, widthY, layer4Start);

    float layerL1End = heightZ - layer1;
    float textPosX = (lengthX + 250.0f * scale);
    float scaleText = 3.0f * scale;
    Vector3f textPos = new Vector3f(textPosX, widthY / 2.0f, layerL1End + layer1 / 2.0f);
    Utils3D.addText3D(scene, "L1", textPos, scaleText, Utils3D.grey);

    float layerL23End = layer6 + layer5B + layer5A + layer4;
    textPos = new Vector3f(textPosX, widthY / 2.0f, layerL23End + layer23 / 2.0f);
    Utils3D.addText3D(scene, "L2/3", textPos, scaleText, Utils3D.grey);

    textPos = new Vector3f(textPosX, widthY / 2.0f, layer4End + layer4 / 2.0f);
    Utils3D.addText3D(scene, "L4", textPos, scaleText, Utils3D.grey);

    float layer5AEnd = layer6 + layer5B;
    textPos = new Vector3f(textPosX, widthY / 2.0f, layer5AEnd + layer5A / 2.0f);
    Utils3D.addText3D(scene, "L5A", textPos, scaleText, Utils3D.grey);

    textPos = new Vector3f(textPosX, widthY / 2.0f, layer6 + layer5B / 2.0f);
    Utils3D.addText3D(scene, "L5B", textPos, scaleText, Utils3D.grey);

    textPos = new Vector3f(textPosX, widthY / 2.0f, layer6 / 2.0f);
    Utils3D.addText3D(scene, "L6", textPos, scaleText, Utils3D.grey);

    box.setCoordinates(0, verts);
    setGeometry(box);
}
 
开发者ID:NeuroBox3D,项目名称:NeuGen,代码行数:77,代码来源:CorticalColumn.java


示例6: setVerts

import javax.media.j3d.QuadArray; //导入依赖的package包/类
public void setVerts(Point3d verts[]) {      
    QuadArray box = new QuadArray(verts.length, QuadArray.COORDINATES);
    box.setCoordinates(0, verts);
    //setGeometry(box);
    this.addGeometry(box);
}
 
开发者ID:NeuroBox3D,项目名称:NeuGen,代码行数:7,代码来源:Segment3D.java


示例7: addBox

import javax.media.j3d.QuadArray; //导入依赖的package包/类
public void addBox(TransformGroup scene) {
    QuadArray box = new QuadArray(20, QuadArray.COORDINATES);
    Point3d verts[] = new Point3d[20];
    //float scaleText = 0.025f;
    float scaleText = 3.0f * scale;
    //float leftPos = -3.0f * scale;
    float textPosX = (lengthX + 250.0f * scale);
    logger.info("textPosX " + textPosX);
    //unten
    // stratum oriens 0.002 mm
    Vector3f textPos = new Vector3f(textPosX, widthY / 2.0f, stratumOriens / 2.0f);
    Utils3D.addText3D(scene, "stratum oriens", textPos, scaleText, Utils3D.grey);
    verts[0] = new Point3d(0, 0, 0);
    verts[1] = new Point3d(lengthX, 0, 0);
    verts[2] = new Point3d(lengthX, widthY, 0);
    verts[3] = new Point3d(0, widthY, 0);

    // stratum pyramidale 0.001 mm
    textPos = new Vector3f(textPosX, widthY / 2.0f, stratumOriens + stratumPyramidale / 2.0f);
    Utils3D.addText3D(scene, "stratum pyramidale", textPos, scaleText, Utils3D.grey);
    verts[4] = new Point3d(0, 0, stratumOriens);
    verts[5] = new Point3d(lengthX, 0, stratumOriens);
    verts[6] = new Point3d(lengthX, widthY, stratumOriens);
    verts[7] = new Point3d(0, widthY, stratumOriens);

    float stratumPyramidaleEnd = stratumOriens + stratumPyramidale;
    // stratum radiatum 0.005 mm
    textPos = new Vector3f(textPosX, widthY / 2.0f, stratumPyramidaleEnd + stratumRadiatum / 2.0f);
    Utils3D.addText3D(scene, "stratum radiatum", textPos, scaleText, Utils3D.grey);
    verts[8] = new Point3d(0, 0, stratumPyramidaleEnd);
    verts[9] = new Point3d(lengthX, 0, stratumPyramidaleEnd);
    verts[10] = new Point3d(lengthX, widthY, stratumPyramidaleEnd);
    verts[11] = new Point3d(0, widthY, stratumPyramidaleEnd);

    float stratumRadiatumEnd = stratumPyramidaleEnd + stratumRadiatum;
    // stratum lacunosum/moleculare 0.001 mm hoch
    textPos = new Vector3f(textPosX, widthY / 2.0f, stratumRadiatumEnd + stratumLacunosum / 1.5f);
    Utils3D.addText3D(scene, "stratum lacunosum-moleculare", textPos, scaleText, Utils3D.grey);
    verts[12] = new Point3d(0, 0, stratumRadiatumEnd);
    verts[13] = new Point3d(lengthX, 0, stratumRadiatumEnd);
    verts[14] = new Point3d(lengthX, widthY, stratumRadiatumEnd);
    verts[15] = new Point3d(0, widthY, stratumRadiatumEnd);

    // oben
    verts[16] = new Point3d(0, 0, heightZ);
    verts[17] = new Point3d(lengthX, 0, heightZ);
    verts[18] = new Point3d(lengthX, widthY, heightZ);
    verts[19] = new Point3d(0, widthY, heightZ);

    box.setCoordinates(0, verts);
    setGeometry(box);
}
 
开发者ID:NeuroBox3D,项目名称:NeuGen,代码行数:53,代码来源:RegionCA1.java


示例8: ColouredTiles

import javax.media.j3d.QuadArray; //导入依赖的package包/类
public ColouredTiles(ArrayList<Point3f> coords, Color3f col) {
  plane = new QuadArray(coords.size(), GeometryArray.COORDINATES | GeometryArray.COLOR_3);
  createGeometry(coords, col);
  createAppearance();
}
 
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:6,代码来源:ColouredTiles.java


示例9: setupFinished

import javax.media.j3d.QuadArray; //导入依赖的package包/类
/**
 * Notification that the construction phase of this node has finished.
 * If the node would like to do any internal processing, such as setting
 * up geometry, then go for it now.
 */
public void setupFinished() {
    if(!inSetup)
        return;

    super.setupFinished();

    SphereGenerator generator = new SphereGenerator(vfRadius, 16);
    GeometryData data = new GeometryData();
    data.geometryType = GeometryData.QUADS;
    data.geometryComponents = GeometryData.NORMAL_DATA |
                              GeometryData.TEXTURE_2D_DATA;

    generator.generate(data);

    int vertex_mask = QuadArray.COORDINATES |
                      QuadArray.NORMALS |
                      QuadArray.TEXTURE_COORDINATE_2;

    int texMap[] = new int[] { 0,0,0,0,0,0,0,0 };

    impl = new QuadArray(data.vertexCount, vertex_mask, 1, texMap);

    impl.setCoordinates(0, data.coordinates);
    impl.setNormals(0, data.normals);
    impl.setTextureCoordinates(0, 0, data.textureCoordinates);

    J3DUserData u_data = new J3DUserData();
    u_data.geometryData = data;

    impl.setUserData(u_data);

    if(capReqdBits != null) {
        for(int i = 0; i < capReqdBits.length; i++)
            impl.setCapability(capReqdBits[i]);
    }

    if(J3DGlobalStatus.haveFreqBitsAPI && freqReqdBits != null) {
        for(int i = 0; i < freqReqdBits.length; i++)
            impl.setCapabilityIsFrequent(freqReqdBits[i]);
    }

    capReqdBits = null;
    freqReqdBits = null;
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:50,代码来源:J3DSphere.java


示例10: setCapabilityRequiredMap

import javax.media.j3d.QuadArray; //导入依赖的package包/类
/**
 * Set the mapping of capability bits that the user would like to
 * make sure is set. The end output is that the capabilities are the union
 * of what the loader wants and what the user wants. Default implementation
 * does nothing.
 * <p>
 * If the map contains a key, but the value is  null or zero length, the
 * request is ignored.
 *
 * @param capBits The capability bits to be set
 * @param freqBits The frequency bits to be set
 */
public void setCapabilityRequiredMap(Map capBits, Map freqBits) {

    if(capBits != null && capBits.containsKey(QuadArray.class))
        capReqdBits = (int[])capBits.get(QuadArray.class);

    if(!J3DGlobalStatus.haveFreqBitsAPI || freqBits == null ||
       !freqBits.containsKey(QuadArray.class))
        return;

    freqReqdBits = (int[])freqBits.get(QuadArray.class);
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:24,代码来源:J3DSphere.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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