本文整理汇总了Java中javax.media.j3d.Shape3D.setPickable方法的典型用法代码示例。如果您正苦于以下问题:Java Shape3D.setPickable方法的具体用法?Java Shape3D.setPickable怎么用?Java Shape3D.setPickable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.media.j3d.Shape3D
的用法示例。
在下文中一共展示了Shape3D.setPickable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create3D
import javax.media.j3d.Shape3D; //导入方法依赖的package包/类
private void create3D() {
super.create3D(true);
// construct sensor body - a line for each individual sensor ray.
Point3d[] coords = new Point3d[nbSensors * 2];
for (int i = 0; i < nbSensors; i++) {
Point3d start = new Point3d(positions[i]);
coords[i * 2] = start;
Point3d end = new Point3d(start);
Point3d direction = new Point3d(directions[i]);
if (((flags & FLAG_SHOW_FULL_SENSOR_RAY) == 0) && (type != TYPE_BUMPER))
direction.scale(0.05f); // just a small ray
end.add(direction);
coords[i * 2 + 1] = end;
}
LineArray line = new LineArray(coords.length, GeometryArray.COORDINATES);
line.setCoordinates(0, coords);
Appearance appear = new Appearance();
Material material = new Material();
ColoringAttributes ca = new ColoringAttributes();
ca.setColor(color);
appear.setColoringAttributes(ca);
appear.setMaterial(material);
Shape3D shape = new Shape3D(line, appear);
shape.setCollidable(false);
shape.setPickable(false);
addChild(shape);
}
示例2: create3D
import javax.media.j3d.Shape3D; //导入方法依赖的package包/类
private void create3D() {
super.create3D(true);
// construct sensor body - a line for each individual sensor ray.
Point3d[] coords = new Point3d[nbSensors * 2];
for (int i = 0; i < nbSensors; i++) {
Point3d start = new Point3d(positions[i]);
coords[i * 2] = start;
Point3d end = new Point3d(start);
Point3d direction = new Point3d(directions[i]);
if (((flags & FLAG_SHOW_FULL_SENSOR_RAY) == 0) && (type != TYPE_BUMPER))
direction.scale(0.05f); // just a small ray
end.add(direction);
coords[i * 2 + 1] = end;
}
LineArray line = new LineArray(coords.length, GeometryArray.COORDINATES);
line.setCoordinates(0, coords);
Appearance appear = new Appearance();
Material material = new Material();
ColoringAttributes ca = new ColoringAttributes();
ca.setColor(color);
appear.setColoringAttributes(ca);
appear.setMaterial(material);
Shape3D shape = new Shape3D(line, appear);
shape.setCollidable(false);
shape.setPickable(false);
addChild(shape);
}
示例3: createAxis
import javax.media.j3d.Shape3D; //导入方法依赖的package包/类
/**
* Creates a representation of the 3 axis of the 3d world. Used only in the
* creation phase.
*/
private void createAxis() {
Point3f[] axisCoords = {
// X axis arrow
new Point3f(0.0f, 0.001f, 0.0f), new Point3f(1, 0.001f, 0.0f), new Point3f(1, 0.001f, 0.0f),
new Point3f(0.95f, 0.001f, 0.05f),
new Point3f(1, 0.001f, 0.0f),
new Point3f(0.95f, 0.001f, -0.05f),
// a small X
new Point3f(1.0f, 0.001f, 0.1f), new Point3f(0.9f, 0.001f, 0.2f),
new Point3f(1.0f, 0.001f, 0.2f),
new Point3f(0.9f, 0.001f, 0.1f),
// Z axis arrow
new Point3f(0.0f, 0.001f, 0.0f), new Point3f(0, 0.001f, 1.0f), new Point3f(0, 0.001f, 1.0f), new Point3f(0.05f, 0.001f, 0.95f),
new Point3f(0, 0.001f, 1.0f),
new Point3f(-0.05f, 0.001f, 0.95f),
// a small Z
new Point3f(0.1f, 0.001f, 1.0f), new Point3f(0.2f, 0.001f, 1.0f), new Point3f(0.1f, 0.001f, 0.9f), new Point3f(0.2f, 0.001f, 0.9f),
new Point3f(0.1f, 0.001f, 1.0f), new Point3f(0.2f, 0.001f, 0.9f),
// Y axis arrow
new Point3f(0.0f, 0.001f, 0.0f), new Point3f(0, 1.0f, 0.0f), new Point3f(0, 1.0f, 0.0f), new Point3f(0.05f, 0.95f, 0f), new Point3f(0, 1f, 0f),
new Point3f(0.00f, 0.95f, 0.05f),
// a small Y
new Point3f(0.2f, 1f, 0.0f), new Point3f(0.1f, 0.9f, 0f), new Point3f(0.1f, 1.0f, 0.0f), new Point3f(0.15f, 0.95f, 0.0f)
};
// scale axis drawing to 5% of word size
for (int i = 0; i < axisCoords.length; i++) {
axisCoords[i].scale(worldSize * 0.05f);
}
LineArray axisLines = new LineArray(axisCoords.length, GeometryArray.COORDINATES);
axisLines.setCoordinates(0, axisCoords);
Appearance axisAppear = new Appearance();
ColoringAttributes ca = new ColoringAttributes();
ca.setColor(white);
axisAppear.setColoringAttributes(ca);
Material mat = new Material();
mat.setDiffuseColor(white);
axisAppear.setMaterial(mat);
Shape3D axis = new Shape3D(axisLines, axisAppear);
axis.setCollidable(false);
axis.setPickable(false);
sceneTrans.addChild(axis);
}
示例4: createAxis
import javax.media.j3d.Shape3D; //导入方法依赖的package包/类
/**
* Creates a representation of the 3 axis of the 3d world. Used only in the
* creation phase.
*/
private void createAxis() {
Point3f[] axisCoords = {
// X axis arrow
new Point3f(0.0f, 0.001f, 0.0f), new Point3f(1, 0.001f, 0.0f), new Point3f(1, 0.001f, 0.0f), new Point3f(0.95f, 0.001f, 0.05f), new Point3f(1, 0.001f, 0.0f),
new Point3f(0.95f, 0.001f, -0.05f),
// a small X
new Point3f(1.0f, 0.001f, 0.1f), new Point3f(0.9f, 0.001f, 0.2f), new Point3f(1.0f, 0.001f, 0.2f), new Point3f(0.9f, 0.001f, 0.1f),
// Z axis arrow
new Point3f(0.0f, 0.001f, 0.0f), new Point3f(0, 0.001f, 1.0f), new Point3f(0, 0.001f, 1.0f), new Point3f(0.05f, 0.001f, 0.95f), new Point3f(0, 0.001f, 1.0f),
new Point3f(-0.05f, 0.001f, 0.95f),
// a small Z
new Point3f(0.1f, 0.001f, 1.0f), new Point3f(0.2f, 0.001f, 1.0f), new Point3f(0.1f, 0.001f, 0.9f), new Point3f(0.2f, 0.001f, 0.9f), new Point3f(0.1f, 0.001f, 1.0f),
new Point3f(0.2f, 0.001f, 0.9f),
// Y axis arrow
new Point3f(0.0f, 0.001f, 0.0f), new Point3f(0, 1.0f, 0.0f), new Point3f(0, 1.0f, 0.0f), new Point3f(0.05f, 0.95f, 0f), new Point3f(0, 1f, 0f),
new Point3f(0.00f, 0.95f, 0.05f),
// a small Y
new Point3f(0.2f, 1f, 0.0f), new Point3f(0.1f, 0.9f, 0f), new Point3f(0.1f, 1.0f, 0.0f), new Point3f(0.15f, 0.95f, 0.0f)
};
// scale axis drawing to 5% of word size
for (int i = 0; i < axisCoords.length; i++) {
axisCoords[i].scale(worldSize * 0.05f);
}
LineArray axisLines = new LineArray(axisCoords.length, GeometryArray.COORDINATES);
axisLines.setCoordinates(0, axisCoords);
Appearance axisAppear = new Appearance();
ColoringAttributes ca = new ColoringAttributes();
ca.setColor(white);
axisAppear.setColoringAttributes(ca);
Material mat = new Material();
mat.setDiffuseColor(white);
axisAppear.setMaterial(mat);
Shape3D axis = new Shape3D(axisLines, axisAppear);
axis.setCollidable(false);
axis.setPickable(false);
sceneTrans.addChild(axis);
}