THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/10/2006 at 06:03, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 9.6
Platform: Windows ;
Language(s) : C++ ;
---------
Hello,
i'm trying to extract the UVW coordinates of a polygonal mesh. It all works fine when the texture tag has an "UVW mapping" projection, but I still haven't managed to retrieve the correct mapping coordinates when a Spherical or a Cubic projection is used.
I'm trying to use the function
**
Bool ShdProjectPoint(VolumeData *sd, TexData *tdp, LONG lhit, const Vector &p;, const Vector &n;, Vector *uv)
**
referenced in TexData help:
which extensively uses tdp->im (the inverse of the texture projection matrix).
The problem is when I get the pointer to TexData:
**
TexData* pTexData = pVolumeData- >GetTexData(pObject, 0);
**
the im field is not initialized, so I manually inverse the matrix:
pTexData- >im = !pTexData->m;
or, additionally:
pTexData- >Initialize();
However none of this seems to work, I get weird UVWs with any kind of projection (but "UVW mapping" one, which i'm retrieving via UVWTag::Get(polygonID) )
Has anybody managed to do get UVW from Spherical/Cubic/... projections? any comments would be appreciated.
Thanks