COFEE and UVWs with Normals ;)



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

    On 18/02/2008 at 04:15, xxxxxxxx wrote:

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

    ---------
    Hello
    I'm going to create export plugin using COFEE. I successfull export points and indexes, but I don't know, how to export nomrals and texture coordinates.
    I have COFEE SDK, but... I don't understandt it so good.
    Can be normals exported with Phong tags?
    And... can be exported normals and UVW as same count as points? I want use my format in engine and I need only one array of indexes to nomrals, vertexes and uvs...
    And at last - I'm sorry for my "English", but I'm just learning :)...
    Thanks ;)



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

    On 18/02/2008 at 05:39, xxxxxxxx wrote:

    To get the UVWs for an object you have to read out the UVW tag. For this you have to use the Variable tag. There is a set of UVWs for each polygon. So get the count of UVW sets with GetDataCount() and then step through the sets. Each UVW set contains four vectors for the four points of an quadrangle polygon, triangles have identical third and forth UVWs and point vectors. Here a little example that prints out the UVWs of an selected object.

    > \> var op = doc->GetActiveObject(); \> if(!op) return; \> \> var myuvw = op->GetFirstTag(); \> \> while(myuvw) \> { \>      if(myuvw->GetType() == Tuvw) \>      { \>           var i, uvwcnt = myuvw->GetDataCount(); \>           var uvws = myuvw->GetData(); \>           for(i=0; i<uvwcnt; i++) \>           { \>                println(uvws[i\*4]); \>                println(uvws[i\*4+1]); \>                println(uvws[i\*4+2]); \>                println(uvws[i\*4+3]); \>           } \>      } \>      myuvw = myuvw->GetNext(); \> } \>

    cheers,
    Matthias



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

    On 18/02/2008 at 05:52, xxxxxxxx wrote:

    I forgot, there is no easy way to get the normals. You have to calculate them on your own. This is much easier in C++ though.

    cheers,
    Matthias



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

    On 18/02/2008 at 07:32, xxxxxxxx wrote:

    ou...handy computing normals is not big problem.
    but...I can't access normals computed by Cinema? Because phong tags are really beautiful thing.
    I have plugin that can export normals with phong tags if they avaible-how can I acces them and how I can work with them...? What are phong tags? I know they are connected to normals,but how it work :-)?
    thanks



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

    On 18/02/2008 at 08:24, xxxxxxxx wrote:

    As I said you have no access to the phong normals in COFFEE. So unfortuantly you can't export phong breaks with COFFEE. This is all possible with the C++ API.

    cheers,
    Matthias



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

    On 18/02/2008 at 08:30, xxxxxxxx wrote:

    ok. reason,why I using coffe is,that I'm not able to compile. if I use MS visual studio,it don't work. but if I use Borland,I can compile plugin,but cinema not load it...I probably make some mistake.
    Thank you for your time...



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

    On 18/02/2008 at 10:14, xxxxxxxx wrote:

    And last question : Why count of UVWs are same as POLYGON count? If I want to cerate array of UVs as big as array of points, how I can do it :)?



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

    On 18/02/2008 at 12:36, xxxxxxxx wrote:

    Because the UVs are polygon-point referenced (in that order). In the UV plane, you can separate each polygon out. That would mean that each point is used at least twice (any point is most likely shared by more than one polygon). Therefore, a UV array the size of the point array would be useless for the inevitable seams required to flatten a 3D object into a 2D planar form. The UV array is basically polygons*4 (excluding consideration of ngons) in array size - though it is not structured linearly like that.


Log in to reply