Spheres.

 

Let's create an array of the spheres lying on the same line but having different parameters:

 

 

 for (int i=3;i<8;i++)

 {

     sgCSphere* sp1 = sgCreateSphere(i%2+1,4*i,4*i);

     SG_VECTOR transV1 = {2*i,2,0};

     sp1->InitTempMatrix()->Translate(transV1);

     sp1->ApplyTempMatrix();

     sp1->DestroyTempMatrix();

 

     sgGetScene()->AttachObject(sp1);

     sp1->SetAttribute(SG_OA_COLOR,i);

    if (i%2)

       sp1->SetAttribute(SG_OA_DRAW_STATE,SG_DS_FRAME);

 }

See also:

 

sgCSphere   sgCSphere::Create

sgCObject::InitTempMatrix sgCMatrix::Translate   sgCObject::ApplyTempMatrix   SgCObject::DestroyTempMatrix   sgGetScene sgCScene::AttachObject   sgCObject::SetAttribute

 

Illustration:

spheres