www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Bryan on November 03, 2012, 06:37:39 pm

Title: VertexController mesh size
Post by: Bryan 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()

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
Title: Re: VertexController mesh size
Post by: EgonOlsen 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.
Title: Re: VertexController mesh size
Post by: Bryan 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.