Hi,
what is the recommended way of importing polygonal geometry into jme?
the geometry i have consists of several polygon faces of arbitrary points each. in java3d this was an easy task to do, as you have the GeometryInfo class which takes the polygonal geometry and is able to triangulate it.
in jme i could not find a way to get the same thing done. i've found some GeometryInfo class of jme, but this one seems to be pretty old and is not available anymore.
also i have messed around with the Glyph3D and Triangulator classes, which does not work either. as far as i found out by inspecting the code of these two classes, Triangulator seems to work only with x/y planar polygons, not with ones that do have z-coordinates too.
currently i am doing a mix of java3d and jme }:-@, which works well, but definately is not pretty elegant to do so i think.
GeometryInfo gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);
gi.setCoordinates(point_array);
gi.setStripCounts(strip_count_array);
NormalGenerator ng = new NormalGenerator();
ng.generateNormals(gi);
gi.recomputeIndices();
int[] coord_indices = gi.getCoordinateIndices();
Point3f[] coords = gi.getCoordinates();
javax.vecmath.Vector3f[] normals = gi.getNormals();
Vector3f[] coords_jme = new Vector3f[coords.length];
for (int i = 0; i < coords.length; i++)
{
coords_jme[i] = new Vector3f(coords[i].getX(), coords[i].getY(), coords[i].getZ());
}
Vector3f[] normals_jme = new Vector3f[coords.length];
for (int i = 0; i < coords.length; i++)
{
normals_jme[i] = new Vector3f(normals[i].getX(), normals[i].getY(), normals[i].getZ());
}
does anyone have a solution to do the same with jme only?