]]>ok sorry , so it should be 180 radians,Angle says 0.761013, should it not be 180 float

Christ. At least TRY to read my post. NO NOT 180 RADIANS, IF YOU SAY 180 YOU MEAN

DEGREES. BUT 180DEGREESIS THE SAME AS 3.1415RADIANS.But indeed, I haven't looked at the actual coordinates at first, but the angle seems correct to me (0.761013 radians equals roughly 43.6 degrees). Just flipping a vector about the y-axis doesn't mean it's rotated 180 degrees. I get the feeling you're actually thinking in 2D, while your vectors are in 3D.

]]>I have no idea.

]]>LOL. Maybe you should try actually READING the messages people write to you. Look at this: http://www.math.rice.edu/\~pcmi/sphere/drg_txt.html. Degrees are the ones that go from 0 to 360. Radians are the ones that go from 0 to 2*pi.

]]>ok sorry , so it should be 180 radians,Angle says 0.761013, should it not be 180 float

]]>Thank you so much i will try that now , yeh it was a typo saying 180 , i did mean 90 :wacko:

But did you get the radians/degrees mixup as well?

float Angle = acos(Dot); //should be 90

No, that should be pi/2, as we're talking radians, not degrees. I get the feeling you have your definitions of radians and degrees reversed.

]]>Thank you so much i will try that now , yeh it was a typo saying 180 , i did mean 90

so i try this, dosen't look like its done what i want

Angle says 0.761013`D3DXVECTOR3 TeaPot1Pos(0.0f,2.0f,-5.0f); D3DXVECTOR3 TeaPot2Pos(0.0f,-2.0f,-5.0f); D3DXVec3Normalize (&TeaPot1Pos,&TeaPot1Pos); D3DXVec3Normalize (&TeaPot2Pos,&TeaPot2Pos); float Dot = D3DXVec3Dot(&TeaPot1Pos,&TeaPot2Pos); float Angle = acos(Dot); //should be 90 D3DXMATRIX TeaPot1Matrix; D3DXMatrixTranslation(&TeaPot1Matrix,TeaPot1Pos.x,TeaPot1Pos.y,TeaPot1Pos.z); D3DXMATRIX TeaPot1Rot; D3DXMatrixRotationZ(&TeaPot1Rot,Angle); d3ddev->SetTransform(D3DTS_WORLD,&(TeaPot1Rot * TeaPot1Matrix)); meshTeapot->DrawSubset(0); D3DXMATRIX TeaPot2Matrix; D3DXMatrixTranslation(&TeaPot2Matrix,TeaPot2Pos.x,TeaPot2Pos.y,TeaPot2Pos.z); d3ddev->SetTransform(D3DTS_WORLD,&TeaPot2Matrix); meshTeapot2->DrawSubset(0);`

]]>Also the dot product doesn't return degrees or radians. To get an angle out of it, first you have to normalize the two vectors you're dotting. Then the dot product is the cosine of the angle between them. Call acos() and you've got the angle in radians.

]]>First of all, the angle in your picture is 90 degrees, not 180 radians. There are only 2pi radians in a circle, so 180 radians doesn't make sense. Secondly, forget degrees, start thinking in radians. Everything in math programming is always in radians.

]]>I understand i need to get the Dotproduct of the 2 vectors and then set the rotationz for the bottom teapot so it looks up at the other above it ,do you have to convert the DotProduct to radians as its in degrea's?

vectors are

D3DXVECTOR3 TeaPotPos(0.0f,-3.0f,-10.0f);

D3DXVECTOR3 TeaPotPos2(0.0f,3.0f,-10.0f);pic included

http://img709.imageshack.us/img709/1994/helpk.jpg

Thanks for reading