Rotating 3D points around a Z axis












0












$begingroup$


I'm messing around with a script for the game and I'm trying to rotate a house.



House consists of multiple objects.



I need to rotate a house for certain degrees but I'm not very good at math and need help with the equation.



Let's say I have a Z axis, an angle alpha and I need to rotate house objects around axis Z for angle alpha degrees and keep the house in the same shape.










share|cite|improve this question











$endgroup$












  • $begingroup$
    You can rotate 3D objects around an axis or fulcrum in 3-space. When rotating around a point, possibilities are infinite.
    $endgroup$
    – Narasimham
    Dec 14 '18 at 15:15












  • $begingroup$
    Need to rotate it around the Z axis. Edited. Thanks.
    $endgroup$
    – Marin Kovač
    Dec 14 '18 at 15:16










  • $begingroup$
    I would use quaternions. They have the theoretical advantage of no gimbal lock, and you can rotate about an arbitrary axis. See the wiki pages for more information. Your programming language probably has a quaternion library you can use for that.
    $endgroup$
    – Adrian Keister
    Dec 14 '18 at 15:18
















0












$begingroup$


I'm messing around with a script for the game and I'm trying to rotate a house.



House consists of multiple objects.



I need to rotate a house for certain degrees but I'm not very good at math and need help with the equation.



Let's say I have a Z axis, an angle alpha and I need to rotate house objects around axis Z for angle alpha degrees and keep the house in the same shape.










share|cite|improve this question











$endgroup$












  • $begingroup$
    You can rotate 3D objects around an axis or fulcrum in 3-space. When rotating around a point, possibilities are infinite.
    $endgroup$
    – Narasimham
    Dec 14 '18 at 15:15












  • $begingroup$
    Need to rotate it around the Z axis. Edited. Thanks.
    $endgroup$
    – Marin Kovač
    Dec 14 '18 at 15:16










  • $begingroup$
    I would use quaternions. They have the theoretical advantage of no gimbal lock, and you can rotate about an arbitrary axis. See the wiki pages for more information. Your programming language probably has a quaternion library you can use for that.
    $endgroup$
    – Adrian Keister
    Dec 14 '18 at 15:18














0












0








0





$begingroup$


I'm messing around with a script for the game and I'm trying to rotate a house.



House consists of multiple objects.



I need to rotate a house for certain degrees but I'm not very good at math and need help with the equation.



Let's say I have a Z axis, an angle alpha and I need to rotate house objects around axis Z for angle alpha degrees and keep the house in the same shape.










share|cite|improve this question











$endgroup$




I'm messing around with a script for the game and I'm trying to rotate a house.



House consists of multiple objects.



I need to rotate a house for certain degrees but I'm not very good at math and need help with the equation.



Let's say I have a Z axis, an angle alpha and I need to rotate house objects around axis Z for angle alpha degrees and keep the house in the same shape.







rotations






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 14 '18 at 15:16







Marin Kovač

















asked Dec 14 '18 at 15:09









Marin KovačMarin Kovač

52




52












  • $begingroup$
    You can rotate 3D objects around an axis or fulcrum in 3-space. When rotating around a point, possibilities are infinite.
    $endgroup$
    – Narasimham
    Dec 14 '18 at 15:15












  • $begingroup$
    Need to rotate it around the Z axis. Edited. Thanks.
    $endgroup$
    – Marin Kovač
    Dec 14 '18 at 15:16










  • $begingroup$
    I would use quaternions. They have the theoretical advantage of no gimbal lock, and you can rotate about an arbitrary axis. See the wiki pages for more information. Your programming language probably has a quaternion library you can use for that.
    $endgroup$
    – Adrian Keister
    Dec 14 '18 at 15:18


















  • $begingroup$
    You can rotate 3D objects around an axis or fulcrum in 3-space. When rotating around a point, possibilities are infinite.
    $endgroup$
    – Narasimham
    Dec 14 '18 at 15:15












  • $begingroup$
    Need to rotate it around the Z axis. Edited. Thanks.
    $endgroup$
    – Marin Kovač
    Dec 14 '18 at 15:16










  • $begingroup$
    I would use quaternions. They have the theoretical advantage of no gimbal lock, and you can rotate about an arbitrary axis. See the wiki pages for more information. Your programming language probably has a quaternion library you can use for that.
    $endgroup$
    – Adrian Keister
    Dec 14 '18 at 15:18
















$begingroup$
You can rotate 3D objects around an axis or fulcrum in 3-space. When rotating around a point, possibilities are infinite.
$endgroup$
– Narasimham
Dec 14 '18 at 15:15






$begingroup$
You can rotate 3D objects around an axis or fulcrum in 3-space. When rotating around a point, possibilities are infinite.
$endgroup$
– Narasimham
Dec 14 '18 at 15:15














$begingroup$
Need to rotate it around the Z axis. Edited. Thanks.
$endgroup$
– Marin Kovač
Dec 14 '18 at 15:16




$begingroup$
Need to rotate it around the Z axis. Edited. Thanks.
$endgroup$
– Marin Kovač
Dec 14 '18 at 15:16












