Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Alright, so I have a triangle that is part of a mesh (3d model) and I need to get the rotation of it's x,y and z axis. Did I say all that right?

rotation of y axis (Math.toDegrees(Math.atan(min.getYf()/max.getYf())

How to get min and max:

Vector3 min = new Vector3((float)Math.min((float) Math.min(v3[s][0].getXf(), v3[s][1].getXf()), v3[s][2].getXf()),
                    (float)Math.min((float)Math.min(v3[s][0].getYf(), v3[s][1].getYf()), v3[s][2].getYf()),
                    (float)Math.min((float)Math.min(v3[s][0].getZf(), v3[s][1].getZf()), v3[s][2].getZf()));

            Vector3 max = new Vector3((float) Math.max((float)Math.max(v3[s][0].getXf(), v3[s][1].getXf()), v3[s][2].getXf()),
                    (float)Math.max((float)Math.max(v3[s][0].getYf(), v3[s][1].getYf()), v3[s][2].getYf()),
                    (float)Math.max((float)Math.max(v3[s][0].getZf(), v3[s][1].getZf()), v3[s][2].getZf()));
share|improve this question
Is your question purely a grammatical one, or is there a mathematical part as well? –  Ryan Budney Dec 7 '10 at 1:53
I need to know how to ask this question so I can ask the question here properly, because I've tried twice: math.stackexchange.com/questions/13294/… math.stackexchange.com/questions/13272/… –  CyanPrime Dec 7 '10 at 1:56
What do you have, and what are you expecting to get from what you have? Give a concrete example, and it might help us sharpen your query. –  J. M. Dec 7 '10 at 1:58
I have the verteices –  CyanPrime Dec 7 '10 at 2:06
@CyanPrime: I believe that you are confused. You seem to have a large project that involves many coordinate transformations. Please take some time to understand something about the subject and formulate questions more carefully. For example, angles are between things. Don't just ask for "the angle", but for "the angle between A and B". If you can clearly define A and B, you may answer your own question, and if not somebody else may answer the question you have instead of the one they guess you have. –  Ross Millikan Dec 7 '10 at 14:21

1 Answer 1

You need some kind of reference. Where did the triangle start and what kind of transformation was applied to it? Was it only rotated or was it also translated?

share|improve this answer
rotated and translated. I can get all three vertices, and I think it starts at 0 degrees for all axis –  CyanPrime Dec 7 '10 at 2:05
Dear minel, welcome to math.stackexchange. Please notice that this answer should rather be a comment because it does not constitute an answer. –  Rasmus Dec 7 '10 at 15:41
@Rasmus: True, but new users don't have enough rep to post comments (you need 50 points). –  Hans Lundmark Dec 7 '10 at 19:09

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.