Is there a good tutorial about TriangleBatch and TriMesh anywhere?

Indeed, the HelloTriMesh.java testcase is a little short  :wink:



Thanks in advance!



NG

Hmmm, does the number of answer represent the lack of documentation?



Please, I can't believe there is no such documentation. And excuse me if I don't understand but the lack of

javadoc is something too (sorry).



For example, what is the purpose to have several batches defined in the Geometry class through batchList?

In the cylinder class, with the constructor:

    public Cylinder(String name, int axisSamples, int radialSamples,
            float radius, float height, boolean closed, boolean inverted) {

        super(name);

        this.axisSamples = axisSamples + (closed ? 2 : 0);
        this.radialSamples = radialSamples;
        setRadius(radius);
        this.height = height;
        this.closed = closed;
        this.inverted = inverted;

        allocateVertices();
    }



and the method setRadius:

 public void setRadius(float radius) {
        this.radius = radius;
        this.radius2 = radius;
        allocateVertices();
    }



We call two times allocateVertices, is it required or is it a bug?

Should I respect the calling order in allocateVertices?:
1- setup vertices
2- setup normals
3- setup texture
4- setup indices

is the third point mandatory? And what about lighting or not? Should I know more of opengl to use TriMesh?

Anyway, thanks in advance for your comments.

Checking the User's guide on the wiki might help



http://www.jmonkeyengine.com/wiki/doku.php?id=geometry

http://www.jmonkeyengine.com/wiki/doku.php?id=trimesh



Also, I strongly suggest you switch to jME 2.0 as it has a much cleaner mesh API; more specifically, batches have been refactored out so it's much easier to use.

Thanks however, it brings new questions of course  :smiley:



-1- where can I get this jME 2.0 API and code of course?

-2- for a Geometry, why are the vertices the only minimal mandatory data structure to provide? How about normals?

    As I remember, they are used for lighting only, right? The default color if not provided is white, isn't it? Texture coordinates,

    I understand. And triangles to create faces may be optional if I want to create only points, right?

-3- regarding the simple TriMesh() constructor, I understand, okay I'll not use it anymore  :slight_smile:

-4- are there such documentation for jME 2.0

-5- and again, what is the purpose to have several batches defined in the Geometry class through batchList? (sorry to be so firm).

-6- about lighting, must my normals be normalized? (as I understand x, y and z values should be between -1.0 and +1.0? or is 48568 a possible value)



Thanks again for your answers in advance.

  1. http://www.jmonkeyengine.com/jmeforum/index.php?topic=7799.0
  2. Yes to all
  3. No
  4. I don't remember exactly, some jME feature needed them and then it got messy…
  5. After certain modifications the normals may require normalization. They must always be normalized because lighting calculations operate on unit direction vectors. A vector is a unit vector if it's length is equal to 1.


could we have some 3D isometric features?

If you want you can add it under "features to consider", but I don't think specific features like that should be supported in a game engine.