adarkJoin Date: 2008-01-13 Post Count: 6412 |
I know, I know, wrong forum, but nobody on Scripting Helpers knows the answer.
Part2 is rotated 18 degrees and positioned for a perfect fit with Part1.
I now want to add Part3, with the exact same relative rotation and position as Part2 is to Part1, for a total of 36 degrees of rotation from Part1 to Part3. I know how to get the relative CFrame of Part2 to Part1 using :toObjectSpace, but how do I make this the relative CFrame of Part3 to Part2? |
|
|
adarkJoin Date: 2008-01-13 Post Count: 6412 |
...What? Who is TheCapacitor? |
|
|
SharksieJoin Date: 2009-10-10 Post Count: 30576 |
TheCapacitor is a passive two-terminal electrical component used to store energy in an electric field. |
|
blockooJoin Date: 2007-11-08 Post Count: 17202 |
Or the user who enters an uncontrollable fit of rage whenever he sees me. |
|
adarkJoin Date: 2008-01-13 Post Count: 6412 |
@arceus, That answer does not pertain to my question of "*Who* is TheCapacitor?" but the rather the question of "*What* is the capacitor?" |
|
blockooJoin Date: 2007-11-08 Post Count: 17202 |
What do you think the People browsing page is for? |
|
adarkJoin Date: 2008-01-13 Post Count: 6412 |
Having his userpage doesn't answer the question of "Who is he?" |
|
blockooJoin Date: 2007-11-08 Post Count: 17202 |
What more info do you want? e.e |
|
adarkJoin Date: 2008-01-13 Post Count: 6412 |
I'm going to stop this saying that I'm a moron.
When I was trying to get the selection I was dragging to align with the rotated bit, I had left it rotated.
I forgot that I could just select all of the stuff I was dragging on to and align it to the main axis by moving the rotated bit, solving my rotation problem.
Having said that, I feel like slightly less of a moron. |
|
|
blockooJoin Date: 2007-11-08 Post Count: 17202 |
Back on topic, if I understand your question correctly:
one = Vector3.new(Part1.CFrame:toEulerAnglesXYZ())
two = Vector3.new(Part2.CFrame:toEulerAnglesXYZ())
d = one - two
d = Vector3.new(math.abs(d.x), math.abs(d.y), math.abs(d.z))
Part3.CFrame = part3.CFrame * CFrame.Angles(d) |
|
blockooJoin Date: 2007-11-08 Post Count: 17202 |
Small fix:
one = Vector3.new(Part1.CFrame:toEulerAnglesXYZ())
two = Vector3.new(Part2.CFrame:toEulerAnglesXYZ())
d = two - one
d = Vector3.new(math.abs(d.x), math.abs(d.y), math.abs(d.z))
Part3.CFrame = part3.CFrame * CFrame.Angles(d) |
|
|
"toEulerAnglesXYZ"
AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH |
|
blockooJoin Date: 2007-11-08 Post Count: 17202 |
Wait, I misinterpreted:
one = Vector3.new(Part1.CFrame:toEulerAnglesXYZ())
two = Vector3.new(Part2.CFrame:toEulerAnglesXYZ())
d = two - one
d = Vector3.new(math.abs(d.x), math.abs(d.y), math.abs(d.z))
Part3.CFrame = Part3.CFrame * CFrame.Angles(two + d) |
|
blockooJoin Date: 2007-11-08 Post Count: 17202 |
What's "AHHHHH" about toEulerAngles? |
|
adarkJoin Date: 2008-01-13 Post Count: 6412 |
CFrame.Angles |
|
|
"CFrame:toEulerAnglesXYZ())"
THE INACCURATE PIECE OF POOP LIVESSSSSSSSSSSSSSSSSSSS. |
|
stravantForum ModeratorJoin Date: 2007-10-22 Post Count: 2893 |
Here's exactly what you want:
Part[N].CFrame = Part[N-1].CFrame * Part[N-2].CFrame:inverse() * Part[N-1].CFrame |
|
|
blockooJoin Date: 2007-11-08 Post Count: 17202 |
Suggest an alternative and I may agree with you. |
|
|
Use the rotation matrix.
rot = CFrame.new() - CFrame.new().p |
|
blockooJoin Date: 2007-11-08 Post Count: 17202 |
rotation matrix < poop
Why do you need 9 different matrices when you can create any possible angle with the use of only 3 of them? |
|