本文整理汇总了Java中javax.media.j3d.QuadArray.setCoordinates方法的典型用法代码示例。如果您正苦于以下问题:Java QuadArray.setCoordinates方法的具体用法?Java QuadArray.setCoordinates怎么用?Java QuadArray.setCoordinates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.media.j3d.QuadArray
的用法示例。
在下文中一共展示了QuadArray.setCoordinates方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: 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);
}
示例4: 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);
}
示例5: 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;
}