Jump to content

Update Heightmap vertices


firlyndi
 Share

Recommended Posts

Hello,

 

I am quite new to Babylon JS. I was wondering if there is a way to morph the selected vertices on click. I read the documentation, and tried all their examples, but have yet to come up with a solution. So far I have this code below.

 

  scene.onPointerDown = function(evt, pickResult) {

    if (pickResult.hit) {

       // code for mophing selected vertices here.

      var chosenMesh = pickResult.pickedMesh; 

     }

}

 

I am stuck right at this point. I did some console logs and chosen mesh seems to select the entire plane. I also tried pickResult.faceId and it gives me the Id of the selected face, however, I am not sure how I can edit this particular face on the height map. Any ideas? Or examples? Thanks for your help.

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...