jerome

Dynamic or infinite terrain experiment

55 posts in this topic

I'll complete the last part of the code before the end of the week (hope so). Then I will write the documentation... painful work because, although the API is quite simple, there's much to explain.

NasimiAsl and Deltakosh like this

Share this post


Link to post
Share on other sites

Maybe I was too optimistic by saying I could finish by the end of this week :( I just can't have a working function getHeightAt(x ,z)

Share this post


Link to post
Share on other sites
54 minutes ago, jerome said:

Maybe I was too optimistic by saying I could finish by the end of this week :( I just can't have a working function getHeightAt(x ,z)

Keep at it!

Terrain is a tricky topic but you're smart so I'm sure you will get it :D

Could you make an example with the terrain view distance of about 1km? I'd love to see how this performs on larger scenes.


 

Share this post


Link to post
Share on other sites

What would a terrain be without some collision detection features ?

Here's the first working prototype of terrain.getHeightFromMap(x ,z) in action : http://jerome.bousquie.fr/BJS/test/terrain.html

Not yet documented (*), but already working : https://github.com/BabylonJS/Extensions/tree/master/DynamicTerrain/dist

 

(*) Actually all the methods are documented in code comments, so if you generate a doc from the code, you can already get the API documentation.

JohnK, Deltakosh, Pouet and 1 other like this

Share this post


Link to post
Share on other sites

Hi guys, 

Today's extension repo update is a complete reimplementation of the internal geometry update, faster than the standard ribbon update because it deals only with low level float32 arrays directly instead of BJS objects (vectors3, colors4, etc) and it embbeds within the same loop the terrain computation, the mesh geometry computation and its bounding box computation.

So one loop instead of three.

The legacy ribbon object, provided in the BJS core, was also a bit improved to morph quickly, GC and optimizer-wise.

Well, I still need to add two or three more little and useful methods for the user, like returning the terrain normal at the coordinates (x, z) or a boolean to check if the world coordinates (x, z) are currently also in the terrain (both almost done), before starting to write some documentation and code some examples.

The toy will be released very soon ;)

adam and winkman like this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.