/ Published in: Other
Works out the distance between two objects in 3D space, you'll need the Vertex3D struct also in my snipppets
- static inline GLfloat Vertex3DCalculateDistanceBetweenVertices (Vertex3D first, Vertex3D second)
- GLfloat deltaX = second.x - first.x;
- GLfloat deltaY = second.y - first.y;
- GLfloat deltaZ = second.z - first.z;
- return sqrtf(deltaX*deltaX + deltaY*deltaY + deltaZ*deltaZ );
You need to login to post a comment.