VertexController mesh size

Started by Bryan, November 03, 2012, 06:37:39 PM

Previous topic - Next topic

Bryan

I've been messing a bit with an editor for somebody and am trying to deform the terrain.

I can get the polygon they clicked on which is fine, but in the VertexController the mesh size is only 1024 (the terrain region is currently 32x32 with 2 triangles per 'tile'). So I was wondering how exactly the getDestinationMesh()
  • applies to the actual mesh.

    The array size seems to be 1024 so 1 index per tile, but each tile is made of 2 polygons so how does this work?

    When I try to deform the terrain the polygon they clicked on I thought might have been just *2 the index since there are 2 triangles per, but it doesn't seem to be the case and the actual location I change is off from where I am clicking.

    Thanks in advance for the help.

    Bryan

EgonOlsen

That's because jPCT combines vertices by default. If you don't want that, disable that behaviour either by using Object3D.disableVertexSharing(); or by Loader.setVertexOptimization(false);...depending on if you create the object yourself in code or import it via Loader.

Bryan

Awesome I will check that out when I get back on the computer. I figured it would be something easy like that, thanks! 

I really like working with the library so thank you for that too.