logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

s3d_push_polygons - push many polygons

Author

SimonWunderlich
           Author of s3d

s3d                                                                                         S3D_PUSH_POLYGONS(3)

Description

       As for vertices, you can push arrays of polygons to have greater performance. The pbuf should contain n
       polygons which consist of 4 uint32_t values of 3 vertices indices and 1 material index.

            uint32_t pbuf[] = { 0, 1, 2, 0};
            int oid = s3d_new_object();   // create a new object
            s3d_push_vertex(oid, 0.0, 0.0, 0.0);
            s3d_push_vertex(oid, 0.0, 1.0, 0.0);
            s3d_push_vertex(oid, 1.0, 0.0, 0.0);
            s3d_push_material(oid, 0.3, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0);
            s3d_push_polygons(oid, pbuf, 1);
            // push one polygon with the pbuf data

Name

       s3d_push_polygons - push many polygons

Synopsis

#include<s3d.h>ints3d_push_polygons(intobject,constuint32_t*pbuf,uint16_tn);

See Also