[x3d-public] Nurbs patch coloring

Michail Vidiassov master at iaas.msu.ru
Wed Apr 15 11:50:33 PDT 2020


Dear Andreas,

On Tue, Apr 7, 2020 at 5:50 PM Andreas Plesch <andreasplesch at gmail.com> wrote:
> So it would make sense to add "vertex" coloring if there is a convincing use case.

> I think the idea to compute a color surface in color space using the
> same Nurbs parameters as the geometric surface makes the most sense.
> In fact, I cannot think of another solution which is both general and
> easy to implement. But it remains to be seen if this would be
> practical since the resulting colors may be hard to predict/control.

What is required to make the use case convincing?
Wikipedia in its ultimate wisdom tells us "Bézier patch meshes are
superior to triangle meshes as a representation of smooth surfaces".
Using patchwork of Bezier triangular or rectangular pieces seems to be
a quite common technique.
Other forms of curved pieces are also used.
Lots of references can be produced, but since NurbsSet is in X3D since
v 3.0, it looks like it is already accepted  that handling objects
composed from NURBS pieces is a thing to do.

Surfaces composed of flat triangles or quads may have variable color
applied to show some forth attribute that could not be mapped to
coordinates, or highlight one coordinate (height) or some surface
properties (curvature). Examples also abound.
Since Bezier (NURBS) patch approximation is an improvement upon flat
patch approximation I do not see reason for it to lack the option of
getting smooth colors.

> I think the idea to compute a color surface in color space using the
> same Nurbs parameters as the geometric surface makes the most sense.
> In fact, I cannot think of another solution which is both general and
> easy to implement. But it remains to be seen if this would be
> practical since the resulting colors may be hard to predict/control.

In my case of cubic Bezier patches and linear interpolation of 4
colors given at vertices (corners) of a rectangle this solution works
nicely.
I have to give color information as 4x4 matrix instead of 2x2, but
that is a small price.
As to the general case - my guess is that  the resulting colors on
NURBS may be as hard to predict/control as the resulting texture
coordinates, that are already in the standard.

As to a (sort of) live test case:
What am I trying to achieve:
http://media.iaas.msu.ru/smoothelevation.html
What I was able to do with your modified x3dom (rough and ready, just
a proof it works for now)
http://media.iaas.msu.ru/mytest.htm
Where the example comes from:
https://asymptote.sourceforge.io/gallery/3Dgraphs/

Asymptote - program that started with drawing in 2D with cubic Bezier
curves (as they are native to TeX and PostScript, it was a "MetaPost
replacement") and later moved to 3D, where Bezier patches are used as
building blocks for most surfaces.

Sincerely, Michail



More information about the x3d-public mailing list