Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    How to get Normals and UV coordinates ;)

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 391 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

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

      On 21/02/2008 at 06:17, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   10.111 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hello 😉
      I'm working on export filter. And I've problem.
      I cam extract points and references to them.
      T know, how to acces to phong array and uv array, but I don't know, how to connect right points with right UV coordinates and normals.
      If I use function from UVWTag Get( poly_index ), that I get UVWStruct with four values. I make some attempts, but it don't work...
      I have allocated array of phongs and UVs, but, how I can connect it with points?
      If I get GetPolygons array, max value of each point reference is GetPointCount ? So, I can't use GetPolygons to refer into arrays of nomrals and UVs, is that thought correct :)...?
      Thanks...

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

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

        On 21/02/2008 at 06:47, xxxxxxxx wrote:

        The UVWtag provides an UVWStruct for every polygon.

        UVWStruct Get(LONG i) //i is the polygon index

        The UVWStruct contains four vectors a,b,c,d. One for each point of the polygon. To make a connection between points and UVWs you simply read out the CPolygon structure of the polygon. It contains the indices to the four points of a polygon. So the vector a of the UVWStruct is connected to the point index a in the CPolyogn structure. It works the same for the normals. CreatePhongNormals() returns an array of vectors. It has the size of 4*GetPolygonCount(), (four normals for each polygon, so one for each point of an polygon). Things to remember, triangles have identical 3rd and 4th point indices, UVWs and normals. CreatePhongNormals() needs a phong tag to work otherwise it will crash.

        cheers,
        Matthias

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

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

          On 21/02/2008 at 06:58, xxxxxxxx wrote:

          So - its only symbolic code 🙂

          > \> for(int i = 0; i < GetPolygoncount; i++) \> { \>    vert[face[i].a];face[i].a;uvwstrct[i].a; normal[i\*4+0]; \>    vert[face[i].b];face[i].b;uvwstrct[i].b; normal[i\*4+1]; \>    vert[face[i].c];face[i].c;uvwstrct[i].c; normal[i\*4+2]; \> } \>

          Is this right connection between all structures to make triangle?

          Thanks for your advices ;)...

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

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

            On 21/02/2008 at 07:07, xxxxxxxx wrote:

            That looks ok. Just remember a quadrangle contains two triangles. So you should check if the polygon is a quadrangle or triangle. Do you want to export triangles only?

            cheers,
            Matthias

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

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

              On 21/02/2008 at 08:17, xxxxxxxx wrote:

              yes. This plugin is omly for me - and i triangulate everything before 🙂 export. But I know, how to do it, if I want to covnert qadtrangles to trianlges :).

              I GOT IT !!!!! IT WORKS... JABABDADADAADDBABABADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

              I'm sorry :-[...
              but... I'm very happy person :). Thank so much to your advices and support !!! Whaooo... and WHEPEEE... :)...

              1 Reply Last reply Reply Quote 0
              • First post
                Last post