Tag Info

New answers tagged

3

I suggest this aproach. Let fs(x,y) be your simplex noise function. Let's introduce a second function : f(x,y) = WIDTH * (1 - (X * X + Y * Y)) or any function that rassemble the following and that gives values from 0 to 1: at this point take your simplex noise fs(x,y) : and multiply per f(x,y) you get something like this : finaly apply a ...


0

Summary: Make a 3d mesh exactly the size of your terrain. Then do a raytrace trough the mouse towards the terrain. This will give you the x and z coordinate of the tile. Now from the z coordinate you can calculate the y coordinate of the tile without elevation. Then you can use one of your links to calculate the tile at that position. Now some simple math ...


0

I have come up with a solution and it seemed to be buried deep within my college memory. I achieved what I wanted through a Unit Circle! Basic calculus/geometry seemed to be the correct way for me to come up with a working solution. I took the x and y translation points of the sun and put them through the unit circle equation. See ...


0

I guess terrain is 2d from the picture. If it is terrain the {x} axis distance between every vert should be constant. I also condider both players are grounded. Now lets have such varriables: Player 1 : p1where we have p1.x and p2.x Player 2 : p2 same as player 1 Let's also say player p1 is before p2 in other words he is behind him vert array: V with ...


4

So what you want is like this? As Stephan says, you have the right idea, just repeat it until you're all out of movement. 1. Measure length to next vertex along first slope. while( impending movement vector > length to next vertex ) { 2. Subtract length from impending movement vector. 3. Position impending movement vector at vertex... 1. ...


1

You are describing the proper algorithm. If you loop while you have remaining movement left, it wont matter how many segments you have to cross over. All of the calculations you describe are O(1) calculations so performance isn't an issue. Keep in mind that all terrain is triangles under the hood, so Trig and/or Dot Products may possibly offer some ...



Top 50 recent answers are included