Scene to heightmap

How can I take a heightmap-picture of a scene in Panda3D?
In Blender i used an orthograpic camera and put z-channel into brightness.

I want to use the heightmap (rendered one time) as a substitute for collision (every frame).

If you are looking at just terrain collision both terrain classes have a getHeight function.

You could use an orthographic camera and put the z-channel into brightness. :slight_smile:

But seriously, it works very similar in Panda3D as in Blender. You can create a camera, assign an orthographic lens, assign a depth buffer that renders to a texture in RAM, and render a frame.

That might sound noobish but i have no idea how - could you please post a snippet or links to the documentation?
(I already found the camera. and the render-to-texture-page in the manual which says its not so simpleā€¦)

Have you seen the advanced Shadow sample? It covers rendering to a depth buffer. You need to change it to copy the image to RAM (use RTMCopyRam rather than RTMBindOrCopy).

I read through the sample but I dont understand. Copying and modifying doesnt work very well - Im propably just too stupid. Thanks for the help anyway.