[8u40] API Review for RT-29012: Add support for vertex normals for meshes, in addition to smoothing groups

Chien Yang chien.yang at oracle.com
Mon Aug 4 21:06:00 UTC 2014


Hi all,

We would like to add support for a new vertex format that allows 
developers to specify their own normals for a given mesh. This work is 
small in its scope. It requires one new public class and a few new 
methods to two existing classes. When normals are provided using this 
new vertex format, we render the triangle mesh using those normals 
rather than computing them.

Here is the proposed public API:

Add class:

public final class VertexFormat {

     // Public static constants
     public static final VertexFormat POINT_TEXCOORD
     public static final VertexFormat POINT_NORMAL_TEXCOORD

     // Public getters
     public int getVertexIndexSize()
     public int getPointIndexOffset()
     public int getNormalIndexOffset()
     public int getNormalIndexOffset()

}

Add constructors, properties and methods to existing classes:

TriangleMesh {

     // Public constructor
     public TriangleMesh(VertexFormat vertexFormat)

     // Public property
     public final void setVertexFormat(VertexFormat value)
     public final VertexFormat getVertexFormat()
     public final ObjectProperty<VertexFormat> vertexFormatProperty()

     // Public getters
     public final int getNormalElementSize()
     public final ObservableFloatArray getNormals()
}

PickResult {

     // Public constructor
     public PickResult(@NamedArg("node") Node node, @NamedArg("point") 
Point3D point,
     @NamedArg("distance") double distance, @NamedArg("face") int face,
     @NamedArg("normal") Point3D normal, @NamedArg("texCoord") Point2D 
texCoord)

     // Public getter
     public final Point3D getIntersectedNormal()

}

Please let us know of your thoughts via adding comment to the JIRA: 
https://javafx-jira.kenai.com/browse/RT-29012

Thanks,
- Chien



More information about the openjfx-dev mailing list