Could it be to do with the function I am using to get the right rotation matrix?
No, it could not. Rotation matrices are not triangle-selective.
Neither are depth-buffer issues.
The only possible issues are:
* Triangle winding.
* Misaligned (corrupted) index buffers (if using index buffers).
* Corrupted vertex buffers.
* Misuse of vertex buffers (telling Direct3D that it is a triangle strip when it is in fact a triangle list, etc.)
If it takes multiple render calls to draw the object then there is also:
* Mismatched materials or invalid materials (resulting in blackness) assigned to triangles. This seems least likely.
Each of these is quite easy to test one-by-one.
If culling is disabled and it persists, then it is not a winding issue.
Testing if it is related to materials is trivial—make your shader return a hard-coded color that gradates with depth (if the whole object is a single color you won’t be able to tell if anything is missing, obviously) and a hard-coded alpha value of 1.
I only mention these first because they are so trivial to test, but it is likely to be related directly to the vertex buffers themselves. Either the vertices themselves are corrupted or they are being misrepresented to Direct3D via a bad index buffer or wrong flags on the render call.
I found out that when I try and[sic] import the model into Blender there is a similar problem with black missing triangles. Why would this be?
Why not explain to what format you exported in the first place? Is this your custom exporter and importer? If so then this is not useful information. If it is being exported and re-imported from a file format such as .FBX, it means the exporter itself is corrupting the vertex data.
Either way, all signs point to the vertex buffer.
Use PIX and verify the data being sent to Direct3D.
It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums