vTemp.set(vertices[1]);
vTemp.sub(vertices[0]);
// crossing point
pt1f.scaleAdd(fractionalOffset, vTemp, vertices[0]);
// define rotational axis
Matrix3f mat = new Matrix3f();
mat.set(new AxisAngle4f(vTemp, (float) (nDegreesOffset * Math.PI / 180)));
// vector to rotate
if (vertexCount > 2)
vTemp2.set(vertices[2]);
else
vTemp2.set(Draw.randomPoint());
vTemp2.sub(vertices[0]);
vTemp2.cross(vTemp, vTemp2);
vTemp2.cross(vTemp2, vTemp);
vTemp2.normalize();
vTemp2.scale(dmesh.scale / 2);
mat.transform(vTemp2);
//control points
float degrees = theta / 5;
while (Math.abs(degrees) > 5)
degrees /= 2;
nPoints = (int) (theta / degrees + 0.5f) + 1;
while (nPoints < 10) {
degrees /= 2;
nPoints = (int) (theta / degrees + 0.5f) + 1;
}
mat.set(new AxisAngle4f(vTemp, (float) (degrees * Math.PI / 180)));
screens = viewer.allocTempScreens(nPoints);
int iBase = nPoints - (dmesh.scale < 2 ? 3 : 3);
for (int i = 0; i < nPoints; i++) {
if (i == iBase)
vpt0.set(vpt1);
vpt1.scaleAdd(1, vTemp2, pt1f);
if (i == 0)
vpt2.set(vpt1);
viewer.transformPoint(vpt1, screens[i]);
mat.transform(vTemp2);
}
if (dmesh.isVector && !dmesh.nohead) {
renderArrowHead(vpt0, vpt1, 0.3f, false, false);
viewer.transformPoint(pt1f, screens[nPoints - 1]);
}