Tenal
|
  |
| Joined: 15 May 2011 |
| Total Posts: 18684 |
|
| |
|
| |
|
|
| 07 Feb 2012 06:14 PM |
Here ya go!
local x,y,z, R00,R01,R02, R10,R11,R12, R20,R21,R22 = beginFrame[pos].CFrameData:components() local bx,by,bz, bR00,bR01,bR02, bR10,bR11,bR12, bR20,bR21,bR22 = v.CFrameData:components() local Pos, R0, R1, R2 = Vector3.new(x,y,z):lerp(Vector3.new(bx,by,bz),pcent), Slerp(Vector3.new(R00,R01,R02), Vector3.new(bR00,bR01,bR02), pcent).unit, Slerp(Vector3.new(R10,R11,R12), Vector3.new(bR10,bR11,bR12), pcent).unit, Slerp(Vector3.new(R20,R21,R22), Vector3.new(bR20,bR21,bR22), pcent).unit
local nCF = CFrame.new(Pos.x,Pos.y,Pos.z, R0.x,R0.y,R0.z, R1.x,R1.y,R1.z, R2.x,R2.y,R2.z)
Don't forget to add the Slerp function |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2012 06:24 PM |
| @above are you some sort of cframe wizerd |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2012 06:30 PM |
| By no means. I just know that tools have the 4 Properties: GripPos, GripForward, GripUp, and GripRight. All are unit vectors except GripPos and all correlate to part of a CFrame. That was just a guess when I tried it, but it turned out to be right. |
|
|
| Report Abuse |
|
|
sharky99
|
  |
| Joined: 18 Dec 2008 |
| Total Posts: 3364 |
|
|
| 07 Feb 2012 06:32 PM |
@Studionymos Not to puff my self up but... You all should know that IM the CFrame wizard. After all, I made the best masterhand on roblox that few people have seen! |
|
|
| Report Abuse |
|
|
stravant
|
  |
 |
| Joined: 22 Oct 2007 |
| Total Posts: 2893 |
|
|
| 07 Feb 2012 06:41 PM |
@Matchlighter
By the way, that only works because Roblox "fixes" CFrames that aren't quite right for you. Also, it will still fail in some edge cases. |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2012 06:42 PM |
| sharky i was just about to post masterhand source and be like "oh this stupid thing" but roblox filter blocked it -.- qq preparing for ban |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2012 07:51 PM |
@stravant
What do you mean "aren't quite right"? Is it a potential issue? And what do you mean by "edge cases"? |
|
|
| Report Abuse |
|
|
stravant
|
  |
 |
| Joined: 22 Oct 2007 |
| Total Posts: 2893 |
|
|
| 07 Feb 2012 08:29 PM |
| I'm not quite sure. I was thinking of you doing a lerp of the unit vectors, not a slerp, it may work that way. |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2012 09:08 PM |
| Doesn't an arc defeat the purpose of linear if the arc isn't bi-polar? Just curious. |
|
|
| Report Abuse |
|
|
stravant
|
  |
 |
| Joined: 22 Oct 2007 |
| Total Posts: 2893 |
|
|
| 07 Feb 2012 11:59 PM |
| Well, you can still do linear interpolation in an arc. It's just that you're doing linear interpilation of the angle which is the fraction of the way through the arc, rather than distance of the way long a line. |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2012 12:23 AM |
| That's true, but the arc must be a line segment on a geodesic. |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2012 07:22 AM |
I think someone said it wouldnt work properly even with slerp if you rotate on more than 2 (3???) axises at once.
In theory it works when rotating on a single axis, and in practise it works on 2 and 3 axises too (but not in theory lolo) |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2012 09:47 AM |
@sharky99
RobloxMasterDX made that
I want to say froob now |
|
|
| Report Abuse |
|
|
NXTBoy
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 4533 |
|
|
| 08 Feb 2012 01:22 PM |
> What do you mean "aren't quite right"? Is it a potential issue?
I see what he means. Consider the CFrames:
CFrame.new(0, 0, 0 1, 0, 0, 0, 1, 0 0, 0, 1 )
and
CFrame.new(0, 0, 0 0, 1, 0, 0, 0, 1 1, 0, 0 )
The second is a rotation of the first by 120 degrees about the x=y=z line. If you do a (slerped) interpolation by 0.5, you'll end up with:
CFrame.new(0, 0, 0 0.707, 0.707, 0, 0, 0.707, 0.707, 0.707, 0, 0.707 )
However, this is no longer an orthogonal CFrame, since the axes are not perpendicular to one another.
-------------------------------------------
As mentioned already, Roblox does try to orthogonalize CFrames when they are applied to parts.
|
|
|
| Report Abuse |
|
|
NVI
|
  |
| Joined: 11 Jan 2009 |
| Total Posts: 4744 |
|
|
| 08 Feb 2012 09:17 PM |
| It's a shame that Roblox does orthogonalize CFrames. I want to do some wonky shearing. |
|
|
| Report Abuse |
|
|