hello!!!
where to start....
well I am writing a simple program to load X files, In the program i have setup several functions for camera movement...
now based on the users input, i have setup these functions to adjust the camera source/target accordingly through the D3DXMatrixLookAtLH function, then pass the D3DXMATRIX through the g_pD3D->SetTransform(D3DTS_VIEW, &matView);
now my prob is when i pass the D3DXVERTEX3 variable as the source in the D3DXMatrixLookAtLH function, being the second parameter, it tells me that it is expecting a constant expression instead of a literal expresion.
also with the error it says that no user defined operator is given to make the conversion, or operator cannot be called.
sorry for the sparactic thought, i haven't sleep in what feels like days!
anyway here is the code snipplet:
enjoy....
Code:
void vSetupView()
{
D3DXMATRIX m;
D3DXMATRIX matView;
D3DXMATRIX matRotate;
D3DXMATRIX matProj;
D3DXVECTOR3 matSource;
D3DXVECTOR3 matTarget;
D3DXMatrixRotationX(&m, xRotation);
matRotate = matRotate * m;
D3DXMatrixRotationY(&m, yRotation);
matRotate = matRotate * m;
D3DXMatrixRotationZ(&m, xRotation);
matRotate = matRotate * m;
//set zoom and height strafe
matSource.x = xAdjust;
matSource.y = yAdjust;
matSource.z = -30.0f;
matTarget.x = xAdjust;
matTarget.y = yAdjust;
matTarget.z = 0.0f;
matSource.x = matSource.x + (Zoom * (matTarget.x - matSource.x));
matSource.y = matSource.y + (Zoom * (matTarget.y - matSource.y));
matSource.z = matSource.z + (Zoom * (matTarget.z - matSource.z));
matTarget.x = matTarget.x + (Zoom * (matTarget.x - matSource.x));
matTarget.y = matTarget.y + (Zoom * (matTarget.y - matSource.y));
matTarget.z = matTarget.z + (Zoom * (matTarget.z - matSource.z));
D3DXMatrixLookAtLH( &matView, matSource,
matTarget,
D3DXVECTOR3(0.0f, 1.0f, 0.0f);
matView = matView * matRotate;
D3DXMatrixPerspectiveFovLH (&matProj, D3DX_PI/4, 1.0f, 1.0f, 500.0f);
g_pD3DDevice->SetTransform
(D3DTS_VIEW, &matView);
g_pD3DDevice->SetTransform
(D3DTS_PROJECTION, &matProj);
}
that is it...
well any help is appreciated, i know it is something simple and i am not thinking right now, thanks frog22
We'd enjoy it more if it had code tags. Hammer