# Can I use Panda3D's perlin noise implementation this way?

Hello everybody, I’m currently porting my nearly infinite procedural terrain prototype to Panda3D. In the previous langage I used, I coded my own simple and unoptimized perlin noise algorithm. I was quite happy to see Panda3D has one already.

In my engine, I generated my terrain in different patches of 8*8 vertices. I passed the x ,z coordinates of the vertices to the algorithm and it returned the elevation (y) of that vertex. So for the adjacent patches, passing the coordinates would make it contiguous to the other patches.

I’m a newbie to Panda3D and as I understand the perlin noise implementation, I can only generate a x,y array of noise (used as a heightmap). How would I, for example, generate two contiguous heightmaps? I can’t generate those two heightmaps in one go, I need to generate them one by one.

Hope someone understands what i’m saying. I find it hard to explain these things.

Thank you for any help

Just use offset? First map get points from 0-8 second map get points from 8-16 next 16-24 etc…

Thank you for your response. I don’t know where to add the offset. Curently, I’m using a StackedPerlinNoise2 call to generate a test 64x64 terrain. I don’t know wich parameter of the function to add my offset.

.noise method takes x and y - just add your offset to them.

I use .noise to get the values of my object like so:

value=perl2dstack.noise(x,y)

but I don’t understand how to send my offset to the object.

value=perl2dstack.noise(x+xOffset,y+yOffset)

Oh my, as simple as that? Thank you. Tested, works like a charm.

if not too much trouble or other restrictions, you could post your code here for other newbs to learn from it.

anyway, it’s so nice when people that start using panda3d exclaim “that easy?”