https://github.com/takana671/terrainwithhole
Making terrain having hole
https://github.com/takana671/terrainwithhole
geomipterrain heightmap panda3d python3
Last synced: about 1 year ago
JSON representation
Making terrain having hole
- Host: GitHub
- URL: https://github.com/takana671/terrainwithhole
- Owner: taKana671
- Created: 2024-11-04T13:27:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-06T16:13:29.000Z (over 1 year ago)
- Last Synced: 2025-01-31T22:58:46.255Z (over 1 year ago)
- Topics: geomipterrain, heightmap, panda3d, python3
- Language: Python
- Homepage:
- Size: 12.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TerrainWithHole
This repository was made to learn how to make hole in terrain.
I tried two methods. The first is to partly remove geometry data from terrain by using memoryview.
The second is to draw a shape on a hightmap by OpenCV, make the shape transparent, and use 'discard' in a shader, which was inspired by the panda3D community site "https://discourse.panda3d.org/".
The first way does not need to use 'discard' in shaders.
And made it possible for the character to go through the hole by embedding a plane model under ground near the hole, and ignoring the collision between the character and terrain if the embedded plane model is detected by ray cast.
https://github.com/user-attachments/assets/c0bf91fe-2344-4a0d-bcf1-ba6def7ecaa2
hole made by removing geometry data

hole made by using heightmap
# Requirements
* Panda3D 1.10.14
* numpy 2.1.2
# Environment
* Python 3.11
* Windows11
# Usage
* Execute a command below on your command line.
```
>>>python terrain_with_hole.py
```
# Controls:
* Press [Esc] to quit.
* Press [up arrow] key to go foward.
* Press [left arrow] key to turn left.
* Press [right arrow] key to turn right.
* Press [down arrow] key to go back.
* Press [ D ] key to toggle debug ON and OFF.