Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to draw two strings in canvas. The first string must be rotated around the Y axis, for example 45 degrees. The second string must start at the end of the first string and also it must be orthogonal to it.

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();

m0.preTranslate(-100, -100);
m0.postTranslate(100, 100);
canvas.drawText(text, 100, 100, redPaint);

mCamera = new Camera();
m1.preTranslate(-textWidth - 100, -100);
m1.postTranslate(textWidth + 100, 100);

m2.setConcat(m1, m0);
canvas.drawText(text, 100 + textWidth, 100, greenPaint);

But in result, only the first string (drawn red) is visible.

How can I draw two orthogonal strings in 3D space?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.