protected void buildAxis() { xAxis = new Arrow("_xAxis", length, width); xAxis.setDefaultColor(xAxisColor); xAxis.setRotation(new Matrix3().fromAngles(0, 0, -90 * MathUtils.DEG_TO_RAD)); xAxis.setTranslation(length * .5, 0, 0); attachChild(xAxis); yAxis = new Arrow("yAxis", length, width); yAxis.setDefaultColor(yAxisColor); yAxis.setTranslation(0, length * .5, 0); attachChild(yAxis); zAxis = new Arrow("zAxis", length, width); zAxis.setDefaultColor(zAxisColor); if (rightHanded) { zAxis.setRotation(new Matrix3().fromAngles(90 * MathUtils.DEG_TO_RAD, 0, 0)); zAxis.setTranslation(0, 0, length * .5); } else { zAxis.setRotation(new Matrix3().fromAngles(-90 * MathUtils.DEG_TO_RAD, 0, 0)); zAxis.setTranslation(0, 0, -length * .5); } attachChild(zAxis); }
protected void buildAxis() { xAxis = new Arrow("_xAxis", length, width); xAxis.setDefaultColor(xAxisColor); xAxis.setRotation(new Matrix3().fromAngles(0, 0, -90 * MathUtils.DEG_TO_RAD)); xAxis.setTranslation(length * .5, 0, 0); attachChild(xAxis); yAxis = new Arrow("yAxis", length, width); yAxis.setDefaultColor(yAxisColor); yAxis.setTranslation(0, length * .5, 0); attachChild(yAxis); zAxis = new Arrow("zAxis", length, width); zAxis.setDefaultColor(zAxisColor); if (rightHanded) { zAxis.setRotation(new Matrix3().fromAngles(90 * MathUtils.DEG_TO_RAD, 0, 0)); zAxis.setTranslation(0, 0, length * .5); } else { zAxis.setRotation(new Matrix3().fromAngles(-90 * MathUtils.DEG_TO_RAD, 0, 0)); zAxis.setTranslation(0, 0, -length * .5); } attachChild(zAxis); }
public SimpleScaleWidget withArrow(final ReadOnlyVector3 arrowDirection, final ReadOnlyColorRGBA color, final double lengthGap, final double tipGap) { _arrowDirection = new Vector3(arrowDirection); _handle = new InteractArrow("scaleHandle", 1.0, 0.125, lengthGap, tipGap); if (!_arrowDirection.equals(Vector3.UNIT_Z)) { _handle.setRotation(new Quaternion().fromVectorToVector(Vector3.UNIT_Z, _arrowDirection)); } final BlendState blend = new BlendState(); blend.setBlendEnabled(true); _handle.setRenderState(blend); ((Arrow) _handle).setDefaultColor(color); final ZBufferState zstate = new ZBufferState(); zstate.setWritable(false); zstate.setFunction(TestFunction.Always); _handle.setRenderState(zstate); _handle.getSceneHints().setRenderBucketType(RenderBucketType.PostBucket); _handle.updateGeometricState(0); return this; }