[x3d-public] IndexedTriangleSet defaults

Michalis Kamburelis michalis.kambi at gmail.com
Wed Jun 8 07:56:00 PDT 2016


2016-04-11 15:33 GMT+02:00 Andreas Plesch <andreasplesch at gmail.com>:
> For IndexedTriangleSet the default value for texCoord is NULL.
>
> http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/rendering.html#IndexedTriangleSet
>
> On the other hand the texCoord default value for IndexedFaceSet is a
> reasonable map which tries to fit a texture on the mesh.
>

(Sorry for joining this thread so late. I'm catching up with x3dpublic
mails after a short break:)

The way I understand the specification (and the way I implemented in
view3dscene and Castle Game Engine) is that the "default texture
coordinate mapping calculation" described at IndexedFaceSet is
actually performed for all X3D geometry nodes like
IndexedFace/Triangle/QuadSets. If only they lack explicit texture
coordinates (texCoord fiel NULL), and they use a texture. This seems
consistent and useful for me.

Note that the texture coordinates generated this way are never
inserted into the X3D graph, they are just calculated on thy fly and
used for rendering.

Note that for 3D textures the "automatic" tex coords follow a
different specification, given by the Texturing3d component at "33.2.4
Texture coordinate generation for primitive objects",
http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/texture3D.html#Texturecoordinategeneration
. We apply this mechanism for all geometry nodes (primitives,
IndexedFace/Triangle/QuadSets and so on).

We also add some extensions to make things more consistent and
flexible in this regard:

- You can specify the calculation explicitly by
TextureCoordinateGenerator node, with mode="BOUNDS" or mode="BOUNDS2D"
or mode="BOUNDS3D". See
http://castle-engine.sourceforge.net/x3d_implementation_texturing_extensions.php#section_ext_tex_coord_bounds
.

- We add the texCoord field even for primitives. You can only use
there TextureCoordinateGenerator (not direct TextureCoordinate), or
ProjectedTextureCoordinate, or MultiGeneratedTextureCoordinate. See
http://castle-engine.sourceforge.net/x3d_implementation_texturing_extensions.php#section_ext_tex_coord

Regards,
Michalis



More information about the x3d-public mailing list