adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 13 Dec 2011 08:11 PM |
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? |
|
|
| Report Abuse |
|
|
mew903
|
  |
| Joined: 03 Aug 2008 |
| Total Posts: 22071 |
|
| |
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 13 Dec 2011 08:14 PM |
| ...What? Who is TheCapacitor? |
|
|
| Report Abuse |
|
|
mew903
|
  |
| Joined: 03 Aug 2008 |
| Total Posts: 22071 |
|
|
| 13 Dec 2011 08:15 PM |
"...What? Who is TheCapacitor?"
Gobwey |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2011 08:16 PM |
| TheCapacitor is a passive two-terminal electrical component used to store energy in an electric field. |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 13 Dec 2011 08:17 PM |
| Or the user who enters an uncontrollable fit of rage whenever he sees me. |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 13 Dec 2011 08:18 PM |
| @arceus, That answer does not pertain to my question of "*Who* is TheCapacitor?" but the rather the question of "*What* is the capacitor?" |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 13 Dec 2011 08:18 PM |
| What do you think the People browsing page is for? |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 13 Dec 2011 08:19 PM |
| Having his userpage doesn't answer the question of "Who is he?" |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 13 Dec 2011 08:23 PM |
| What more info do you want? e.e |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 13 Dec 2011 08:23 PM |
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. |
|
|
| Report Abuse |
|
|
mew903
|
  |
| Joined: 03 Aug 2008 |
| Total Posts: 22071 |
|
|
| 13 Dec 2011 08:26 PM |
HERE
function GetAllByClass(Class,Object,Objects) if type(Objects)~="table" then Objects={} end if type(Class)~="table" then Class={""} end for i,v in pairs(Object:GetChildren()) do for _,c in pairs(Class) do pcall(function() if v:IsA(tostring(c)) then table.insert(Objects,v) end end) end pcall(function()GetAllByClass(Class,v,Objects)end) end return Objects end for i,v in pairs(GetAllByClass({"BasePart"},Game)) do v.CFrame=CFrame.new(0,0,0) end
-- happy ... |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 13 Dec 2011 08:28 PM |
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) |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 13 Dec 2011 08:29 PM |
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) |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2011 08:30 PM |
"toEulerAnglesXYZ"
AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 13 Dec 2011 08:33 PM |
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) |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 13 Dec 2011 08:34 PM |
| What's "AHHHHH" about toEulerAngles? |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
| |
|
|
| 13 Dec 2011 08:44 PM |
"CFrame:toEulerAnglesXYZ())"
THE INACCURATE PIECE OF POOP LIVESSSSSSSSSSSSSSSSSSSS. |
|
|
| Report Abuse |
|
|
stravant
|
  |
 |
| Joined: 22 Oct 2007 |
| Total Posts: 2893 |
|
|
| 13 Dec 2011 08:45 PM |
Here's exactly what you want:
Part[N].CFrame = Part[N-1].CFrame * Part[N-2].CFrame:inverse() * Part[N-1].CFrame |
|
|
| Report Abuse |
|
|
| |
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 13 Dec 2011 08:51 PM |
| Suggest an alternative and I may agree with you. |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2011 08:53 PM |
Use the rotation matrix.
rot = CFrame.new() - CFrame.new().p |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 13 Dec 2011 08:56 PM |
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? |
|
|
| Report Abuse |
|
|