calculating motion from angles
First, my apologies. This question may have been asked many times before but I do not know the correct terms to search on..... and my school trigonometry is many years ago. Pointing me to an appropriate already-answered question would be an ideal solution for me.
I am writing a program to do 3D view from an observer. I want to calculate motion based upon the direction the observer is looking. I currently define this as angle from directly ahead in two planes. Rotation about the x (left-right) axis gives me elevation (elevationRadians), and rotation about y (up-down) axis gives me left-right. Rotation about z never happens.
I need to calculate the change in cartesian coordinates caused by moving D units in the direction of view.
dx = D * cos(elevationRadians)
dy = D * sin(deflectionRadians)
But I now get two components for dz
dz = D * cos(deflectionRadians)
dz = D * sin(elevationRadians)
How should I combine these terms to give realistic movement? Should I add them, average them, or something else? Part of me thinks that simply adding them will give too large a dz. Could someone confirm, deny, or point me to a good resource for this please.......
Edit: rotation about y gives 'deflection..
My axes: x: left -> right, y: down -> up, z: behind -> in front.
Thanks to Andei's amswer which almost worked (I think our axes differed), I wound up with this:
dx = D cos(elevationRadians) cos(deflectionRadians)
dy = D sin(elevationRadians) sin(deflectionRadians)
dz = D sin(elevationRadians)
which seems to work a lot better than what I had.
What is the mathematical term for what I am trying to do? I need to read some theory preferably at the simple end of the scale.
vectors coordinate-systems
add a comment |
First, my apologies. This question may have been asked many times before but I do not know the correct terms to search on..... and my school trigonometry is many years ago. Pointing me to an appropriate already-answered question would be an ideal solution for me.
I am writing a program to do 3D view from an observer. I want to calculate motion based upon the direction the observer is looking. I currently define this as angle from directly ahead in two planes. Rotation about the x (left-right) axis gives me elevation (elevationRadians), and rotation about y (up-down) axis gives me left-right. Rotation about z never happens.
I need to calculate the change in cartesian coordinates caused by moving D units in the direction of view.
dx = D * cos(elevationRadians)
dy = D * sin(deflectionRadians)
But I now get two components for dz
dz = D * cos(deflectionRadians)
dz = D * sin(elevationRadians)
How should I combine these terms to give realistic movement? Should I add them, average them, or something else? Part of me thinks that simply adding them will give too large a dz. Could someone confirm, deny, or point me to a good resource for this please.......
Edit: rotation about y gives 'deflection..
My axes: x: left -> right, y: down -> up, z: behind -> in front.
Thanks to Andei's amswer which almost worked (I think our axes differed), I wound up with this:
dx = D cos(elevationRadians) cos(deflectionRadians)
dy = D sin(elevationRadians) sin(deflectionRadians)
dz = D sin(elevationRadians)
which seems to work a lot better than what I had.
What is the mathematical term for what I am trying to do? I need to read some theory preferably at the simple end of the scale.
vectors coordinate-systems
look up "change to spherical coordinates"
– Andrei
Dec 3 '18 at 18:27
add a comment |
First, my apologies. This question may have been asked many times before but I do not know the correct terms to search on..... and my school trigonometry is many years ago. Pointing me to an appropriate already-answered question would be an ideal solution for me.
I am writing a program to do 3D view from an observer. I want to calculate motion based upon the direction the observer is looking. I currently define this as angle from directly ahead in two planes. Rotation about the x (left-right) axis gives me elevation (elevationRadians), and rotation about y (up-down) axis gives me left-right. Rotation about z never happens.
I need to calculate the change in cartesian coordinates caused by moving D units in the direction of view.
dx = D * cos(elevationRadians)
dy = D * sin(deflectionRadians)
But I now get two components for dz
dz = D * cos(deflectionRadians)
dz = D * sin(elevationRadians)
How should I combine these terms to give realistic movement? Should I add them, average them, or something else? Part of me thinks that simply adding them will give too large a dz. Could someone confirm, deny, or point me to a good resource for this please.......
Edit: rotation about y gives 'deflection..
My axes: x: left -> right, y: down -> up, z: behind -> in front.
Thanks to Andei's amswer which almost worked (I think our axes differed), I wound up with this:
dx = D cos(elevationRadians) cos(deflectionRadians)
dy = D sin(elevationRadians) sin(deflectionRadians)
dz = D sin(elevationRadians)
which seems to work a lot better than what I had.
What is the mathematical term for what I am trying to do? I need to read some theory preferably at the simple end of the scale.
vectors coordinate-systems
First, my apologies. This question may have been asked many times before but I do not know the correct terms to search on..... and my school trigonometry is many years ago. Pointing me to an appropriate already-answered question would be an ideal solution for me.
I am writing a program to do 3D view from an observer. I want to calculate motion based upon the direction the observer is looking. I currently define this as angle from directly ahead in two planes. Rotation about the x (left-right) axis gives me elevation (elevationRadians), and rotation about y (up-down) axis gives me left-right. Rotation about z never happens.
I need to calculate the change in cartesian coordinates caused by moving D units in the direction of view.
dx = D * cos(elevationRadians)
dy = D * sin(deflectionRadians)
But I now get two components for dz
dz = D * cos(deflectionRadians)
dz = D * sin(elevationRadians)
How should I combine these terms to give realistic movement? Should I add them, average them, or something else? Part of me thinks that simply adding them will give too large a dz. Could someone confirm, deny, or point me to a good resource for this please.......
Edit: rotation about y gives 'deflection..
My axes: x: left -> right, y: down -> up, z: behind -> in front.
Thanks to Andei's amswer which almost worked (I think our axes differed), I wound up with this:
dx = D cos(elevationRadians) cos(deflectionRadians)
dy = D sin(elevationRadians) sin(deflectionRadians)
dz = D sin(elevationRadians)
which seems to work a lot better than what I had.
What is the mathematical term for what I am trying to do? I need to read some theory preferably at the simple end of the scale.
vectors coordinate-systems
vectors coordinate-systems
edited Dec 3 '18 at 17:22
DrPhill
asked Dec 3 '18 at 14:59
DrPhillDrPhill
33
33
look up "change to spherical coordinates"
– Andrei
Dec 3 '18 at 18:27
add a comment |
look up "change to spherical coordinates"
– Andrei
Dec 3 '18 at 18:27
look up "change to spherical coordinates"
– Andrei
Dec 3 '18 at 18:27
look up "change to spherical coordinates"
– Andrei
Dec 3 '18 at 18:27
add a comment |
2 Answers
2
active
oldest
votes
I think you don't define your axes correctly. You have rotation around $z$, and in the next sentence you say it never happens.
I think you should use polar coordinates. If you call $theta$ the angle from the vertical direction $z$, $theta=pi/2-text{elevationRadians}$, and $phi=text{deflectionRadians}$ is the angle that the projection in the horizontal plane makes with the $x$ axis, you have:$$begin{align}x&=Dsinthetacosphi\y&=Dsinthetasinphi\z&=Dcosthetaend{align}$$
Ahhh thank you. I will give that a try. I corrected my answer - rotation about Y gives deflection.
– DrPhill
Dec 3 '18 at 15:58
Note that my vertical axis is $z$
– Andrei
Dec 3 '18 at 16:18
It may be that I am using different axes than you, but your solution did not work as given. (Or it may be my inability to visualise these 3D spaces in code). I am having difficulty formatting the comments so I will edit my answer.
– DrPhill
Dec 3 '18 at 17:12
The one with elevation only is the vertical axis: dy=D sin(elevationRadians). Then if you have deflectionRadians measured from the x axis, you get dx=D cos(elevationRadians) cos(deflectionRadians), and dz= cos(elevationRadians) sin(deflectionRadians)
– Andrei
Dec 3 '18 at 18:27
I was encountering two problems. The coordinate system in the program I am using was different to the standard/mathematical one. I had to mentally transpose y and z. Also the zero-points of each angle (elevation, azimuth) were not lined up in the same way. Once I had made these transformations in my code it worked a treat. Thanks for your patience.
– DrPhill
Dec 3 '18 at 20:42
add a comment |
I would look to solve this using utility methods contained in 3D Vectors. I'm not sure what you're using for creating the application, but I've found Unity 3D's documentation on 3D vector Math to be very easy to follow (regardless of whether you're working in Unity).
https://unity3d.com/learn/tutorials/topics/scripting/vector-maths
For example - in response to your specific question about the size of "dz" I would use the "normalize" method of a Vector3 which gives you a vector unit length of 1 and then scale this vector by whatever magnitude you need.
I am using javafx. I had a quick look at the Unity documentation, and It seems to deal with vectors. I had started to define the direction that I was looking in in terms of angles, and have dificulty converting these angles to vectors. Perhaps I should define the direction in vector terms, and all the trigonometry would disappear.
– DrPhill
Dec 3 '18 at 17:32
I find that it's easier to think about and work with Vectors when handling motion or interaction in 3D. It's relative simply to go back and forth, but angles can be tricky in 3D (particularly when interpolating - see "Gimbal lock"). Quaternions offer a solution to this issue. You may not need this level of complexity, but it's probably not worth trying to reinvent the wheel here.
– goulding
Dec 3 '18 at 19:33
Unfortunately my imterface or the 'camera' requires angles, but the rest of the 3D model requires cartesian coordinates. So I need to convert the camera angle to a vector(?).
– DrPhill
Dec 3 '18 at 20:38
I believe those angles are usually specified as Euler Angles. The Unity docs on Rotation and Orientation do a nice job of explaining the relationship.
– goulding
Dec 3 '18 at 21:49
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3024169%2fcalculating-motion-from-angles%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I think you don't define your axes correctly. You have rotation around $z$, and in the next sentence you say it never happens.
I think you should use polar coordinates. If you call $theta$ the angle from the vertical direction $z$, $theta=pi/2-text{elevationRadians}$, and $phi=text{deflectionRadians}$ is the angle that the projection in the horizontal plane makes with the $x$ axis, you have:$$begin{align}x&=Dsinthetacosphi\y&=Dsinthetasinphi\z&=Dcosthetaend{align}$$
Ahhh thank you. I will give that a try. I corrected my answer - rotation about Y gives deflection.
– DrPhill
Dec 3 '18 at 15:58
Note that my vertical axis is $z$
– Andrei
Dec 3 '18 at 16:18
It may be that I am using different axes than you, but your solution did not work as given. (Or it may be my inability to visualise these 3D spaces in code). I am having difficulty formatting the comments so I will edit my answer.
– DrPhill
Dec 3 '18 at 17:12
The one with elevation only is the vertical axis: dy=D sin(elevationRadians). Then if you have deflectionRadians measured from the x axis, you get dx=D cos(elevationRadians) cos(deflectionRadians), and dz= cos(elevationRadians) sin(deflectionRadians)
– Andrei
Dec 3 '18 at 18:27
I was encountering two problems. The coordinate system in the program I am using was different to the standard/mathematical one. I had to mentally transpose y and z. Also the zero-points of each angle (elevation, azimuth) were not lined up in the same way. Once I had made these transformations in my code it worked a treat. Thanks for your patience.
– DrPhill
Dec 3 '18 at 20:42
add a comment |
I think you don't define your axes correctly. You have rotation around $z$, and in the next sentence you say it never happens.
I think you should use polar coordinates. If you call $theta$ the angle from the vertical direction $z$, $theta=pi/2-text{elevationRadians}$, and $phi=text{deflectionRadians}$ is the angle that the projection in the horizontal plane makes with the $x$ axis, you have:$$begin{align}x&=Dsinthetacosphi\y&=Dsinthetasinphi\z&=Dcosthetaend{align}$$
Ahhh thank you. I will give that a try. I corrected my answer - rotation about Y gives deflection.
– DrPhill
Dec 3 '18 at 15:58
Note that my vertical axis is $z$
– Andrei
Dec 3 '18 at 16:18
It may be that I am using different axes than you, but your solution did not work as given. (Or it may be my inability to visualise these 3D spaces in code). I am having difficulty formatting the comments so I will edit my answer.
– DrPhill
Dec 3 '18 at 17:12
The one with elevation only is the vertical axis: dy=D sin(elevationRadians). Then if you have deflectionRadians measured from the x axis, you get dx=D cos(elevationRadians) cos(deflectionRadians), and dz= cos(elevationRadians) sin(deflectionRadians)
– Andrei
Dec 3 '18 at 18:27
I was encountering two problems. The coordinate system in the program I am using was different to the standard/mathematical one. I had to mentally transpose y and z. Also the zero-points of each angle (elevation, azimuth) were not lined up in the same way. Once I had made these transformations in my code it worked a treat. Thanks for your patience.
– DrPhill
Dec 3 '18 at 20:42
add a comment |
I think you don't define your axes correctly. You have rotation around $z$, and in the next sentence you say it never happens.
I think you should use polar coordinates. If you call $theta$ the angle from the vertical direction $z$, $theta=pi/2-text{elevationRadians}$, and $phi=text{deflectionRadians}$ is the angle that the projection in the horizontal plane makes with the $x$ axis, you have:$$begin{align}x&=Dsinthetacosphi\y&=Dsinthetasinphi\z&=Dcosthetaend{align}$$
I think you don't define your axes correctly. You have rotation around $z$, and in the next sentence you say it never happens.
I think you should use polar coordinates. If you call $theta$ the angle from the vertical direction $z$, $theta=pi/2-text{elevationRadians}$, and $phi=text{deflectionRadians}$ is the angle that the projection in the horizontal plane makes with the $x$ axis, you have:$$begin{align}x&=Dsinthetacosphi\y&=Dsinthetasinphi\z&=Dcosthetaend{align}$$
answered Dec 3 '18 at 15:35
AndreiAndrei
11.4k21026
11.4k21026
Ahhh thank you. I will give that a try. I corrected my answer - rotation about Y gives deflection.
– DrPhill
Dec 3 '18 at 15:58
Note that my vertical axis is $z$
– Andrei
Dec 3 '18 at 16:18
It may be that I am using different axes than you, but your solution did not work as given. (Or it may be my inability to visualise these 3D spaces in code). I am having difficulty formatting the comments so I will edit my answer.
– DrPhill
Dec 3 '18 at 17:12
The one with elevation only is the vertical axis: dy=D sin(elevationRadians). Then if you have deflectionRadians measured from the x axis, you get dx=D cos(elevationRadians) cos(deflectionRadians), and dz= cos(elevationRadians) sin(deflectionRadians)
– Andrei
Dec 3 '18 at 18:27
I was encountering two problems. The coordinate system in the program I am using was different to the standard/mathematical one. I had to mentally transpose y and z. Also the zero-points of each angle (elevation, azimuth) were not lined up in the same way. Once I had made these transformations in my code it worked a treat. Thanks for your patience.
– DrPhill
Dec 3 '18 at 20:42
add a comment |
Ahhh thank you. I will give that a try. I corrected my answer - rotation about Y gives deflection.
– DrPhill
Dec 3 '18 at 15:58
Note that my vertical axis is $z$
– Andrei
Dec 3 '18 at 16:18
It may be that I am using different axes than you, but your solution did not work as given. (Or it may be my inability to visualise these 3D spaces in code). I am having difficulty formatting the comments so I will edit my answer.
– DrPhill
Dec 3 '18 at 17:12
The one with elevation only is the vertical axis: dy=D sin(elevationRadians). Then if you have deflectionRadians measured from the x axis, you get dx=D cos(elevationRadians) cos(deflectionRadians), and dz= cos(elevationRadians) sin(deflectionRadians)
– Andrei
Dec 3 '18 at 18:27
I was encountering two problems. The coordinate system in the program I am using was different to the standard/mathematical one. I had to mentally transpose y and z. Also the zero-points of each angle (elevation, azimuth) were not lined up in the same way. Once I had made these transformations in my code it worked a treat. Thanks for your patience.
– DrPhill
Dec 3 '18 at 20:42
Ahhh thank you. I will give that a try. I corrected my answer - rotation about Y gives deflection.
– DrPhill
Dec 3 '18 at 15:58
Ahhh thank you. I will give that a try. I corrected my answer - rotation about Y gives deflection.
– DrPhill
Dec 3 '18 at 15:58
Note that my vertical axis is $z$
– Andrei
Dec 3 '18 at 16:18
Note that my vertical axis is $z$
– Andrei
Dec 3 '18 at 16:18
It may be that I am using different axes than you, but your solution did not work as given. (Or it may be my inability to visualise these 3D spaces in code). I am having difficulty formatting the comments so I will edit my answer.
– DrPhill
Dec 3 '18 at 17:12
It may be that I am using different axes than you, but your solution did not work as given. (Or it may be my inability to visualise these 3D spaces in code). I am having difficulty formatting the comments so I will edit my answer.
– DrPhill
Dec 3 '18 at 17:12
The one with elevation only is the vertical axis: dy=D sin(elevationRadians). Then if you have deflectionRadians measured from the x axis, you get dx=D cos(elevationRadians) cos(deflectionRadians), and dz= cos(elevationRadians) sin(deflectionRadians)
– Andrei
Dec 3 '18 at 18:27
The one with elevation only is the vertical axis: dy=D sin(elevationRadians). Then if you have deflectionRadians measured from the x axis, you get dx=D cos(elevationRadians) cos(deflectionRadians), and dz= cos(elevationRadians) sin(deflectionRadians)
– Andrei
Dec 3 '18 at 18:27
I was encountering two problems. The coordinate system in the program I am using was different to the standard/mathematical one. I had to mentally transpose y and z. Also the zero-points of each angle (elevation, azimuth) were not lined up in the same way. Once I had made these transformations in my code it worked a treat. Thanks for your patience.
– DrPhill
Dec 3 '18 at 20:42
I was encountering two problems. The coordinate system in the program I am using was different to the standard/mathematical one. I had to mentally transpose y and z. Also the zero-points of each angle (elevation, azimuth) were not lined up in the same way. Once I had made these transformations in my code it worked a treat. Thanks for your patience.
– DrPhill
Dec 3 '18 at 20:42
add a comment |
I would look to solve this using utility methods contained in 3D Vectors. I'm not sure what you're using for creating the application, but I've found Unity 3D's documentation on 3D vector Math to be very easy to follow (regardless of whether you're working in Unity).
https://unity3d.com/learn/tutorials/topics/scripting/vector-maths
For example - in response to your specific question about the size of "dz" I would use the "normalize" method of a Vector3 which gives you a vector unit length of 1 and then scale this vector by whatever magnitude you need.
I am using javafx. I had a quick look at the Unity documentation, and It seems to deal with vectors. I had started to define the direction that I was looking in in terms of angles, and have dificulty converting these angles to vectors. Perhaps I should define the direction in vector terms, and all the trigonometry would disappear.
– DrPhill
Dec 3 '18 at 17:32
I find that it's easier to think about and work with Vectors when handling motion or interaction in 3D. It's relative simply to go back and forth, but angles can be tricky in 3D (particularly when interpolating - see "Gimbal lock"). Quaternions offer a solution to this issue. You may not need this level of complexity, but it's probably not worth trying to reinvent the wheel here.
– goulding
Dec 3 '18 at 19:33
Unfortunately my imterface or the 'camera' requires angles, but the rest of the 3D model requires cartesian coordinates. So I need to convert the camera angle to a vector(?).
– DrPhill
Dec 3 '18 at 20:38
I believe those angles are usually specified as Euler Angles. The Unity docs on Rotation and Orientation do a nice job of explaining the relationship.
– goulding
Dec 3 '18 at 21:49
add a comment |
I would look to solve this using utility methods contained in 3D Vectors. I'm not sure what you're using for creating the application, but I've found Unity 3D's documentation on 3D vector Math to be very easy to follow (regardless of whether you're working in Unity).
https://unity3d.com/learn/tutorials/topics/scripting/vector-maths
For example - in response to your specific question about the size of "dz" I would use the "normalize" method of a Vector3 which gives you a vector unit length of 1 and then scale this vector by whatever magnitude you need.
I am using javafx. I had a quick look at the Unity documentation, and It seems to deal with vectors. I had started to define the direction that I was looking in in terms of angles, and have dificulty converting these angles to vectors. Perhaps I should define the direction in vector terms, and all the trigonometry would disappear.
– DrPhill
Dec 3 '18 at 17:32
I find that it's easier to think about and work with Vectors when handling motion or interaction in 3D. It's relative simply to go back and forth, but angles can be tricky in 3D (particularly when interpolating - see "Gimbal lock"). Quaternions offer a solution to this issue. You may not need this level of complexity, but it's probably not worth trying to reinvent the wheel here.
– goulding
Dec 3 '18 at 19:33
Unfortunately my imterface or the 'camera' requires angles, but the rest of the 3D model requires cartesian coordinates. So I need to convert the camera angle to a vector(?).
– DrPhill
Dec 3 '18 at 20:38
I believe those angles are usually specified as Euler Angles. The Unity docs on Rotation and Orientation do a nice job of explaining the relationship.
– goulding
Dec 3 '18 at 21:49
add a comment |
I would look to solve this using utility methods contained in 3D Vectors. I'm not sure what you're using for creating the application, but I've found Unity 3D's documentation on 3D vector Math to be very easy to follow (regardless of whether you're working in Unity).
https://unity3d.com/learn/tutorials/topics/scripting/vector-maths
For example - in response to your specific question about the size of "dz" I would use the "normalize" method of a Vector3 which gives you a vector unit length of 1 and then scale this vector by whatever magnitude you need.
I would look to solve this using utility methods contained in 3D Vectors. I'm not sure what you're using for creating the application, but I've found Unity 3D's documentation on 3D vector Math to be very easy to follow (regardless of whether you're working in Unity).
https://unity3d.com/learn/tutorials/topics/scripting/vector-maths
For example - in response to your specific question about the size of "dz" I would use the "normalize" method of a Vector3 which gives you a vector unit length of 1 and then scale this vector by whatever magnitude you need.
answered Dec 3 '18 at 17:18
gouldinggoulding
63
63
I am using javafx. I had a quick look at the Unity documentation, and It seems to deal with vectors. I had started to define the direction that I was looking in in terms of angles, and have dificulty converting these angles to vectors. Perhaps I should define the direction in vector terms, and all the trigonometry would disappear.
– DrPhill
Dec 3 '18 at 17:32
I find that it's easier to think about and work with Vectors when handling motion or interaction in 3D. It's relative simply to go back and forth, but angles can be tricky in 3D (particularly when interpolating - see "Gimbal lock"). Quaternions offer a solution to this issue. You may not need this level of complexity, but it's probably not worth trying to reinvent the wheel here.
– goulding
Dec 3 '18 at 19:33
Unfortunately my imterface or the 'camera' requires angles, but the rest of the 3D model requires cartesian coordinates. So I need to convert the camera angle to a vector(?).
– DrPhill
Dec 3 '18 at 20:38
I believe those angles are usually specified as Euler Angles. The Unity docs on Rotation and Orientation do a nice job of explaining the relationship.
– goulding
Dec 3 '18 at 21:49
add a comment |
I am using javafx. I had a quick look at the Unity documentation, and It seems to deal with vectors. I had started to define the direction that I was looking in in terms of angles, and have dificulty converting these angles to vectors. Perhaps I should define the direction in vector terms, and all the trigonometry would disappear.
– DrPhill
Dec 3 '18 at 17:32
I find that it's easier to think about and work with Vectors when handling motion or interaction in 3D. It's relative simply to go back and forth, but angles can be tricky in 3D (particularly when interpolating - see "Gimbal lock"). Quaternions offer a solution to this issue. You may not need this level of complexity, but it's probably not worth trying to reinvent the wheel here.
– goulding
Dec 3 '18 at 19:33
Unfortunately my imterface or the 'camera' requires angles, but the rest of the 3D model requires cartesian coordinates. So I need to convert the camera angle to a vector(?).
– DrPhill
Dec 3 '18 at 20:38
I believe those angles are usually specified as Euler Angles. The Unity docs on Rotation and Orientation do a nice job of explaining the relationship.
– goulding
Dec 3 '18 at 21:49
I am using javafx. I had a quick look at the Unity documentation, and It seems to deal with vectors. I had started to define the direction that I was looking in in terms of angles, and have dificulty converting these angles to vectors. Perhaps I should define the direction in vector terms, and all the trigonometry would disappear.
– DrPhill
Dec 3 '18 at 17:32
I am using javafx. I had a quick look at the Unity documentation, and It seems to deal with vectors. I had started to define the direction that I was looking in in terms of angles, and have dificulty converting these angles to vectors. Perhaps I should define the direction in vector terms, and all the trigonometry would disappear.
– DrPhill
Dec 3 '18 at 17:32
I find that it's easier to think about and work with Vectors when handling motion or interaction in 3D. It's relative simply to go back and forth, but angles can be tricky in 3D (particularly when interpolating - see "Gimbal lock"). Quaternions offer a solution to this issue. You may not need this level of complexity, but it's probably not worth trying to reinvent the wheel here.
– goulding
Dec 3 '18 at 19:33
I find that it's easier to think about and work with Vectors when handling motion or interaction in 3D. It's relative simply to go back and forth, but angles can be tricky in 3D (particularly when interpolating - see "Gimbal lock"). Quaternions offer a solution to this issue. You may not need this level of complexity, but it's probably not worth trying to reinvent the wheel here.
– goulding
Dec 3 '18 at 19:33
Unfortunately my imterface or the 'camera' requires angles, but the rest of the 3D model requires cartesian coordinates. So I need to convert the camera angle to a vector(?).
– DrPhill
Dec 3 '18 at 20:38
Unfortunately my imterface or the 'camera' requires angles, but the rest of the 3D model requires cartesian coordinates. So I need to convert the camera angle to a vector(?).
– DrPhill
Dec 3 '18 at 20:38
I believe those angles are usually specified as Euler Angles. The Unity docs on Rotation and Orientation do a nice job of explaining the relationship.
– goulding
Dec 3 '18 at 21:49
I believe those angles are usually specified as Euler Angles. The Unity docs on Rotation and Orientation do a nice job of explaining the relationship.
– goulding
Dec 3 '18 at 21:49
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3024169%2fcalculating-motion-from-angles%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
look up "change to spherical coordinates"
– Andrei
Dec 3 '18 at 18:27