Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How would I render Triangles linking nodes for my Triangle Terrain Generator?

Asked by
ZeroBits 142
9 years ago

Hello, I'm working on a triangle terrain generator, and already have node generation (using math.noise), but don't have the faintest clue how to go about creating triangles between nodes to create the actual terrain.

What should I do? Are there any tutorials I should read, any advice you have?

1 answer

Log in to vote
1
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
9 years ago

stravant wrote the original triangle fill code that most if not all triangle fill plugins use in some fashion:

001local function setupPart(part)
002    part.Anchored = true
003    part.FormFactor = 'Custom'
004    part.CanCollide = PolyDraw.CanCollide
005    part.BrickColor = PolyDraw.BrickColor
006    part.TopSurface = 'Smooth'
007    part.BottomSurface = 'Smooth'
008end
009 
010function CreateTriangle(parent, a, b, c)
011    local this = {}
012    local mPart1 = Instance.new('WedgePart')
013    setupPart(mPart1)
014    local mPart2 = Instance.new('WedgePart')
015    setupPart(mPart2)
View all 100 lines...

If you want to recreate the features that a specific plugin has, look into its code to see how its modified stravant's fill.

2
...which you can do by going to C:\Users\user\AppData\Local\Roblox\InstalledPlugins, look at all of them (the folder names are random), and open the rbxm. unmiss 337 — 9y
Ad

Answer this question