12. 48.

If any 3 vertices chosen form a triangle that is not a right-angled triangle, then it is an equilateral triangle, and the sides of the equilateral triangles are all formed by the face diagonals. Each face diagonal serves as a side for 2 such equilateral triangles, so the number of equilateral triangles formed is $\frac{1}{3} \times 2 \times 12=8$. Therefore, the number of right-angled triangles is $\binom{8}{3}-8=48$.
From the 8 vertices of a cube, any two points are taken as the vertices of a triangle, among such triangles, there are $\qquad$ right-angled triangles.