This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > VRML > June 2005 > texture coordinates on ~spheres where 1 and 0 meet





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author texture coordinates on ~spheres where 1 and 0 meet
John Andrews

2005-06-25, 11:14 pm

i've created a VRML IndexedFaceSet model- an approximate sphere, ~100k
polygons, of the planet mars. I wrote a program to generate the model
from a DEM. I've mapped an image onto the sphere: a topographic image
i created from the same DEM. It looks great, with one problem, which
i'll try to explain. The "x" texture coordinates begin at ~0 at
front/center of sphere, are around .25 on the far right side of the
sphere, .5 in the back/center of the sphere, .75 on the far left, and
then come back to 1 as you wrap back around to the front/center again.
The texture maps onto the model perfectly. EXCEPT in a thin strip of
triangles beginning at the top and ending at the bottom, right down the
front/center of the sphere. After a couple minutes i figured out what's
going on here: each of the triangles along this strip straddles the
0-longitudinal line, and thus the left-of-center (or left of
0-longitude) vertices of individual triangles here have texture
coordinates around .9, whereas the right-of-center vertices have texture
coordinates around .1. (well, more like .99 and .01, respectively, but
you get the idea). So, on these triangles, the whole texture is
mapped--in reverse--back across the faces, from .01 on the right over to
..99 on the left. My question is: does anyone know of a way to fix
this? The obvious solution would be to have no triangles straddling
0-longitude (in other words, no triangles with vertices on each side of
the line), but instead simply have the triangles meet at this location
along a smooth line. For reasons i won't bore you with, however, this
is not an ideal solution given the procedures i use to generate these
type of models, though one i may have to resort to if i cannot find
another fix.

as always, any suggestions much appreciated.
thanks,
john

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews