V-up texture coordinate support
Chien Yang
chien.yang at oracle.com
Thu Oct 17 15:08:39 PDT 2013
Hi all,
Java images are defined such that (0, 0) references the top left
most pixel of the image. In JavaFX, the texture coordinate system for 3D
objects is defined with its U axis increasing from left to right and the
V axis increasing from top to bottom. Hence a texture coordinate of (0,
0) references pixel (0, 0), which is the top left corner of the texture,
and a texture coordinate of (1, 1) references the bottom right corner of
the texture. This system matches the layout of the image, which is
stored such that the top-most row of pixels ends up in memory in row 0.
It also matches with the default 3D coordinate system used in JavaFX
where the X axis increases from left to right and the Y axis increases
from top to bottom.
We understand that this V-down coordinate system maybe confusing
or hard to work with for some 3D content developers when using models
that are defined with Y-up. We could add a V-up option (as a boolean
property of Shape3D). If set, we would flip the texture coordinates when
rendering, such that: V' = 1 - V.
However it is very late in this release to consider any more
changes, so our plan is to add this option in a post FX 8 release if it
turns out to be needed. Please let us know right away if there is a
compelling need for V-up support in the FX 8 release.
- Kevin and Chien
More information about the openjfx-dev
mailing list