Jump to content

Create ramp for ground


Dad72
 Share

Recommended Posts

On 3-12-2016 at 10:31 PM, Dad72 said:

If there is one manners more general, I definitely want to see it. :)

There is, and it is by pulling the ground over a mesh. So you would create a ramp mesh (ground), and then pull the ground over it. It works better than the old code, and you can do much more with it as well. Here it is:

http://www.babylonjs-playground.com/#GQ83J#3

The brush size is now in BJS units. I also added some example shapes you can uncomment.
I like how elegant the new addRamp function has become :)

Edit: I fixed a wrong ray length in the code, added a new option to not let the ground go lower (allows ramps to go through each other), and corrected the comments:

http://www.babylonjs-playground.com/#GQ83J#4

Edited by Gijs
Fixed ray length code, added feature, corrected comments
Link to comment
Share on other sites

  • 1 year later...

Hi @Gijs,

I'm coming back to you because you're the author of this feature that worked well before. But now, there is something different depending on the click and I do not know why.

I told myself that you can understand better than me what happens. Try this PG to create multiple ramps in multiple directions. they are not placing correctly.

I also noticed that if the terrain is not subdivided enough, it does not create flat ramps anymore. and if on a ground of 500 * 500 subdivisions of 500 are made that ground lose a lot of performance. And the bigger the terrain, the narrower the radius of the ramp (it would take a multiplier ratio, I guess, depending on the size of the terrain)

The ideal would be to subdivide only the part of the ramp. You think it's possible?

Thank you for your help.

http://www.babylonjs-playground.com/#GQ83J#9

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...