Jump to content
Posted 20 August 2012 - 03:35 PM
Posted 20 August 2012 - 05:32 PM
Posted 21 August 2012 - 01:09 AM
Hey thanks for the quick response.
You'd have to generate a vertex buffer for your mesh that has n-faces (or n-polys) * 2. Then you'll calculate the middle point for each face, (or poly), and project another point by the normal of each face, (do a cross product from the vectors of one vert to the others, then average them for each poly). Scale that point by how long you want the normal to be. Then just draw that vertex buffer after your mesh using the line list topology.
Posted 21 August 2012 - 01:24 PM
Posted 21 August 2012 - 01:52 PM
Ah sorry, I didn't understand the question very well, haha.
Generally you'd pass the normal per vertex in your input layout. If you only have access to the face normals, then you'd want the average normal of all faces that the vertex is apart of.
Edited by french_hustler, 21 August 2012 - 01:55 PM.
Posted 21 August 2012 - 07:21 PM
Edited by MJP, 21 August 2012 - 07:22 PM.