# Need some help with Matrix4.lookAt in combination with makeScale

I have three scale values for x , y, and z axis…
I want to rotate and combine these into one vector, but I’m not getting the results I expect.

at first I tried to add each vector and their scale together into one vector, but it didn’t produce the correct results.

``````var vectorX = tilt.right.clone().multiplyScalar(x);
var vectorY = tilt.up.clone().multiplyScalar(y);
var vectorZ = tilt.backward.clone().multiplyScalar(z);
``````

So then I decided I would try to use a matrix4…

``````var mt = new THREE.Matrix4();
mt.makeScale( x, y, z );

var mt2 = new THREE.Matrix4();
mt2.lookAt( new THREE.Vector3(0,0,0), tilt.backward, tilt.up );

mt.multiply(mt2);

vector.setFromMatrixScale(mt);
``````

but it still doesn’t produce the correct results…
I’m trying to basically scale/resize along a rotated axis.
Can anyone give me some clues as to what I am doing wrong?

no… I’m not trying to change the scale. I’m cycling through vertices and adjusting their position (I need to do it this way).
I found a way to accomplish it, but if anyone knows how to simplify it, I’d like to know…
Here is what I have:

``````projectedVert.copy(vertPos);
projectedVert.sub( resizeOrigin.position);
projectedVert.projectOnVector( tilt.right );
projectedVert2.copy(projectedVert);
projectedVert.multiplyScalar( x );
projectedVert.sub(projectedVert2);

projectedVert.copy(vertPos);
projectedVert.sub( resizeOrigin.position);
projectedVert.projectOnVector( tilt.up );
projectedVert2.copy(projectedVert);
projectedVert.multiplyScalar( y );
projectedVert.sub(projectedVert2);