Easy Help (i hope)

Hello, I'm at the first tryes with jme.

I wonder if exist some standard way (I want not to regenerate hot water) to generate a TriMesh from a set of vertices (liing on the same plane) that form it's irregular boundary, for example to draw a lake.

for example

from

0,1,0

1,0,0

1,1,0

0,0,0

i want a square

from

0,0,0

2,0,0

2,2,0

1,2,0

1,1,0

0,1,0

i want an L shape.

And so on with irregular boundaries.

Thanks in advance :slight_smile:

Check the GeomBatch class, it has exactly what you want… Be sure to use an index array also.  :wink:

Umm, ok i was unable to find documantation abount geomBatch, so i started to enter in the code… but for now all is dark…



and more, what do you mean with index array? do you think abount an array that codify the joint between vertex and vertex? that is the set of edge?



if it easy can you post me the code that starts from the vertex list (or buffer, or what is is better) and result in a Spatial stuff that i can add to a node?

Ok, check this up:



http://www.jmonkeyengine.com/wiki/doku.php?id=starter:hello_trimesh&s=hellotrimesh



It tells you how to create custom TriMeshes…

duenez said:

Ok, check this up:

http://www.jmonkeyengine.com/wiki/doku.php?id=starter:hello_trimesh&s=hellotrimesh

It tells you how to create custom TriMeshes...

Yes, ok it helps, it is the way to create custom TriMesh dinamically, thats is enough to generate all shapes I will ever need, it only require some work for the triangulation.
I wonder if there is a tool for the autotriangolation, like delaunay triangulation or something similar.
Peraphs this is an hot theme because there are lots of way to triangulate, for example a set of point that form a C shape.
without the information of what point are the boundary and what point are not is simply impossible for the machine to satisfied the user idea...
If such tool do not exist's is possible that i'm going to try to code it...

I have founded a class Triangolator under the 3dtext generator in jmex

I'm tring to adapt this way :slight_smile: