Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

3D Objects and Rotation Amount Respective of Z Value

조회 수: 2 (최근 30일)
Andrew
Andrew 2011년 4월 12일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi All
I am creating a simple program that has a ball object and a player object. The player has an arm that must raise based on the height of the ball. Eg if the ball starts at point 600 on the z axis, then the arm must raise so that its furthest point is at point 600 also on the Z axis.
I am using a translation array of [cos(z) 0 sin(z); 0 1 0; -sin(z) 0 cos(z)]; Where Z = pi/4 to give me a rotation of 45 degrees in the arm to get close to the ball. How can A) change this so i can specify degrees such as 60, 30 etc and B) is there a way to automatically determine the degree needed based on my balls height? Im starting to think along the lines of a complex if statement to replace Z with a degree if the Z value of my ball is within a certain range.
Many Thanks
Andrew

답변 (1개)

bym
bym 2011년 4월 12일
to specify degrees use cosd() sind() in your matrix
  댓글 수: 2
Andrew
Andrew 2011년 4월 12일
thats solved one of the problems, thanks :)
bym
bym 2011년 4월 12일
I'm not clear on the second question, it seems a trigonometry problem, but I think I am missing something

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by