Having an issue getting a player to change positions relative to a boat's rotation
$begingroup$
What I'm trying to do is make it look like the boat is moving the player with it as the boat turns. As of now, when the boat turns, the player just stays in the same x, y position and looks like he is sliding in a circle.
I have been stuck on this for a few days now and I can't figure out how to solve this. I know that I need the angle the boat is facing, the player's distance from the center of the boat, and a way to make the player's position dependent on the boat's rotation, but I don't know the mathematical equation I need.
Here's a visual reference I've created:
trigonometry
$endgroup$
add a comment |
$begingroup$
What I'm trying to do is make it look like the boat is moving the player with it as the boat turns. As of now, when the boat turns, the player just stays in the same x, y position and looks like he is sliding in a circle.
I have been stuck on this for a few days now and I can't figure out how to solve this. I know that I need the angle the boat is facing, the player's distance from the center of the boat, and a way to make the player's position dependent on the boat's rotation, but I don't know the mathematical equation I need.
Here's a visual reference I've created:
trigonometry
$endgroup$
$begingroup$
How are you rotating the boat itself in the first place?
$endgroup$
– amd
Jan 11 at 2:34
$begingroup$
I'm rotating the boat by using the direction the player is facing. If the ((boat's directional angle - player's directional angle) < -7.5) then the boat will rotate to the right. So it rotates by using the mouse.
$endgroup$
– asdfman
Jan 11 at 2:37
add a comment |
$begingroup$
What I'm trying to do is make it look like the boat is moving the player with it as the boat turns. As of now, when the boat turns, the player just stays in the same x, y position and looks like he is sliding in a circle.
I have been stuck on this for a few days now and I can't figure out how to solve this. I know that I need the angle the boat is facing, the player's distance from the center of the boat, and a way to make the player's position dependent on the boat's rotation, but I don't know the mathematical equation I need.
Here's a visual reference I've created:
trigonometry
$endgroup$
What I'm trying to do is make it look like the boat is moving the player with it as the boat turns. As of now, when the boat turns, the player just stays in the same x, y position and looks like he is sliding in a circle.
I have been stuck on this for a few days now and I can't figure out how to solve this. I know that I need the angle the boat is facing, the player's distance from the center of the boat, and a way to make the player's position dependent on the boat's rotation, but I don't know the mathematical equation I need.
Here's a visual reference I've created:
trigonometry
trigonometry
edited Jan 11 at 21:58
hardmath
28.9k95297
28.9k95297
asked Jan 11 at 1:05
asdfmanasdfman
63
63
$begingroup$
How are you rotating the boat itself in the first place?
$endgroup$
– amd
Jan 11 at 2:34
$begingroup$
I'm rotating the boat by using the direction the player is facing. If the ((boat's directional angle - player's directional angle) < -7.5) then the boat will rotate to the right. So it rotates by using the mouse.
$endgroup$
– asdfman
Jan 11 at 2:37
add a comment |
$begingroup$
How are you rotating the boat itself in the first place?
$endgroup$
– amd
Jan 11 at 2:34
$begingroup$
I'm rotating the boat by using the direction the player is facing. If the ((boat's directional angle - player's directional angle) < -7.5) then the boat will rotate to the right. So it rotates by using the mouse.
$endgroup$
– asdfman
Jan 11 at 2:37
$begingroup$
How are you rotating the boat itself in the first place?
$endgroup$
– amd
Jan 11 at 2:34
$begingroup$
How are you rotating the boat itself in the first place?
$endgroup$
– amd
Jan 11 at 2:34
$begingroup$
I'm rotating the boat by using the direction the player is facing. If the ((boat's directional angle - player's directional angle) < -7.5) then the boat will rotate to the right. So it rotates by using the mouse.
$endgroup$
– asdfman
Jan 11 at 2:37
$begingroup$
I'm rotating the boat by using the direction the player is facing. If the ((boat's directional angle - player's directional angle) < -7.5) then the boat will rotate to the right. So it rotates by using the mouse.
$endgroup$
– asdfman
Jan 11 at 2:37
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
Try using polar coordinates, it would show the player's coordinates with respect to the radius(distance from boat) and angle of rotation.
$endgroup$
$begingroup$
I'll look into these polar opposites. Thank you for the reply.
$endgroup$
– asdfman
Jan 11 at 1:27
$begingroup$
So I've been reading about these polar coordinates and I can't seem to understand how they would work with the boat's rotation. From what I understandof this equation: tan^(-1)(y/x) I'm just plugging in the player's x, y coordinates and then solving for the angle above the x-axis. I don't really understand how this would take into account the boat's rotation. Is there something I'm missing?
$endgroup$
– asdfman
Jan 11 at 2:18
$begingroup$
May you please post a visual so that I can understand the question better, not to fall in any miss-understanding
$endgroup$
– Mohamad Misto
Jan 11 at 9:28
$begingroup$
Here you go: i.imgur.com/3GekCvu.png thank you for taking the time to look into this.
$endgroup$
– asdfman
Jan 11 at 13:16
$begingroup$
I'm sorry mate, still, the problem is not so clear for me, what's the player doing exactly again?
$endgroup$
– Mohamad Misto
Jan 11 at 14:00
|
show 2 more comments
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%2f3069378%2fhaving-an-issue-getting-a-player-to-change-positions-relative-to-a-boats-rotati%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Try using polar coordinates, it would show the player's coordinates with respect to the radius(distance from boat) and angle of rotation.
$endgroup$
$begingroup$
I'll look into these polar opposites. Thank you for the reply.
$endgroup$
– asdfman
Jan 11 at 1:27
$begingroup$
So I've been reading about these polar coordinates and I can't seem to understand how they would work with the boat's rotation. From what I understandof this equation: tan^(-1)(y/x) I'm just plugging in the player's x, y coordinates and then solving for the angle above the x-axis. I don't really understand how this would take into account the boat's rotation. Is there something I'm missing?
$endgroup$
– asdfman
Jan 11 at 2:18
$begingroup$
May you please post a visual so that I can understand the question better, not to fall in any miss-understanding
$endgroup$
– Mohamad Misto
Jan 11 at 9:28
$begingroup$
Here you go: i.imgur.com/3GekCvu.png thank you for taking the time to look into this.
$endgroup$
– asdfman
Jan 11 at 13:16
$begingroup$
I'm sorry mate, still, the problem is not so clear for me, what's the player doing exactly again?
$endgroup$
– Mohamad Misto
Jan 11 at 14:00
|
show 2 more comments
$begingroup$
Try using polar coordinates, it would show the player's coordinates with respect to the radius(distance from boat) and angle of rotation.
$endgroup$
$begingroup$
I'll look into these polar opposites. Thank you for the reply.
$endgroup$
– asdfman
Jan 11 at 1:27
$begingroup$
So I've been reading about these polar coordinates and I can't seem to understand how they would work with the boat's rotation. From what I understandof this equation: tan^(-1)(y/x) I'm just plugging in the player's x, y coordinates and then solving for the angle above the x-axis. I don't really understand how this would take into account the boat's rotation. Is there something I'm missing?
$endgroup$
– asdfman
Jan 11 at 2:18
$begingroup$
May you please post a visual so that I can understand the question better, not to fall in any miss-understanding
$endgroup$
– Mohamad Misto
Jan 11 at 9:28
$begingroup$
Here you go: i.imgur.com/3GekCvu.png thank you for taking the time to look into this.
$endgroup$
– asdfman
Jan 11 at 13:16
$begingroup$
I'm sorry mate, still, the problem is not so clear for me, what's the player doing exactly again?
$endgroup$
– Mohamad Misto
Jan 11 at 14:00
|
show 2 more comments
$begingroup$
Try using polar coordinates, it would show the player's coordinates with respect to the radius(distance from boat) and angle of rotation.
$endgroup$
Try using polar coordinates, it would show the player's coordinates with respect to the radius(distance from boat) and angle of rotation.
answered Jan 11 at 1:12
Mohamad MistoMohamad Misto
516213
516213
$begingroup$
I'll look into these polar opposites. Thank you for the reply.
$endgroup$
– asdfman
Jan 11 at 1:27
$begingroup$
So I've been reading about these polar coordinates and I can't seem to understand how they would work with the boat's rotation. From what I understandof this equation: tan^(-1)(y/x) I'm just plugging in the player's x, y coordinates and then solving for the angle above the x-axis. I don't really understand how this would take into account the boat's rotation. Is there something I'm missing?
$endgroup$
– asdfman
Jan 11 at 2:18
$begingroup$
May you please post a visual so that I can understand the question better, not to fall in any miss-understanding
$endgroup$
– Mohamad Misto
Jan 11 at 9:28
$begingroup$
Here you go: i.imgur.com/3GekCvu.png thank you for taking the time to look into this.
$endgroup$
– asdfman
Jan 11 at 13:16
$begingroup$
I'm sorry mate, still, the problem is not so clear for me, what's the player doing exactly again?
$endgroup$
– Mohamad Misto
Jan 11 at 14:00
|
show 2 more comments
$begingroup$
I'll look into these polar opposites. Thank you for the reply.
$endgroup$
– asdfman
Jan 11 at 1:27
$begingroup$
So I've been reading about these polar coordinates and I can't seem to understand how they would work with the boat's rotation. From what I understandof this equation: tan^(-1)(y/x) I'm just plugging in the player's x, y coordinates and then solving for the angle above the x-axis. I don't really understand how this would take into account the boat's rotation. Is there something I'm missing?
$endgroup$
– asdfman
Jan 11 at 2:18
$begingroup$
May you please post a visual so that I can understand the question better, not to fall in any miss-understanding
$endgroup$
– Mohamad Misto
Jan 11 at 9:28
$begingroup$
Here you go: i.imgur.com/3GekCvu.png thank you for taking the time to look into this.
$endgroup$
– asdfman
Jan 11 at 13:16
$begingroup$
I'm sorry mate, still, the problem is not so clear for me, what's the player doing exactly again?
$endgroup$
– Mohamad Misto
Jan 11 at 14:00
$begingroup$
I'll look into these polar opposites. Thank you for the reply.
$endgroup$
– asdfman
Jan 11 at 1:27
$begingroup$
I'll look into these polar opposites. Thank you for the reply.
$endgroup$
– asdfman
Jan 11 at 1:27
$begingroup$
So I've been reading about these polar coordinates and I can't seem to understand how they would work with the boat's rotation. From what I understandof this equation: tan^(-1)(y/x) I'm just plugging in the player's x, y coordinates and then solving for the angle above the x-axis. I don't really understand how this would take into account the boat's rotation. Is there something I'm missing?
$endgroup$
– asdfman
Jan 11 at 2:18
$begingroup$
So I've been reading about these polar coordinates and I can't seem to understand how they would work with the boat's rotation. From what I understandof this equation: tan^(-1)(y/x) I'm just plugging in the player's x, y coordinates and then solving for the angle above the x-axis. I don't really understand how this would take into account the boat's rotation. Is there something I'm missing?
$endgroup$
– asdfman
Jan 11 at 2:18
$begingroup$
May you please post a visual so that I can understand the question better, not to fall in any miss-understanding
$endgroup$
– Mohamad Misto
Jan 11 at 9:28
$begingroup$
May you please post a visual so that I can understand the question better, not to fall in any miss-understanding
$endgroup$
– Mohamad Misto
Jan 11 at 9:28
$begingroup$
Here you go: i.imgur.com/3GekCvu.png thank you for taking the time to look into this.
$endgroup$
– asdfman
Jan 11 at 13:16
$begingroup$
Here you go: i.imgur.com/3GekCvu.png thank you for taking the time to look into this.
$endgroup$
– asdfman
Jan 11 at 13:16
$begingroup$
I'm sorry mate, still, the problem is not so clear for me, what's the player doing exactly again?
$endgroup$
– Mohamad Misto
Jan 11 at 14:00
$begingroup$
I'm sorry mate, still, the problem is not so clear for me, what's the player doing exactly again?
$endgroup$
– Mohamad Misto
Jan 11 at 14:00
|
show 2 more comments
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.
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%2f3069378%2fhaving-an-issue-getting-a-player-to-change-positions-relative-to-a-boats-rotati%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
$begingroup$
How are you rotating the boat itself in the first place?
$endgroup$
– amd
Jan 11 at 2:34
$begingroup$
I'm rotating the boat by using the direction the player is facing. If the ((boat's directional angle - player's directional angle) < -7.5) then the boat will rotate to the right. So it rotates by using the mouse.
$endgroup$
– asdfman
Jan 11 at 2:37