Home>

### opengl - i want to put out a frame model

to directx
There is D3DXMATRIXA16, named TransformMatrix, OffsetMatrix, CombineMatrix, etc.
I'm calculating by multiplication as it is, but it seems that opengl does not? So, I decided to calculate with 3 * 3 from now on. I think that the bottom of the matrix corresponds to movement, but I don't like to mess around every time the matrix calculation comes out.
I decided to put it on hold for the time being. (The world coordinates are a matrix that represents movement, rotation, and reduction.)
.. Since the composite matrix of the fuselage is TransD * world,
Since it is a composite matrix TransC * TransD * world of the upper right arm frame,

``````float px;float py;float pz;
px = Mesh_tiny [3 * a  +0];
py = Mesh_tiny [3 * a  + 1];
pz = Mesh_tiny [3 * a  +2];

float qx, qy, qz;

qx = cos (angle * M_PI/180) * px + 0 * py + sin (angle * M_PI/180) * pz;
qy = 0 * px + 1 * py + 0 * pz;
qz = -sin (angle * M_PI/180) * px + 0 * py + cos (angle * M_PI/180) * pz;

float Bip01_L_Clavicle [] = {
-0.185356,0.308957,0.932839,
-0.499811, -0.846968, 0.181203,
0.846069, -0.432656, 0.311411,
// -12.374969,4.006883,8.346215
};

// syukushou
qx = 0.003 * qx;
qy = 0.003 * qy;
qz = 0.003 * qz;
// Composite matrix after calculation ... I don't know if the numbers are wrong.
// doutai frame
qx = 1.278853 * qx;
qy = 1.123165 * qy;
qz = -1.470235 * qz;
// Bip01_L_Clavicle
qx = -1.261525934928 * qx;
// qy = -2.628411560409 * qy;
qz = 0.1838206451025 * qz;

// idow
qx = qx + 0.135977-0.142114;
qy = qy + 2.027985 + 0.000023;
qz = qz + 133.967667-49.556850;
glVertex3f (qx, qy, qz);``````

The image will look like the one below.

// Uncommented composite matrix after calculation // qy = -2.628411560409 * qy;

It will be upside down. Where is the image transparent and strange?
Is strange
I don't care.

I think it is useless to put a composite matrix in, but // Calculation of skinning matrix SkininMatrix = OffsetMatrix * In combineMatrix, combineMatrix is ​​a composite matrix and OffsetMatrix is ​​the last 16 numbers of the weight. I'm not sure what to do after that. Please tell me how to configure the frame model. (Quote 3D fighting game programming)

``````SkinWeights {
"Bip01_L_Clavicle";// Frame name
2;// Number of weights
150, // vertex number
3512;
0.303157, // Weight
0.303157;
1.253361, -0.000002,0.254069,0.000000, -0.218659, -0.223923,1.078679,0.000000,0.058231, -1.440720, -0.287275,0.000000,-8.131670,62.204407, -2.611076,1.000000 ;;// Offset matrix
}``````
• Answer # 1

There is D3DXMATRIXA16 in directx. I named it TransformMatrix, OffsetMatrix, CombineMatrix, etc. and calculated it by multiplication as it is, but it seems that opengl does not?

In OpenGL, there is no part corresponding to D3DX MATRIX A16 of DirectX. Please implement it yourself.

From now on, I decided to calculate with 3 * 3. I think that the bottom of the matrix is ​​a move, but I don't want to mess around every time the matrix calculation comes out, so I decided to put it on hold for the time being. (The world coordinates are a matrix that represents movement, rotation, and reduction.)

The 3D Matrix is ​​generally 4x4. If it is 3x3, it will be mistaken for a two-dimensional element.

If you uncomment the composite matrix after calculation // qy = -2.628411560409 * qy ;,

I think the opposite is because the formulas for the right-handed coordinate system and the left-handed coordinate system are wrong.
DirectX uses a left-handed coordinate system, while OpenGL uses a right-handed coordinate system.
You can also convert, so it is recommended to go with your favorite axis, but please do only the conversion properly.