本文整理汇总了Java中javax.media.j3d.Appearance.setPointAttributes方法的典型用法代码示例。如果您正苦于以下问题:Java Appearance.setPointAttributes方法的具体用法?Java Appearance.setPointAttributes怎么用?Java Appearance.setPointAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.media.j3d.Appearance
的用法示例。
在下文中一共展示了Appearance.setPointAttributes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PointsShape
import javax.media.j3d.Appearance; //导入方法依赖的package包/类
public PointsShape() {
// BY_REFERENCE PointArray storing coordinates and colors
cloud = new PointArray(MAX_POINTS, GeometryArray.COORDINATES | GeometryArray.COLOR_3 | GeometryArray.BY_REFERENCE);
mesh = new TriangleArray(MAX_POINTS, GeometryArray.COORDINATES | GeometryArray.COLOR_3 | GeometryArray.BY_REFERENCE);
TransparencyAttributes ta = new TransparencyAttributes();
ta.setTransparencyMode(TransparencyAttributes.NICEST);
ta.setTransparency(0.0f);
PointAttributes pointAttributes = new PointAttributes();
pointAttributes.setPointSize(2.83f);
pointAttributes.setCapability(PointAttributes.ALLOW_SIZE_WRITE);
Appearance a = new Appearance();
a.setPointAttributes(pointAttributes);
a.setTransparencyAttributes(ta);
// the data structure can be read and written at run time
cloud.setCapability(GeometryArray.ALLOW_REF_DATA_READ);
cloud.setCapability(GeometryArray.ALLOW_REF_DATA_WRITE);
mesh.setCapability(GeometryArray.ALLOW_REF_DATA_READ);
mesh.setCapability(GeometryArray.ALLOW_REF_DATA_WRITE);
sem = new Semaphore(0);
// create PointsShape geometry and appearance
createGeometry();
createAppearance();
// setAppearance(a);
}
示例2: createAppearance
import javax.media.j3d.Appearance; //导入方法依赖的package包/类
private void createAppearance() {
Appearance app = new Appearance();
PointAttributes pa = new PointAttributes();
pa.setPointSize(POINT_SIZE); // fix point size
app.setPointAttributes(pa);
setAppearance(app);
}
示例3: PointsShape
import javax.media.j3d.Appearance; //导入方法依赖的package包/类
public PointsShape() {
// BY_REFERENCE PointArray storing coordinates and colors
cloud = new PointArray(MAX_POINTS, GeometryArray.COORDINATES | GeometryArray.COLOR_3 | GeometryArray.BY_REFERENCE);
mesh = new TriangleArray(MAX_POINTS, GeometryArray.COORDINATES | GeometryArray.COLOR_3 | GeometryArray.BY_REFERENCE);
TransparencyAttributes ta = new TransparencyAttributes();
ta.setTransparencyMode(TransparencyAttributes.NICEST);
ta.setTransparency(0.0f);
PointAttributes pointAttributes = new PointAttributes();
pointAttributes.setPointSize(2.83f);
pointAttributes.setCapability(PointAttributes.ALLOW_SIZE_WRITE);
Appearance a = new Appearance();
a.setPointAttributes(pointAttributes);
a.setTransparencyAttributes(ta);
// the data structure can be read and written at run time
cloud.setCapability(GeometryArray.ALLOW_REF_DATA_READ);
cloud.setCapability(GeometryArray.ALLOW_REF_DATA_WRITE);
mesh.setCapability(GeometryArray.ALLOW_REF_DATA_READ);
mesh.setCapability(GeometryArray.ALLOW_REF_DATA_WRITE);
sem = new Semaphore(0);
// create PointsShape geometry and appearance
createGeometry();
createAppearance();
// setAppearance(a);
}
示例4: createAppearance
import javax.media.j3d.Appearance; //导入方法依赖的package包/类
private void createAppearance() {
Appearance app = new Appearance();
PointAttributes pa = new PointAttributes();
pa.setPointSize(POINT_SIZE); // fix point size
app.setPointAttributes(pa);
setAppearance(app);
}
示例5: createSceneGraph
import javax.media.j3d.Appearance; //导入方法依赖的package包/类
/**
* �V�[�����\�z����
*
* @return BG
*/
public BranchGroup createSceneGraph() {
BranchGroup bg = new BranchGroup();
// ������3D�I�u�W�F�N�g��lj�
// ���W����lj�
Axis axis = new Axis();
bg.addChild(axis.getBG());
// �_��lj�
Point3f[] vertices = { // �_�̍��W
new Point3f(-0.5f, 0.5f, -0.5f),
new Point3f(0.5f, 0.5f, -0.5f),
new Point3f(0.5f, 0.5f, 0.5f),
new Point3f(-0.5f, 0.5f, 0.5f),
new Point3f(-0.5f, -0.5f, -0.5f),
new Point3f(0.5f, -0.5f, -0.5f),
new Point3f(0.5f, -0.5f, 0.5f),
new Point3f(-0.5f, -0.5f, 0.5f)
};
Color3f[] colors = { // �_�̐F
new Color3f(1.0f, 1.0f, 0.0f),
new Color3f(1.0f, 1.0f, 0.0f),
new Color3f(1.0f, 1.0f, 0.0f),
new Color3f(1.0f, 1.0f, 0.0f),
new Color3f(1.0f, 1.0f, 0.0f),
new Color3f(1.0f, 1.0f, 0.0f),
new Color3f(1.0f, 1.0f, 0.0f),
new Color3f(1.0f, 1.0f, 0.0f)
};
// Geometry
PointArray geo = new PointArray(8, PointArray.COORDINATES
| PointArray.COLOR_3);
geo.setCoordinates(0, vertices); // ���_���W���Z�b�g
geo.setColors(0, colors); // �F���Z�b�g
// Appearance
Appearance app = new Appearance();
PointAttributes attr = new PointAttributes(5.0f, false); // �_�̑傫��
app.setPointAttributes(attr);
bg.addChild(new Shape3D(geo, app));
// �����܂�
return bg;
}