Jump to content

tube mesh


jerome
 Share

Recommended Posts

thank you :)

What do you mean by "updating" ?

I am rightly wondering how to dynamically deform a mesh !

 

[EDIT]

oops didn't notice your previous post with the playgroung example !

Very nice

 

As far as I understand you recreate 2 tubes each frame. Am I right ?

 

I would find a way to keep the existing mesh and just change dynamically its curve/radius for instance.

[/EDIT]

Link to comment
Share on other sites

As far as I understand you recreate 2 tubes each frame. Am I right ?

 

Absolutely. The 'createTube' function is called twice each frame.

 

The first optimization I'd try would be to split the trail in segments, each a separate submesh. Then, I just have to add a new segment and remove the last one each frame. But this would not work with the radius variation... Vertex shader could work for that but that would result in a very complex system for a purely cosmetic feature.

 

Another solution is to dig into the vertex buffers, like Temechon suggested in your other post. But rebuilding buffers is a costly operation, and it would be complex to do: once the tube mesh is done and its vertices buffers are set up, 'reopening' them would require knowing where to look and which vertices to modify.

 

I'm not familiar enough with WebGL and the internals of BabylonJS to help you more on this...

 

Also, if it was up to me and I'd have to draw a ship trail in space, I'd simply use billboarded quads :)

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