Author Topic: VertexController mesh size  (Read 913 times)

Offline Bryan

  • byte
  • *
  • Posts: 26
    • View Profile
VertexController mesh size
« on: November 03, 2012, 06:37:39 pm »
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: VertexController mesh size
« Reply #1 on: November 03, 2012, 08:01:01 pm »
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.

Offline Bryan

  • byte
  • *
  • Posts: 26
    • View Profile
Re: VertexController mesh size
« Reply #2 on: November 03, 2012, 09:40:29 pm »
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.