JavaFX 3D : TriangleMesh specification questions

Chien Yang chien.yang at oracle.com
Mon Apr 29 00:53:57 PDT 2013


Hi August,

      Please see my reply inline.

On 4/23/2013 5:23 AM, August Lammersdorf, InteractiveMesh wrote:
> Chien, thanks for the description.
>
> So, your approach follows the Autodesk(TM) 3ds Max(TM) multiple 
> smoothing group feature 
> http://docs.autodesk.com/3DSMAX/15/ENU/3ds-Max-Help/index.html?url=files/GUID-1DB2E3C2-CE68-4AF7-899E-01B90F7EB320.htm,topicNumber=d30e25679 
> .
>

Yes. This feature is requested by our Sample Team as they need to be 
able to import 3ds max format.

> AFAIK only the proprietary binary 3ds file format supports multiple 
> smoothing groups per face (chunk 0x4150 includes an unsigned 32-bit 
> integer).
>
> Following line should assign the smoothing groups 1, 15, and 32 to the 
> i-th face:
> faceSmoothingGroups[i] = (1 << 0) | (1 << 14) | (1 << 31);
> Correct?
>

Yes, but we would like to make a slight modification to the specification.
Our plan is the name the groups from 0-31; in this case a face is a 
member of group N if bit N is set, for example, groups |= (1 << N); To 
make something a member of group 5 you would set bit 5.

In your example,

faceSmoothingGroups[i] = (1 << 0) | (1 << 14) | (1 << 31);

will assign the smoothing groups 0, 14, and 31 to the i-th face.

This change has a cleaner mathematical notation and is more in line with 
the rest of Java. However we need a note to highlight that a value of 0 
(hard edges) is not to be confused with group 0 -- represented as a 
value of (1<<0).

> I assume that the smoothing group '0' can be assigned only as the sole 
> group and that not more than three groups can be assigned.

I hope the above change did help to clarify value 0 isn't group 0, and a 
face is theoretical possible to share all 32 groups.

>
> Currently I'm extending my importer smoothing group assignment 
> procedure from one to multiple groups per face. The question is, what 
> caused the existence of more than one smoothing group and how to 
> detect this by analyzing the read points and normals? One cause is if 
> a mesh of smoothly adjacent triangles encloses creased edges as shown 
> in the wing video sample (RT-29236). Any other ideas?
>

We haven't done an implementation that generates multiple smoothing 
groups per face either, and can't think of an example other than the 
wing. :-)

> Is the feature RT-29012 (vertex normals for meshes) still planned for 
> a later release than JFX 8?
>

Yes, this is still true.

Thanks,
- Chien

> August
>
> Am Samstag, den 20.04.2013, 15:53 +0200 schrieb Chien Yang 
> <chien.yang at oracle.com>:
>> Hi August,
>>
>> The following description should be even better:
>>
>> /**
>> * Sets the face smoothing group for each face in this {@code 
>> TriangleMesh}
>> * Smoothing affects how a mesh is rendered but it does not effect its
>> * geometry. The face smoothing group value is used to control the 
>> smoothing
>> * between adjacent faces.
>> *
>> * The face smoothing group is represented by an array of bits and up 
>> to 32
>> * unique groups is possible. The face smoothing group value can range 
>> from
>> * zero to all 32 groups. A face is said to belong to a group is by 
>> having
>> * the associated bit set. A value of 0 implies no smoothing group or 
>> hard
>> * edges. A face can have no or more smoothing groups. Smoothing is 
>> applied
>> * when adjacent pair of faces shared a smoothing group. Otherwise the 
>> faces
>> * are rendered with a hard edge between them.
>> *
>> * A null faceSmoothingGroups implies all faces in this mesh have a
>> * smoothing group value of 1.
>> *
>> * Note: If faceSmoothingGroups is not null, 
>> faceSmoothingGroups.length must
>> * be equal to faces.length/NUM_COMPONENTS_PER_FACE.
>> */
>>
>> Thanks,
>> - Chien
>



More information about the openjfx-dev mailing list