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
 

Stravant's CFrameInterpolator Module

Previous Thread :: Next Thread 
LuaNeko is not online. LuaNeko
Joined: 21 Jul 2014
Total Posts: 31
06 Aug 2014 10:36 PM
Hello,

I'm trying to use stravant's module to interpolate between two cframes (http://www.roblox.com/CFrameInterpolator-Module-item?id=161739700), and when I'm trying to do a rotation over 180 degrees, it seems to take the shortest rotation path possible. Is it because of how euler angles are computed? I wonder also if it's possible to make those rotations possible without calling two times this function, or if I must directly use quaternions for that kind of stuff (even though it'll be slower)

Thanks!
Report Abuse
dogwarrior24 is not online. dogwarrior24
Joined: 10 Nov 2010
Total Posts: 1401
06 Aug 2014 10:52 PM
Use comlerp pls
Report Abuse
LuaNeko is not online. LuaNeko
Joined: 21 Jul 2014
Total Posts: 31
07 Aug 2014 02:46 AM
Sorry, what?
Report Abuse
SolarCrane is not online. SolarCrane
Forum Moderator
Joined: 03 Jul 2012
Total Posts: 116
07 Aug 2014 05:59 PM
I believe Stravant's CFrameInterpolator will always try to take the the shortest path to the goal. So, if you want to rotate by more than 180 degrees you may have to edit the module or use a midpoint for your rotation. For example if you want to rotate 200 degrees you could rotate 100 degrees and then rotate 100 degrees again.
Report Abuse
stravant is not online. stravant
Forum Moderator
Joined: 22 Oct 2007
Total Posts: 2893
07 Aug 2014 06:41 PM
The module actually uses AxisAngles internally, so if you crack it open you'll easily be able to make it take a path greater than 180 degrees. Right by the end:

-- Return the interpolator
return theta, function(t)
return c0*fromAxisAngle(rotationAxis, theta*t) + positionDelta*t
end

The important part is the "theta*t". If you modify that part you'll be able to get out some other behaviors:

(theta + math.pi*2)*t
-> The interpolation will take one extra full turn during it's transit to the goal

(theta - math.pi*2)*t
-> The interpolation will take the longer of the two possible rotational paths to the goal rather than the shorter.

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