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: Dynamic triangle terrain

Previous Thread :: Next Thread 
GuestOfChaos is not online. GuestOfChaos
Joined: 01 Sep 2013
Total Posts: 71
12 Dec 2016 02:36 PM
I can make a triangle with three points. What's the best way (most efficient) to generate triangle landscape amongst a bunch of nodes?

I figured just going thru each node and searching for the next closest two would lower performance -- or will it?

ありがとう
Report Abuse
DreamsWork is not online. DreamsWork
Joined: 20 Jan 2010
Total Posts: 36796
12 Dec 2016 02:47 PM
what i did was this:

O O o
O O o
o o o

if the node is not the last node in any column/row, then you draw 2 triangles

the triangles would be drawn like this:

--first triangle
drawTriangle(
Vector3.new(X, Y, Z),
Vector3.new(X+1, Y, Z),
Vector3.new(X, Y, Z+1)
)

looks like this:

O-O o
|/
O O o
o o o


--second triangle
drawTriangle(
Vector3.new(X+1, Y, Z+1);
Vector3.new(X+1, Y, Z),
Vector3.new(X, Y, Z+1)
)

looks like this:

O O o
/|
O-O o
o o o


The second and third arguments dont change, only the first one does.
The difference between the 2 triangles are that the 1st triangle's arguments are (x,y,z) while the 2nd triangle's is (x+1,y,z+1)


Report Abuse
GuestOfChaos is not online. GuestOfChaos
Joined: 01 Sep 2013
Total Posts: 71
12 Dec 2016 04:43 PM
I see what you mean; the diagram helped :p. Great idea, thanks.
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