generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

CFrame Help

Previous Thread :: Next Thread 
adark is not online. 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 is not online. mew903
Joined: 03 Aug 2008
Total Posts: 22071
13 Dec 2011 08:13 PM
TheCapacitor wannabe
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
13 Dec 2011 08:14 PM
...What? Who is TheCapacitor?
Report Abuse
mew903 is not online. mew903
Joined: 03 Aug 2008
Total Posts: 22071
13 Dec 2011 08:15 PM
"...What? Who is TheCapacitor?"

Gobwey
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
xSIXxStorage is not online. xSIXxStorage
Joined: 22 Aug 2010
Total Posts: 1811
13 Dec 2011 08:30 PM
"toEulerAnglesXYZ"

AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
Report Abuse
blockoo is not online. 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 is not online. blockoo
Joined: 08 Nov 2007
Total Posts: 17202
13 Dec 2011 08:34 PM
What's "AHHHHH" about toEulerAngles?
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
13 Dec 2011 08:37 PM
CFrame.Angles
Report Abuse
xSIXxStorage is not online. xSIXxStorage
Joined: 22 Aug 2010
Total Posts: 1811
13 Dec 2011 08:44 PM
"CFrame:toEulerAnglesXYZ())"

THE INACCURATE PIECE OF POOP LIVESSSSSSSSSSSSSSSSSSSS.
Report Abuse
stravant is not online. stravant
Forum Moderator
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
xSIXxStorage is not online. xSIXxStorage
Joined: 22 Aug 2010
Total Posts: 1811
13 Dec 2011 08:47 PM
^

ahhhhh yea.
Report Abuse
blockoo is not online. 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
xSIXxStorage is not online. xSIXxStorage
Joined: 22 Aug 2010
Total Posts: 1811
13 Dec 2011 08:53 PM
Use the rotation matrix.

rot = CFrame.new() - CFrame.new().p
Report Abuse
blockoo is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image