Tag Info

New answers tagged

0

If the grid size is large, this becomes unsolvable by a computer, as this is a NP problem. See https://en.wikipedia.org/wiki/Travelling_salesman_problem If your grid is small, you can get a computer to calculate all possibilities, and plan a optimal route. However, as your grid gets larger, your calculations get exponentially larger, to the point where ...


0

What you need, at least I guess, is an implementation of mipmaps for your 2D trees. A mipmap are a large frame in which the same object is present in different resolutions. For example, you can have a texture with a 1024x1024 tree image, next to it another one at 512x512, then a 256x256 one and so on... Then your tree object checks for the zoom level the ...


1

I'm aware it is not exactly what you're looking for, but here is a suggestion. You could control the generation of your lands to force them to be convex. Using this method would allow you to simply use the mean x and mean y values to place your building as you would be sure they're on the land. Otherwise, the only options I see is 1) no random in the ...


0

Instead of getting the center of each land with mean(X) and mean(Y) (which, by the way, is not a bad solution), you could calculate a rectangular bounding box around each of your lands: Land 1: Starting at (0, 0) of size (2, 3) Land 2: Starting at (1, 0) of size (2, 3) This way, you could calculate the relative center of the given rectangles: Land 1: (2 ...



Top 50 recent answers are included