Original Post
Firstly i wanted to post this in announcments but i said this is dX specific so ill post it here. I have read a article at flipcode.com http://www.flipcode.com/articles/article_fastervectormath.shtml that says about making a faster vector math. I was curios so i have tried to see how fast is vector add operations (vector + vector). I created console project as shown D3DXVECTOR3 vec1(2.0f,4.0f,6.0f); D3DXVECTOR3 vec2(1.0f,3.0f,5.0f); //here goes various vector implementations D3DXVECTOR3 vec3(2.0f,4.0f,6.0f); Only reason vec3 is there is that when viewing disassembled code in debuger (i use VS 2003.net)there is mark what line beggins and i use vec3 only as a marker. I tried following functions and counting how many times i need to press stepinto button 1) vec1 = vec1 + vec2; This is the worst case i needed to press 213 times 2) vec1 += vec2; This nedded only ~87 presses 3) vec1.x = vec1.x + vec2.x vec1.y = vec1.y + vec2.y vec1.z = vec1.z + vec2.z This needed only 12 (twelve) times!!! 4) vec1.x += vec2.x vec1.y += vec2.y vec1.z += vec2.z This needed only 9 (nine) times!!! I think this is a very big offload from procesor if we us this last method. And for better solution review a mentioned article! What do you think?