Open huitre39 opened 6 years ago
There's a shader that uses the generated height map to deform the terrain mesh, I don't think you can use the heightmap directly for collisions. Anyway if I get your code right - you used the quad used to apply a shader for the texture buffer as the ground - that ain't gonna work.
Okay, thanks for your answer, do you have another solution? I've looked at a lot of documentation on panda3d but I can't find anything to help me.
i want to use with ODE physic engine
I don't have much experience with ODE, so I don't have a ready solution. The main problem is that the shape of the terrain is generated on the gpu and the collisions are made on the cpu. You have to find a way to transfer the data and even then there is a problem of speed - the gpu can update the shape way, way faster than the cpu could make any collision solids. You can take the heightmap and deform a mesh on the cpu then use it as a collision mesh but changing the shape after that means throwing it away and starting anew. For a simple ray test you can use the heightmap or the depth buffer, but for physics... I have no idea.
ah, ok
hello i try to add in your map collision detection with ode like this tutorial https://www.panda3d.org/manual/index.php/Collision_Detection_with_ODE
but my box make crazy mouvement, i don't think if your map can be support this feature ?
i change only main.py file for work with python3.5 and i add box and ode collision function at end of your make_buffer function