$begingroup$
I would use quaternions. They have the theoretical advantage of no gimbal lock, and you can rotate about an arbitrary axis. See the wiki pages for more information. Your programming language probably has a quaternion library you can use for that.
$endgroup$
– Adrian Keister
Dec 14 '18 at 15:18




$begingroup$
I would use quaternions. They have the theoretical advantage of no gimbal lock, and you can rotate about an arbitrary axis. See the wiki pages for more information. Your programming language probably has a quaternion library you can use for that.
$endgroup$
– Adrian Keister
Dec 14 '18 at 15:18










1 Answer
1






active

oldest

votes


















0












$begingroup$

Let the point on 3D house be $(x,y,z)$. $z$ coordinate is unaltered.



$$ x_1= x cos theta- y sin theta;, y_1= x sin theta + y cos theta , , z_1=z; ,$$






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Object's Z position is unaltered but the Z angle is not. Using the following equations you gave me I should get the same looking but rotated house if I set the object's Z rotation to θ, right?
    $endgroup$
    – Marin Kovač
    Dec 14 '18 at 15:25












  • $begingroup$
    What I gave is for a single point.The shape of house ( called projection) for several points and so planes contained between them as viewed from another view point would change.
    $endgroup$
    – Narasimham
    Dec 14 '18 at 15:31











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


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3039473%2frotating-3d-points-around-a-z-axis%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









0












$begingroup$

Let the point on 3D house be $(x,y,z)$. $z$ coordinate is unaltered.



$$ x_1= x cos theta- y sin theta;, y_1= x sin theta + y cos theta , , z_1=z; ,$$






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Object's Z position is unaltered but the Z angle is not. Using the following equations you gave me I should get the same looking but rotated house if I set the object's Z rotation to θ, right?
    $endgroup$
    – Marin Kovač
    Dec 14 '18 at 15:25












  • $begingroup$
    What I gave is for a single point.The shape of house ( called projection) for several points and so planes contained between them as viewed from another view point would change.
    $endgroup$
    – Narasimham
    Dec 14 '18 at 15:31
















0












$begingroup$

Let the point on 3D house be $(x,y,z)$. $z$ coordinate is unaltered.



$$ x_1= x cos theta- y sin theta;, y_1= x sin theta + y cos theta , , z_1=z; ,$$






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Object's Z position is unaltered but the Z angle is not. Using the following equations you gave me I should get the same looking but rotated house if I set the object's Z rotation to θ, right?
    $endgroup$
    – Marin Kovač
    Dec 14 '18 at 15:25












  • $begingroup$
    What I gave is for a single point.The shape of house ( called projection) for several points and so planes contained between them as viewed from another view point would change.
    $endgroup$
    – Narasimham
    Dec 14 '18 at 15:31














0












0








0





$begingroup$

Let the point on 3D house be $(x,y,z)$. $z$ coordinate is unaltered.



$$ x_1= x cos theta- y sin theta;, y_1= x sin theta + y cos theta , , z_1=z; ,$$






share|cite|improve this answer











$endgroup$



Let the point on 3D house be $(x,y,z)$. $z$ coordinate is unaltered.



$$ x_1= x cos theta- y sin theta;, y_1= x sin theta + y cos theta , , z_1=z; ,$$







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Dec 14 '18 at 15:32

























answered Dec 14 '18 at 15:21









NarasimhamNarasimham

20.9k62158




20.9k62158












  • $begingroup$
    Object's Z position is unaltered but the Z angle is not. Using the following equations you gave me I should get the same looking but rotated house if I set the object's Z rotation to θ, right?
    $endgroup$
    – Marin Kovač
    Dec 14 '18 at 15:25












  • $begingroup$
    What I gave is for a single point.The shape of house ( called projection) for several points and so planes contained between them as viewed from another view point would change.
    $endgroup$
    – Narasimham
    Dec 14 '18 at 15:31


















  • $begingroup$
    Object's Z position is unaltered but the Z angle is not. Using the following equations you gave me I should get the same looking but rotated house if I set the object's Z rotation to θ, right?
    $endgroup$
    – Marin Kovač
    Dec 14 '18 at 15:25












  • $begingroup$
    What I gave is for a single point.The shape of house ( called projection) for several points and so planes contained between them as viewed from another view point would change.
    $endgroup$
    – Narasimham
    Dec 14 '18 at 15:31
















$begingroup$
Object's Z position is unaltered but the Z angle is not. Using the following equations you gave me I should get the same looking but rotated house if I set the object's Z rotation to θ, right?
$endgroup$
– Marin Kovač
Dec 14 '18 at 15:25






$begingroup$
Object's Z position is unaltered but the Z angle is not. Using the following equations you gave me I should get the same looking but rotated house if I set the object's Z rotation to θ, right?
$endgroup$
– Marin Kovač
Dec 14 '18 at 15:25














$begingroup$
What I gave is for a single point.The shape of house ( called projection) for several points and so planes contained between them as viewed from another view point would change.
$endgroup$
– Narasimham
Dec 14 '18 at 15:31




$begingroup$
What I gave is for a single point.The shape of house ( called projection) for several points and so planes contained between them as viewed from another view point would change.
$endgroup$
– Narasimham
Dec 14 '18 at 15:31


















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3039473%2frotating-3d-points-around-a-z-axis%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Plaza Victoria

Puebla de Zaragoza

Musa