Tag Info

New answers tagged

0

Once your terrain is built start by manually turning down booleans for unwalkable nodes to walkable, You may think this as a forced method, but you need to assign bool isWalkable(node){if isRight || isLeft ==NULL{ //# manual declaration of boundary nodes to unwalkable nodes, and when script starts, //have start and end on boundary reinitialized to ...


1

The algorithm you referenced is horribly broken. It is not clear why it hasn't been redacted. There are multiple issues here, but basically you need to generate the right set of vertices and connect them properly. You generate rings*sectors different vertices. This is incorrect. You should have rings*sectors+2. When r = 0, sin( pi * r * rr ) = 0, and sin( ...


4

I will assume that you have a function f such that the surface is defined by f(x,y,z)==0. Right now, all you have is the function f itself, and so with no further information, it is impossible to know when to subdivide. It is always possible for the surface to do what you describe, i.e. the function f can have arbitrarily thin "fins" which can require you do ...


1

I will assume that the player collides with the ground only on the middle point. We can do an approximation of the height of the terrain at a given point with this: double x = 4.6; double relativeX = x / widthBetweenPoints; int terrainIndex = Math.floor(x); double ratio = relativeX - terrainIndex; int y = Points[terrainIndex] * (1 - ratio) + ...



Top 50 recent answers are included