Jump to content

How Subdivide polygons like ThreeJS on BabylonJS?


jorditantadiaz
 Share

Recommended Posts

Hi, i am trying to subdivide a mesh, after load it by OBJLoader on BabylonJS, but i don't understand how  do  something like this (ThreeJS).

var geometry = new THREE.Geometry().fromBufferGeometry( mesh_.geometry );
var modifier = new THREE.SubdivisionModifier( 3 );
modifier.modify( geometry );
geometry.mergeVertices()
mesh_.geometry = geometry

But on Babylon JS, i could not found documentation about how subdivide polygons after load mesh by OBJLoader

Link to comment
Share on other sites

@jorditantadiaz 

While there actually is a mesh.subdivide(number) function, it doesn't seem to update the mesh.
 

" But unfortunately (As we try to simplify rendering) we do not have a way to increase mesh complexity "-Deltakosh

 

a "work-around" that might work for you, would be to have several LOD's of your model.
http://www.babylonjs-playground.com/#1DTMBL#1 // Click on the sphere.

Link to comment
Share on other sites

And the use of octree does not make it that ?

mesh.createOrUpdateSubmeshesOctree(); //To call at the end of the loading of your scenes

and subdivide exist: => http://doc.babylonjs.com/classes/2.5/Mesh#subdivide-count-rarr-void

In a single line you do what ThreeJS does in 5 lines

mesh.subdivide(3); //Value 3 may not work. Try another value if that is the case.

 

Link to comment
Share on other sites

  • 4 weeks later...

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