Rotate line to be align to axis

   1657   4   1
User Avatar
Member
31 posts
Joined: 9月 2018
Offline
Hi,
I need some help to solve this.
I want to be able to find the amount of rotation necessary to align this line to the axis.
For example, the amount to find here is “14.25”, but proceduraly.



Thank you
Edited by RonanCroyal - 2020年4月3日 11:17:16

Attachments:
RotateToAlignToAxis.rar (20.7 KB)
helplinetoaxis.png (1.2 MB)

User Avatar
Member
26 posts
Joined: 12月 2019
Offline
You can use dot product to get degrees and compenste with a Transfrom node.

Attachments:
RotateToAlignToAxis.hipnc (198.1 KB)

User Avatar
Member
555 posts
Joined: 2月 2017
Offline
what the ???

to me it's a triangle….use trig:

soh cah toa

tan x = opposite/adjacent

01) get the N with polyframe (the N represents the hypotenuse of said triangle)
02) then take advantage of this N

Attachments:
vu_RotateToAlignToAxis.hiplc (156.3 KB)

User Avatar
Member
31 posts
Joined: 9月 2018
Offline
akirasun_sh: It doesn't work properly on other line. Thank you anyway

vusta: What's up with the “what the ???”.
If you refer to my question, I'm not really good at math, it might seem like a stupid question for you, but yeah, I wasn't able to figure that out by myself.
And for the triangle in my scene, it was just a test I did because i thought this could help.

Anyway, your solution works perfectly ! Thanks a lot
User Avatar
Member
555 posts
Joined: 2月 2017
Offline
RonanCroyal
akirasun_sh: It doesn't work properly on other line. Thank you anyway

vusta: What's up with the “what the ???”.
If you refer to my question, I'm not really good at math, it might seem like a stupid question for you, but yeah, I wasn't able to figure that out by myself.
And for the triangle in my scene, it was just a test I did because i thought this could help.

Anyway, your solution works perfectly ! Thanks a lot
i was alluding to the fact that it was a triangle, no need to involve astro physics or chemical engineering to solve the problem…like the cult of overcomplicators i keep seeing…not attacking your question at all.
Edited by vusta - 2020年4月4日 05:26:32
  • Quick Links