|
| 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 |
|
|
| 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 |
|
|
| 12 Dec 2016 04:43 PM |
| I see what you mean; the diagram helped :p. Great idea, thanks. |
|
|
| Report Abuse |
|