[x3d-public] IndexedTriangleSet default texture coordinates

Andreas Plesch andreasplesch at gmail.com
Tue Jan 18 17:23:12 PST 2022


Thanks, Don. Adding that referral sentence to X3DComposedGeometryNode
should work fine as it should cover most cases.

Generally speaking, I am not sure if spec. language can be treated like
code, with description and definitions being implemented or inherited. It
may be a bit unusual to have an abstract class description refer to a field
description of a concrete node which is derived itself from that same
abstract node. But having to add just one sentence to cover a lot is also
very valuable.

Best,  Andreas


On Tue, Jan 18, 2022 at 7:45 PM Brutzman, Donald (Don) (CIV) <
brutzman at nps.edu> wrote:

> Thanks for good thinking and patience.  Given the volume of well-known
> prose in IFS, we left that alone.  Dick and I addressed this today as
>
> _________________________________
> * Mantis 1375: default texture coordinates for IndexedTriangleSet and
> related nodes
> * https://www.web3d.org/member-only/mantis/view.php?id=1375
>
> Editors agreed to pursue option b, adding referral sentence to 11.3.2
> X3DComposedGeometryNode (which is where the texCoord field is defined).
> * Further information about texCoord field handling is described in
> IndexedFaceSet.
>
> Also corrected an existing sentence there:
> * If the texCoord field is not NULL, it shall contain a TextureCoordinate
> node.
> to
> * If the texCoord field is not NULL, it shall contain an
> X3DTextureCoordinateNode.
> _________________________________
>
> Results viewable at
>
> * 11.3.2 X3DComposedGeometryNode
> *
> https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1/Part01/components/rendering.html#X3DComposedGeometryNode
>
> Another refreshing day wrangling the precise meaning of NULL... hope it
> looks good.
>
> Have fun with X3D!  8)
>
> all the best, Don
> --
> Don Brutzman  Naval Postgraduate School, Code USW/Br
> brutzman at nps.edu
> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA
> +1.831.656.2149
> X3D graphics, virtual worlds, Navy robotics https://
> faculty.nps.edu/brutzman
>
> -----Original Message-----
> From: Michalis Kamburelis <michalis.kambi at gmail.com>
> Sent: Monday, November 15, 2021 6:45 AM
> To: Andreas Plesch <andreasplesch at gmail.com>
> Cc: Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>; X3D Graphics public
> mailing list <x3d-public at web3d.org>
> Subject: Re: [x3d-public] IndexedTriangleSet default texture coordinates
>
> NPS WARNING: *external sender* verify before acting.
>
>
> I second that, I mean
>
> - The algorithm for automatic generation of 2D texture coordinates that is
> now at IndexedFaceSet, actually applies to many other 3D geometries. It
> applies to IndexedTriangleSet , IndexedQuadSet, TriangleSet , QuadSet,
> triangle fan, triangle strip.
>
>     Pretty much everything *except* nodes that have specialized algorithms
> for texture generation (Box, Cone, Cylinder, Sphere, ElevationGrid,
> Extrusion).
>
> - That is how we implement it in Castle Game Engine / view3dscene too.
>
>
>     We even have an option for TextureCoordinateGenerator to request this
> algorithm explicitly by `TextureCoordinateGenerator { mode "BOUNDS2D" }`
> (so it can even by used on Box, Cone etc.). See
>
> https://castle-engine.io/x3d_implementation_texturing_extensions.php#section_ext_tex_coord_bounds
> .
>
> - Don's solution to edit the spec seems nicest. I.e., move the description
> to some general section, like "Automatic generation of 2D texture
> coordinates" and just refer to that section from respective nodes like
> IndexedFaceSet, IndexedTriangleSet etc.
>
> I think the current spec state is a result of the fact that in VRML 97,
> this algorithm was only for IndexedFaceSet. Then X3D added
> IndexedTriangleSet, IndexedQuadSet etc. but their descriptions were not
> filled with "what to do when texCoord is NULL and user tries to apply a
> texture".
>
> Regards,
> Michalis
>
> pon., 15 lis 2021 o 04:06 Andreas Plesch <andreasplesch at gmail.com>
> napisał(a):
> >
> > On Sat, Nov 13, 2021 at 6:48 PM Brutzman, Donald (Don) (CIV)
> > <brutzman at nps.edu> wrote:
> > >
> > > Thanks for taking the time to report this issue Andreas.  Recorded
> > > in the Mantis issue tracker at
> > >
> > > * Mantis 1375: default texture coordinates for IndexedTriangleSet
> > > and related nodes
> > > * https://www.web3d.org/member-only/mantis/view.php?id=1375
> > >
> > > Another option is to move the full definition (plus Figures 13.6 and
> 13.7) up from 13.3.6 IndexedFaceSet to the X3DComposedGeometryNode
> abstract node type, where the texCoord field is defined.
> >
> > That could work well. I think the default texCoords would apply to all
> > of the implementing nodes.
> >
> > Thank you for considering that option,
> >
> > Andreas
> >
> > >
> > > * 4.4.2.3 Interface hierarchy
> > >
> > > https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1
> > > /Part01/concepts.html#InterfaceHierarchy
> > >
> > >         |                   +- X3DComposedGeometryNode -+-
> IndexedFaceSet
> > >         |                   |                           +-
> IndexedTriangleFanSet
> > >         |                   |                           +-
> IndexedTriangleSet
> > >         |                   |                           +-
> IndexedTriangleStripSet
> > >         |                   |                           +-
> IndexedQuadSet
> > >         |                   |                           +- QuadSet
> > >         |                   |                           +-
> TriangleFanSet
> > >         |                   |                           +- TriangleSet
> > >         |                   |                           +-
> TriangleStripSet
> > >
> > > * 11.3.2 X3DComposedGeometryNode
> > >
> > > https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1
> > > /Part01/components/rendering.html#X3DComposedGeometryNode
> > >
> > > * 13.3.6 IndexedFaceSet
> > >
> > > https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1
> > > /Part01/components/geometry3D.html#IndexedFaceSet
> > >
> > > All feedback always welcome.  Dick and I will consider this editorial
> correction in an upcoming specification-editors meeting.
> > >
> > > all the best, Don
> > > --
> > > Don Brutzman  Naval Postgraduate School, Code USW/Br
> brutzman at nps.edu
> > > Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA
> +1.831.656.2149
> > > X3D graphics, virtual worlds, navy robotics https://
> > > faculty.nps.edu/brutzman
> > >
> > > -----Original Message-----
> > > From: x3d-public <x3d-public-bounces at web3d.org> On Behalf Of Andreas
> > > Plesch
> > > Sent: Saturday, November 13, 2021 9:31 AM
> > > To: X3D Graphics public mailing list <x3d-public at web3d.org>
> > > Subject: [x3d-public] IndexedTriangleSet default texture coordinates
> > >
> > > https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1
> > > /Part01/components/rendering.html#IndexedTriangleSet
> > >
> > > does not specify behaviour if the texCoord field is NULL (default).
> > >
> > > https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1
> > > /Part01/components/geometry3D.html#IndexedFaceSet
> > >
> > > in contrast specifies for IndexedFaceSet:
> > >
> > > "If the texCoord field is NULL, a default texture coordinate mapping
> > > is calculated using the local coordinate system bounding box of the
> > > shape. The longest dimension of the bounding box defines the S
> > > coordinates, and the next longest defines the T coordinates. If two
> > > or all three dimensions of the bounding box are equal, ties shall be
> > > broken by choosing the X, Y, or Z dimension in that order of
> > > preference. The value of the S coordinate ranges from 0 to 1, from
> > > one end of the bounding box to the other. The T coordinate ranges
> > > between
> > > 0 and the ratio of the second greatest dimension of the bounding box
> to the greatest dimension. Figure 13.6 illustrates the default texture
> coordinates for a simple box shaped IndexedFaceSet with an X dimension
> twice as large as the Z dimension and four times as large as the Y
> dimension. Figure 13.7 illustrates the original texture image used on the
> IndexedFaceSet used in Figure 13.6."
> > >
> > > This could apply to IndexedTriangleSet as well as other Rendering
> component nodes.
> > >
> > > So the options are:
> > >
> > > a) leave undefined, up to the browser
> > > b) refer to IndexedFaceSet
> > > c) repeat language
> > >
> > > My preference is b) with a single sentence like:
> > > "If the texCoord field is NULL, a default texture coordinate mapping
> is calculated in exactly the same way as it is for IndexedFaceSet."
> > >
> > > a) is also an option since b) was implied and there was probably not a
> lot of confusion anyways.
> > >
> > > --
> > > Andreas Plesch
> > > Waltham, MA 02453
>
>

-- 
Andreas Plesch
Waltham, MA 02453
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220118/154741a7/attachment.html>


More information about the x3d-public mailing list