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 » Scripting Helpers
Home Search
 

Trilinear Interpolation in Lua

Previous Thread :: Next Thread 
spynaz is not online. spynaz
Joined: 17 Feb 2011
Total Posts: 1326
03 Jul 2013 07:45 PM
Does anyone know what the trilinear interpolation function in lua looks like?
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
03 Jul 2013 08:27 PM
From Wikipedia:
"In practice, a trilinear interpolation is identical to three successive linear interpolations, or a bilinear interpolations combined with a linear interpolation"

The Wikipedia article should describe the concept well enough.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
03 Jul 2013 08:30 PM
I had a quick look at wikipedia, but I dont really understand WHAT its supposed to do. Find the center of a square from the 8 corners?
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
03 Jul 2013 08:30 PM
...square with 8 corners? I mean cube.
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
03 Jul 2013 08:31 PM
Given a regular lattice of points in 3D space, find the value of a point between the lattice, assuming that the change in value in any axis is linear.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
03 Jul 2013 08:34 PM
So what are the practical applications?
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
03 Jul 2013 08:36 PM
Well, bilinear (square case instead of cube) is a simple way of scaling images that doesn't produce the square artifacts of nearest neighbor.
Scaling a 3D image of some sort, possibly voxel data or density data, you could use trilinear interpolation.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
03 Jul 2013 08:41 PM
But we are talking about Lua, so we cant exactly scale images...

Well thank you. I appear to have learned where the word "lerp" comes from.
But I dont like my interpolations linear, I like them logarithmic.

So is this basically what the Camera:Interpolate method does?
Report Abuse
spynaz is not online. spynaz
Joined: 17 Feb 2011
Total Posts: 1326
03 Jul 2013 10:22 PM
Well I need this to generate a terrain using a 2d perlin noise heightmap for the base and 3d perlin noise for overhangs and hills. But the overhangs that are generated have flat tops and way too many overhangs and floating chunks are created. If I increase the required density for a block to be considered "solid", there would be less overhangs, but also less steep hills. I think the problem for the flat tops on the overhangs is because I'm using just linear interpolation for both the heightmap and 3d perlin noise and not trilinear.

Also you said that a trilinear interpolation is just 3 linear ones. If so, how would that work with the following linear function I'm currently using?

function lerp(t,a,b)
return a + t * (b - a)
end
Report Abuse
spynaz is not online. spynaz
Joined: 17 Feb 2011
Total Posts: 1326
04 Jul 2013 11:03 AM
Bump.
Report Abuse
spynaz is not online. spynaz
Joined: 17 Feb 2011
Total Posts: 1326
05 Jul 2013 11:14 AM
...
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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