obj2mesh proposal [was: obj2mesh, UV coordinates and image aspect]

Hello group, hello Greg :wink:

My recent experiments with obj2mesh and uv coordinates have
inspired a proposal to add uv coordinate conversion to
obj2mesh.

The problem:

Radiance works in a texture coordinate system of (Lu,Lv)
where the _smaller_ dimension is 1.0 and the larger is >1.0.
Other file formats (especially *.obj) work in a texture
spaces that's normalized to 1 (both dimension are in the
range (0,1) regardless of width and height of the image).

When uv coordinates are present in an *.obj file that's
converted via obj2mesh the coordinates are taken as they
are found which is only correct for square images. In other
cases only the lower left square of the texture image is
used for the mapping.

Current solution:

The uv coordinates of the *.obj file have to be converted
to the range expected by Radiance before the mesh is created
with obj2mesh. This is not difficult but it would change the
content of the original file in a way that's probably against
the specs of the *.obj file format.

Alternative:

My proposal is to add a new option to obj2mesh to set the
aspect ratio of the texture image when the mesh is created.
obj2mesh can do the necessary conversion of the normalized
uv coordinates and write the converted values to the mesh.

The informations necessary are the relation of the image
dimensions and which side is the larger one (w or h). Both
can be given in a single float when we assume a w/h aspect
of the images (though I'm not sure this convention exists
anywhere in Radiance). The default should be a 1.0 aspect
so the current behavior is preserved even without the new
option given.

Since '-a' and '-r' are already used in obj2mesh the new
option could be '-t' (for texture aspect). Example:

$ obj2mesh -t 0.5 input.obj output.rtm

to map the uv coords of the *.obj to a landscape texture
image (eg. w=200 h=400 px).

Please correct me if anything is wrong with this idea or
if it's incompatible with the current use of obj2mesh.

Thomas

PS: I may have difficulties replying to emails in the next
     days or weeks. Please don't think I'm avoiding the wrath
     if a reply takes a some days.

Forget that! See the other post and the solution by Greg.

Thomas

···

On 20.02.2006, at 17:51, Thomas Bleicher wrote:

Hello group, hello Greg :wink:

My recent experiments with obj2mesh and uv coordinates have
inspired a proposal to add uv coordinate conversion to
obj2mesh.

The problem:

Radiance works in a texture coordinate system of (Lu,Lv)
where the _smaller_ dimension is 1.0 and the larger is >1.0.
Other file formats (especially *.obj) work in a texture
spaces that's normalized to 1 (both dimension are in the
range (0,1) regardless of width and height of the image).

When uv coordinates are present in an *.obj file that's
converted via obj2mesh the coordinates are taken as they
are found which is only correct for square images. In other
cases only the lower left square of the texture image is
used for the mapping.

Current solution:

The uv coordinates of the *.obj file have to be converted
to the range expected by Radiance before the mesh is created
with obj2mesh. This is not difficult but it would change the
content of the original file in a way that's probably against
the specs of the *.obj file format.

Alternative:

My proposal is to add a new option to obj2mesh to set the
aspect ratio of the texture image when the mesh is created.
obj2mesh can do the necessary conversion of the normalized
uv coordinates and write the converted values to the mesh.

The informations necessary are the relation of the image
dimensions and which side is the larger one (w or h). Both
can be given in a single float when we assume a w/h aspect
of the images (though I'm not sure this convention exists
anywhere in Radiance). The default should be a 1.0 aspect
so the current behavior is preserved even without the new
option given.

Since '-a' and '-r' are already used in obj2mesh the new
option could be '-t' (for texture aspect). Example:

$ obj2mesh -t 0.5 input.obj output.rtm

to map the uv coords of the *.obj to a landscape texture
image (eg. w=200 h=400 px).

Please correct me if anything is wrong with this idea or
if it's incompatible with the current use of obj2mesh.

Thomas

PS: I may have difficulties replying to emails in the next
    days or weeks. Please don't think I'm avoiding the wrath
    if a reply takes a some days.

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general