SCSes above Billboards

New Message Reply Date view Thread view Subject view Author view

Todd R Pravata (tpravata++at++rts.dseg.ti.com)
Tue, 4 Oct 94 09:39:57 CDT


Is there any problem with placing a pfSCS above a pfBillboard to do
scaling? If I set the matrix to identity, my geometry comes out OK.
If I scale the matrix (other than 1.0), the geometry does not appear.

Thanks,
Todd

Here's the code:

      /* Ignore stamps for any other than highest level of detail */
      if (mrf.is_stamp && lod == 0) {
        pfVec3 pos;

        /* Create SCS to scale stamp model */
        scs = create_SCS(mrf.scale.x, &ZERO_VECTOR, &ZERO_VECTOR);
        pfAddChild(parent, (pfNode *)scs);

        bboard = pfNewBboard();
        pfAddChild((pfGroup *)scs, (pfNode *)bboard);

        /* Find the GeoSet in the model hierarchy and add it to the Bboard */
        add_stamp_geoset(bboard, model);

        /* Establish the position of this geoset in the billboard */
        pfSetVec3(pos, trans.x, trans.y, trans.z);
        pfBboardPos(bboard, 0, pos);
      }

pfSCS *create_SCS(REAL_4 scale, R4P3D *rot, R4P3D *trans)
{
  pfDCS *dcs;
  pfSCS *scs;
  pfMatrix *matrix;

  void *shared_arena = pfGetSharedArena();

  dcs = pfNewDCS();
  matrix = (pfMatrix *)pfCalloc(1, sizeof(pfMatrix), shared_arena);
  pfDCSScale(dcs, scale);
  pfDCSRot(dcs, rot->x, rot->y, rot->z);
  pfDCSTrans(dcs, trans->x, trans->y, trans->z);
  pfGetDCSMat(dcs, *matrix);
  pfDelete(dcs);

  scs = pfNewSCS(*matrix);
  return(scs);
}


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:35 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.