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
 

Re: Lerp() to CFrame?

Previous Thread :: Next Thread 
dansk is not online. dansk
Joined: 24 Dec 2008
Total Posts: 548
11 May 2015 11:14 PM
Alright so Im trying out lerp() because it looks like a pretty interesting method. However, I'm confused to if you want to lerp a brick but still have the brick be inside another brick. Like I want to lerp one brick into another brick. I know doing Brick.Position = Vector3() will make the brick go to the top of the other brick but if I do Brick.CFrame = Cframe() then the brick will go inside the other brick. How do I make it so that I can lerp Cframes basically. Im sorry if I suck at explaining this.
Report Abuse
dansk is not online. dansk
Joined: 24 Dec 2008
Total Posts: 548
11 May 2015 11:29 PM
Bawmp
Report Abuse
izzatnasruna is not online. izzatnasruna
Joined: 09 Jun 2009
Total Posts: 1927
11 May 2015 11:47 PM
Lerp means Linear Interpolation.

And yes, I'd say you did failed at explaining. Can you explain again? I don't get it.
Report Abuse
dansk is not online. dansk
Joined: 24 Dec 2008
Total Posts: 548
12 May 2015 12:26 AM
So you know how you can do

Brick.Position = Brick2:lerp(brick3, 0)?

How do I do that with cframe
Report Abuse
dansk is not online. dansk
Joined: 24 Dec 2008
Total Posts: 548
15 May 2015 12:26 AM
Anyone know .-.
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
15 May 2015 12:45 AM
i think you are looking for a cframe interpolator?

stravant has one
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
15 May 2015 12:48 AM
http://www.roblox.com/CFrameInterpolator-Module-item?id=161739700
Report Abuse
dansk is not online. dansk
Joined: 24 Dec 2008
Total Posts: 548
15 May 2015 12:59 AM
How does it work? I see in the function only 2 values: pos1 and pos2 but lerp() takes 2 positions and a ratio
Report Abuse
dansk is not online. dansk
Joined: 24 Dec 2008
Total Posts: 548
15 May 2015 01:00 AM
Pretty much I want something like I can lerp2 bricks than use the position I get from the lerp to frame another brick into there. Pretty much if the brick doesn't fit into the space i.e. there is another brick there, then it will simply go inside the other brick
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
15 May 2015 01:32 AM
function lerpCFrame(c0,c1,a)
local o = {c0:components()}
local n = {c1:components()}
local lerp = {}
for i = 1,12 do
lerp[i] = (o[i] + (n[i] - o[i]) * a)
end
return CFrame.new(unpack(lerp))
end
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
15 May 2015 01:50 AM
Erm...

Yeah...

About lerp to CFrame...

I managed to convert my Tween Part lerp into CFrame quite simply.

I'll check once I go into my Desktop (I'm on chromebook).
Report Abuse
Voiliax is not online. Voiliax
Joined: 05 Nov 2009
Total Posts: 15554
15 May 2015 02:23 AM
OP simply wants a translation lerp with a CFrame value instead of a Vector value.

This should be sufficient:

brick.CFrame= CFrame.new( p1:Lerp(p2, alpha) )
Report Abuse
CrescentJade is not online. CrescentJade
Joined: 07 Jul 2010
Total Posts: 5494
15 May 2015 05:13 AM
and lerp rotation too, its a vector3.

therefore you dont have to go indepth
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
15 May 2015 11:22 AM
@Cres

Its still saver to work with the rotation matrix since it is precisely capped at -1 to 1
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
15 May 2015 11:23 AM
er, safer*
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