If I create a group node I canÃ¢â¬â¢t assign a transformation matrix to node. I get every time error no matter the way:
For example the below code:
// Create the group node:
mgrec *groupRec = mgNewRec(fltGroup);
// Get the matrix record. It gives a valid pointer
mgrec *mat = mgGetAttRec(groupRec, fltMatrix, MG_NULL);
// Set the values contained in my grpMatrix to matrix attributes
int numElements = mgSetAttList(matrixRec,
I get numElements = 0 i.e. the mgSetAttList was not successful
if I try to use the command
mgbool ret = mgSetMatrix ( groupRec, fltMatrix, grpMatrix(0,0) );
I get ret = MG_FALSE
I would appreciate any help
Thanks a lot !
You don't set a nodes matrix directly, instead you attach Transformation Records to the node as described in this previous forum thread:
Also if you have OpenFlight 4.2 there is a FAQ describing this with sample code in the OpenFlight API Reference.
FAQ: How do I apply a matrix (transformation) to a node?