--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Calixte DENIZET
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- INTERACTIVE TEST -->
+
+// <-- Non-regression test for bug 8133 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/8133
+//
+// <-- Short Description -->
+// Ticks disappeared in planar 3D view
+
+clf();
+plot3d([1,2],[1,2],[1,2]);
+
+// ticks should be present on z-axis & x-axis
+set(gca(),"rotation_angles",[90,90]);
+
+// ticks should be present on z-axis & y-axis
+set(gca(),"rotation_angles",[90,0]);
\ No newline at end of file
}
// Draw Z ruler
- if (axes.getViewAsEnum() == Camera.ViewType.VIEW_3D && axes.getRotationAngles()[1] != 90.0) {
+ if (axes.getViewAsEnum() == Camera.ViewType.VIEW_3D) {
double txs, tys, xs, ys;
-
if (Math.abs(matrix[2]) < Math.abs(matrix[6])) {
- xs = Math.signum(matrix[2]);
- ys = -Math.signum(matrix[6]);
+ xs = matrix[2] > 0 ? 1 : -1;
+ ys = matrix[6] > 0 ? -1 : 1;
txs = xs;
tys = 0;
} else {
- xs = -Math.signum(matrix[2]);
- ys = Math.signum(matrix[6]);
+ xs = matrix[2] > 0 ? -1 : 1;
+ ys = matrix[6] > 0 ? 1 : -1;
txs = 0;
tys = ys;
}
rulerModel = getDefaultRulerModel(axes, colorMap);
-
rulerModel.setFirstPoint(new Vector3d(xs, ys, -1));
rulerModel.setSecondPoint(new Vector3d(xs, ys, 1));
rulerModel.setTicksDirection(new Vector3d(txs, tys, 0));
zAxisLabelPositioner.setTicksDirection(new Vector3d(txs, tys, 0.0));
zAxisLabelPositioner.setDistanceRatio(distanceRatio);
- zAxisLabelPositioner.setProjectedTicksDirection(rulerDrawingResult.getNormalizedTicksDirection().setZ(0));
+ zAxisLabelPositioner.setProjectedTicksDirection(rulerDrawingResult.getNormalizedTicksDirection().setZ(0).setY(1e-7));
} else {
/* z-axis not visible: compute the projected ticks direction and distance ratio (see the x-axis case). */
Vector3d zTicksDirection = new Vector3d(txs, tys, 0);
RulerDrawer[] rulerDrawers = rulerDrawerManager.get(axes);
ElementsBuffer vertexBuffer = drawingTools.getCanvas().getBuffersManager().createElementsBuffer();
- final boolean is3D = axes.getViewAsEnum() == Camera.ViewType.VIEW_3D && axes.getRotationAngles()[1] != 90.0;
+ final boolean is3D = axes.getViewAsEnum() == Camera.ViewType.VIEW_3D;// && axes.getRotationAngles()[1] != 90.0;
if (rulerDrawers[0].getModel() == null || rulerDrawers[1].getModel() == null || (is3D && rulerDrawers[2].getModel() == null)) {
computeRulers(axes, axesDrawer, colorMap, drawingTools, drawingTools.getTransformationManager().getModelViewStack().peek(), drawingTools.getTransformationManager().getCanvasProjection());
if (axes.getZAxisVisible()) {
rulerDrawers[2].draw(drawingTools);
- if (axes.getZAxisGridColor() != -1 || !axes.getZAxisVisible()) {
+ if (axes.getZAxisGridColor() != -1) {
FloatBuffer vertexData;
if (axes.getZAxisLogFlag()) {
List<Double> values = rulerDrawers[2].getSubTicksValue();
drawingTools.getCanvas().getBuffersManager().dispose(vertexBuffer);
}
- private double getNonZeroSignum(double value) {
+ private static final double getNonZeroSignum(double value) {
if (value < 0) {
return -1;
} else {