本文整理匯總了Java中javax.vecmath.Point3d.scale方法的典型用法代碼示例。如果您正苦於以下問題:Java Point3d.scale方法的具體用法?Java Point3d.scale怎麽用?Java Point3d.scale使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.vecmath.Point3d
的用法示例。
在下文中一共展示了Point3d.scale方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: create3D
import javax.vecmath.Point3d; //導入方法依賴的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);
}