Get UV coords of an object



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 24/04/2006 at 14:26, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   9.5 
    Platform:      
    Language(s) :   C.O.F.F.E.E  ;

    ---------
    Hello everybody.

    For a use in a game 3D engine, I need to retrieve the UV coordinates of objects created in Cinema 4D, so after having read the COFFEE documentation and being helped by some old topics on this forum, I concluded that UV coords were stored in a VariableTag object in which the data array can be obtained using the GetData() function (and the size of the data array by the GetDataCount() function).

    Maybe I'm wrong, but I think the UV coordinates are stored following the polygon order, that is to say : UVa, UVb, UVc, UVd for the 1st polygon, UVa, UVb, UVc, UVd for the 2nd polygon, etc...
    But, when I try to get the UV coords of an object containing n polygons, the size of the data array I retrieve (known using GetDataCount()) is not 4*n (4 vertices * n polygons) but n, so I only get partially the UV data.

    I really don't know where I'm mistaking, and once again, I would appreciate some help from more experienced programmers than me.
    Thank you.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 25/04/2006 at 02:15, xxxxxxxx wrote:

    I think GetDataCount() refers to the polygon count, not the actual array size. Have a look at the variable tag section in the docs.
    The array should really be 4*n elements in size.. so just access the data as you intendend. I'm sure it will be alright.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 25/04/2006 at 09:07, xxxxxxxx wrote:

    Yes, you're right. Accessing more simply to the data without taking care of GetDataCount() was the solution.
    Thank you very much.


Log in to reply