can't figure this on my own..

I have a class GzMatrix,Gz. and a struct GzVertex.
GzVertex struct is defined as below.

#define X 0
#define Y 1
#define Z 2

struct GzVertex:public vector<GzReal> {
GzVertex():vector<GzReal>(3, 0) {}
GzVertex(GzReal x, GzReal y, GzReal z):vector<GzReal>(3, 0) {
at(X)=x; at(Y)=y; at(Z)=z;
}
};



the class GzMatrix is defined like


class GzMatrix:public vector<vector<GzReal> > {
public:
//Note: Since this calss inherits std::vector, copy constructor and
// operator = are not required to define. However, you should define
// them in general case.


void resize(GzInt _nRow, GzInt _nCol); //Resize to _nRow by _nCol
GzInt nRow() const; //Return the number of rows
GzInt nCol() const; //Return the number of columns
//Converter between GzVertex and GzMatrix with homogeneous coordinate
//GzMatrix is a 4 by 1 vector: [0][0]=X, [1][0]=Y, [2][0]=Z, [3][0]=W
GzVertex toVertex(); //Convert to vertex
void fromVertex(const GzVertex& v); //Convert from vertex

private:

};


i created an object of GzMatrix in Gz class as,

GzMatrix transMatrix;

and struct GzVertes as

GzVertex v;


now i need to convert the structure variable v into trans matrix using the method

void fromVertex(const GzVertex& v);

declared in GzMatrix class.

i am calling the method fromVertex from Gz class as

transMatrix.fromVertex(v);

now how can i initialize the contents of transMatrix from the method fromVertex in GzMatrix class??

it may be a simple but i just can't figure it out on my own. can some one help me pls...





GzReal is a typedef for double.
I've no idea what this Gz stuff is about, but surely fromVertex() should have some return type?
Topic archived. No new replies allowed.