   Draw a vector
  I got a quick one for you guys :)I'ld like to draw the vector of my mesh. Let's say that my mesh orientation is 0,0,0 and is looking down on the Y axis. I'ld like to draw a line following the direction of my mesh. If I rotate my mesh, the drawed line will follow the direction...and if I translate it as well.Sincerily, I don't have any ideas on how to do that...so I'm open to everything.I'm using MFC and DirectX 9.0c FYIThanks :)Guillaume   
  It's pretty simple. You create a line list with two vertexes -- (0,0,0) and (0,y,0), where y is the length of the line. You draw the line list (I suggest using DrawPrimitiveUP) using the same world matrix that you use to draw the mesh.   ;  Presumably you have a matrix to describe the transformation of the mesh you want to show the orientation of?You'll probably need to decompose it - a common trick in vertex shaders is to use the inverse transpose of the world matrix to correctly rotate/scale normal vectors. This has the advantage that it doesn't translate (translation has no meaning for direction vectors) the coordinates. You'd want to apply this transform to the *end* point of the line, leaving the *start* at the origin. Then manually translate *both* points by the same offset as the mesh.You can use D3DXVec3TransformCoord() to do the vector-matrix multiplication if you don't want to [smile]hthJack   ;Quote:Original post by JohnBoltonIt's pretty simple. You create a line list with two vertexes -- (0,0,0) and (0,y,0), where y is the length of the line. You draw the line list (I suggest using DrawPrimitiveUP) using the same world matrix that you use to draw the mesh.ok this one looks pretty easy and good but how do I create these line list and 2 vertexes? Sorry I'm a bit lost in here...   