Drawing two orthogonal strings in 3d space in Android Canvas?
- by hasanghaforian
I want to draw two strings in canvas.First string must be rotated around Y axis,for example 45 degrees.Second string must be start at the end of first string and also it must be orthogonal to first string.
This is my code:
String text = "In the";
float textWidth = redPaint.measureText(text);
Matrix m0 = new Matrix();
Matrix m1 = new Matrix();
Matrix m2 = new Matrix();
mCamera = new Camera();
canvas.setMatrix(null);
canvas.save();
mCamera.rotateY(45);
mCamera.getMatrix(m0);
m0.preTranslate(-100, -100);
m0.postTranslate(100, 100);
canvas.setMatrix(m0);
canvas.drawText(text, 100, 100, redPaint);
mCamera = new Camera();
mCamera.rotateY(90);
mCamera.getMatrix(m1);
m1.preTranslate(-textWidth - 100, -100);
m1.postTranslate(textWidth + 100, 100);
m2.setConcat(m1, m0);
canvas.setMatrix(m2);
canvas.drawText(text, 100 + textWidth, 100, greenPaint);
But in result,only first string(text with red font)is visible.
How can I do drawing two orthogonal strings in 3d space?