Preparation by direct nitridation of titanium, zirconium or hafnium