Skip to content

Conversation

@andytriboletti
Copy link

Hello! I like this library.
I updated it to use the latest version of threejs!
I added npm start which will start a vite dev server.

I am happy to correct any mistakes.

Live demo
https://raw.githack.com/andytriboletti/THREE.Terrain/using-latest-threejs/index.html

@isaac-meaningfulgigs
Copy link

This is great, thanks for contributing! It is going to take me some time to be able to give this a thorough review, but I just want to let you know that it is on my radar and it looks pretty good at first glance.

@andytriboletti
Copy link
Author

andytriboletti commented Apr 11, 2025

This is great, thanks for contributing! It is going to take me some time to be able to give this a thorough review, but I just want to let you know that it is on my radar and it looks pretty good at first glance.

Awesome. Would you be interested in me integrating a physics library with the terrain so a character could walk across the terrain with varying height maps, or I could have objects or something drop in? Not sure how hard it would be yet. I just created a new threejs example PR with basic terrain and heightmaps using Rapier.

@isaac-meaningfulgigs
Copy link

I don't think most physics libraries would need explicit integration with this library.

To let a character walk across the terrain, just cast a ray down from the character's position and check where it intersects with the terrain. No physics library needed for that. For something more complex, depending on the physics library you're working with, you could pass the mesh itself or the vertices to create a hull.

But if you have something specific in mind where an integration would be helpful, I'd be interested to hear about it.

@andytriboletti
Copy link
Author

andytriboletti commented Apr 14, 2025

Thank you for the answer. I've been trying to get heightfield with physics working with three.terrain like this example I added to three.js, ported from ammo: https://raw.githack.com/andytriboletti/three.js/dev/examples/physics_rapier_terrain.html

I haven't been able to get it working. So I will try your suggestion with raycasting. It would be nice to get the physics_rapier_terrain sample working with this project I think but I may be wrong.

I noticed my changes renamed Three.Terrain to TerrainNS because you can no longer modify Three.js objects, right? Also, I tried using this and couldn't figure out how to use the packaged version so I just used the modules importing index. There's a lot still to do, including updating docs, so I understand if it takes a while to review/do your part. Also, you could make a list of things to do for me for this PR and I could do them. I think you had bower setup before, I wanted an easy way to develop with hot reloading so I chose Vite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants