Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualTom KQT

Posted 09 September 2013 - 12:44 AM

1. That seems like wrong winding order. The default culling mode is D3DCULL_CCW, which means that Direct3D takes triangles with counter-clockwise winding order (the order of verticles) as front facing and renders them. Your verticles are ordered in the other way. To render them you don't have to set D3DCULL_NONE, you can either set D3DCULL_CW or swap any two verticles in each triangle.

2. Not directly, because all your texture coordinates (u, v) are zero at this moment. Your verticles are ready for it, you just have to fill proper values. The proper values of (u, v) for the verticles in each quad are: topLeft - topRight - bottomLeft - bottomRight  (0, 0) - (1, 0) - (0, 1) - (1, 1)

3. This is a right way, but you also can use index buffers. In your case you need 6 verticles for each quad, while 2 are doubled. With indices, you would need just 4 vertices for each quad, plus 6 indices. Try to find something about index buffers in the documentation.


#1Tom KQT

Posted 09 September 2013 - 12:43 AM

1. That seems like wrong winding order. The default culling mode is D3DCULL_CCW, which means that Direct3D takes triangles with counter-clockwise winding order (the order of verticles) as front facing and renders them. Your verticles are ordered in the other way. To render them you don't have to set D3DCULL_NONE, you can either set D3DCULL_CW or swap any two verticles in each triangle.

2. Not directly, because all your texture coordinates (u, v) are zero at this moment. Your verticles are ready for it, you just have to fill proper values. The proper values of (u, v) for the verticles in each quad are: topLeft - topRight - bottomLeft - bottomRight  (0, 0) - (1, 0) - (0, 1) - (1, 1)

3. This is a right way, but you also can use index buffers. In your case you need 6 verticles for each quad, while 2 are doubled. With indices, you would need just 4 vertices for each quad, plus 6 indices. Try to find something about index buffers in the documentation.


PARTNERS