EDITED:
I have a set of texture coordinates & Cartesian real-world ('world space') coordinates (in metres) for a shape and from those coordinates I'd like to find the world space length of a single unit of each of the s
and t
texture coordinates, when the line corresponding to that length is oriented horizontally & vertically respectively, in texture space. But I am struggling to calculate this when I don't have at least one edge which is oriented horizontally and one edge which is oriented vertically in texture space.
Essentially I would like to be able to find out what 1 s
unit equals in metres and what 1 t
unit equals in metres. To illustrate this, using an example triangle shape - see below for list of coordinate values - I want to find the length of the vertical & horizontal red arrowed lines in metres ...
(I'd also like the solution to work for any triangle or polygon, given the equivalent set of coordinates)
Texture mapping here is non-parametric, all 3D points are also coplanar and hence the surface is developable. Mapping in world space on the plane is isometric (global scaling) such that interpolation in 2D can therefore be linear.
(as it is I'm working in MATLAB - I'm texture mapping and want to be able to convert any texture coordinate on my developable, globally-scaled surface to Cartesian coordinates)
By way of example I have triangle with a set of texture coordinates (s, t)
as follows ...
EDITED VALUES (twice):
(1) 1.7942553649452966 0.8511551466745527
(2) 1.756240725743247 0.8674815156738774
(3) 1.730892921329496 0.8328561344213196
(1) 1.7942553649452966 0.8511551466745527
... which has corresponding real-world (Cartesian) coordinates (x, y, z)
with units of metres ...
EDITED VALUES (twice):
(1) 660050.0702952344 5868605.033820355 20.442670747055647
(2) 660050.3347344951 5868606.121563466 20.574639679143946
(3) 660050.4376411334 5868606.55473629 19.53932546324279
(1) 660050.0702952344 5868605.033820355 20.442670747055647
FYI these are from CityGML which uses the COLLADA method for texture mapping.
Since the shape will always form a plane I can easily generate the equation of the plane, and equations of lines represented by each vertex pair. But I can't see how these will help me without knowing rotation of lines on the plane with respect to what is horizontal and vertical in texture space. So starting off by using Pythagoras on an edge isn't possible ... ?
I'm thinking that this must be a problem that has been solved ages ago by those coding object viewers which both texture map and show world space, but I can't find a solution so far ...
FYI this is related to an ongoing question by me here.
Thanks