本文整理汇总了Java中javax.media.j3d.LineStripArray.setCoordinates方法的典型用法代码示例。如果您正苦于以下问题:Java LineStripArray.setCoordinates方法的具体用法?Java LineStripArray.setCoordinates怎么用?Java LineStripArray.setCoordinates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.media.j3d.LineStripArray
的用法示例。
在下文中一共展示了LineStripArray.setCoordinates方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PolyLine
import javax.media.j3d.LineStripArray; //导入方法依赖的package包/类
/** Create polyline.
* @param points array of <code>Point3D</code>s
* @param appearance object' Appearance
* @preconditions points.length > 1 */
public PolyLine(Point3d[] points,
Appearance appearance) {
if (points.length < 2) {
return;
}
int[] counts = new int[1];
counts[0] = points.length;
LineStripArray lineArray = new LineStripArray(points.length,
GeometryArray.COORDINATES|
GeometryArray.NORMALS,
counts);
float[] normal = {0, 0, 0};
lineArray.setCoordinates(0, points);
lineArray.setNormal(0, normal);
setGeometry(lineArray);
setAppearance(appearance);
}
示例2: setupFinished
import javax.media.j3d.LineStripArray; //导入方法依赖的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();
int num_points = numLineSegments / 2;
float[] coords = new float[num_points * 3];
for(int i = 0; i < num_points; i++) {
coords[i * 3] = vfLineSegments[i * 2];
coords[i * 3 + 1] = vfLineSegments[i * 2 + 1];
coords[i * 3 + 2] = 0;
}
implGeom = new LineStripArray(num_points,
LineStripArray.COORDINATES,
new int[] { num_points });
implGeom.setCoordinates(0, coords);
}
示例3: toLineGeometry
import javax.media.j3d.LineStripArray; //导入方法依赖的package包/类
/**
* @return GeometryArray
*/
public GeometryArray toLineGeometry() {
LineStripArray a = new LineStripArray(size(),
GeometryArray.COORDINATES, new int[] { size() });
a.setCoordinates(0, toArray(new Point3d[] {}));
return a;
}
示例4: generateGeometry
import javax.media.j3d.LineStripArray; //导入方法依赖的package包/类
/**
* Convenience method to generate new geometry.
*/
private void generateGeometry() {
maxVertexCount = geometryData.vertexCount;
int format = LineStripArray.COORDINATES;
impl = new LineStripArray(geometryData.vertexCount,
format,
1,
TEX_SET_MAP,
geometryData.stripCounts);
impl.setCapability(LineStripArray.ALLOW_COUNT_WRITE);
impl.setCapability(LineStripArray.ALLOW_COORDINATE_WRITE);
impl.setCoordinates(0, geometryData.coordinates);
J3DUserData u_data = new J3DUserData();
u_data.geometryData = geometryData;
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]);
}
}
示例5: outputShape
import javax.media.j3d.LineStripArray; //导入方法依赖的package包/类
private void outputShape(OrderedGroup triGroup, int orderDir, TexCoordGeneration tg, Texture2D texture, int numPts, Point3d[] pts, Color4f[] colrs)
{
count[0] = numPts;
TriangleFanArray pgonGeo = new TriangleFanArray(numPts,
GeometryArray.COORDINATES | GeometryArray.COLOR_4, count);
pgonGeo.setCoordinates(0, pts, 0, numPts);
pgonGeo.setColors(0, colrs, 0, numPts);
Appearance appearance = new Appearance();
if (texture != null)
{
appearance.setTextureAttributes(texAttr);
appearance.setTexture(texture);
}
appearance.setMaterial(m);
appearance.setColoringAttributes(clr);
appearance.setTransparencyAttributes(trans);
appearance.setPolygonAttributes(p);
appearance.setTexCoordGeneration(tg);
appearance.setRenderingAttributes(r);
Shape3D shape = new Shape3D(pgonGeo, appearance);
Node child = shape;
if (outputLines)
{
Group shapeGroup = new Group();
shapeGroup.addChild(shape);
count[0] = numPts + 1;
pts[numPts] = pts[0];
LineStripArray lineGeo = new LineStripArray(numPts + 1,
GeometryArray.COORDINATES, count);
lineGeo.setCoordinates(0, pts, 0, numPts + 1);
Appearance lineAppearance = new Appearance();
Shape3D lineShape = new Shape3D(lineGeo, lineAppearance);
shapeGroup.addChild(lineShape);
child = shapeGroup;
}
if (verbose)
{
System.out.println("shape is " + child);
}
if (orderDir == FRONT)
{
triGroup.insertChild(child, 0);
} else
{
triGroup.addChild(child);
}
}