Skip to main content
GameDev.net gamedev.net
🔒 Locked

scale combination

Started by luasitdown Dec 11, 2005 at 12:07 PM 3 replies 500+ views
Original Post
luasitdown
luasitdown
If I want to do a few of scale operation S1 S2,and how to combine it? combine matrix just multiply it. combine translate just add it how about combine scale ? it is not good to build matrix for it and combine matrix
jollyjeffers
jollyjeffers
If you want to "chain" matrix transformations together then you simply multiply them.

// Declare your storage:D3DXMATRIXA16 matTemp;D3DXMATRIXA16 matFinal;// Initialize the final storage:D3DXMatrixIdentity( &matFinal );// For each transformation you want to do:D3DXMatrixIdentity( &matTemp );// Put your transform here:// - D3DXMatrixScaling( )// - D3DXMatrixRotation[x|y|z]()// - D3DXMatrixTranslation()// Combine the result:D3DXMatrixMultiply( &matFinal, &matFinal, &matTemp );// Once all steps have been completed, use the 'matFinal' matrix


hth
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
luasitdown
luasitdown
Quote:
Original post by jollyjeffers
If you want to "chain" matrix transformations together then you simply multiply them.

*** Source Snippet Removed ***

hth
Jack


I do not want chain matrix, I want to chian scale.

I can chian quaternion(rotate), vector(translate),matrix
how to chain scale?
I found add and dot multiply is error. component wise multiply maybe correct.
for example:

conbinedScale = dosomechain(scale1 scale2);

matrix = buildMatrixScale(combinedScale)

hplus0603
hplus0603
If the scale is along the same major axes (i e, no intermediate rotation), then you can just multiply each value in the matrix together. That's the same as multiplying the matrices themselves, because scale only lives along the main diagonal, and keeps 1 in the lower-right element.
enum Bool { True, False, FileNotFound };
luasitdown
luasitdown
Quote:
Original post by hplus0603
If the scale is along the same major axes (i e, no intermediate rotation), then you can just multiply each value in the matrix together. That's the same as multiplying the matrices themselves, because scale only lives along the main diagonal, and keeps 1 in the lower-right element.


I mean in scale vector. for instance

vector3 scale1;
vector3 scale2;
vector3 Cscale;

Cscale.x = scale1.x * scale2.x;
Cscale.y = scale1.y * scale2.y;
Cscale.z = scale1.z * scale2.z;

I mean not use matrix.

Are there vector component wise multiply operator??
I find vector just has dot product , cross product.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.