Jump to content
  • Advertisement
Sign in to follow this  
ponei

Rendering Trouble

This topic is 3089 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello everyone, i'm new to DirectX and i'm having a damn problem! When I fill the vertex buffer with these vertices the triangle isn't rendered:
    VERTEX vertices[] =  
    {  
        {D3DXVECTOR3( 0.5f, -0.5f, 0.0f )},  
        {D3DXVECTOR3( 0.0f, 0.5f, 0.0f )},  
        {D3DXVECTOR3( -0.5f, -0.5f, 0.0f )},  
    };
BUT when i change the order of the vertices the triangle is rendered!
    VERTEX vertices[] = 
    { 
        {D3DXVECTOR3( 0.0f, 0.5f, 0.0f )}, 
        {D3DXVECTOR3( 0.5f, -0.5f, 0.0f )}, 
        {D3DXVECTOR3( -0.5f, -0.5f, 0.0f )}, 
    };
Is there any order to add the vertices to the vertex buffer? This is pretty wierd! Thanks in advance. []'s

Share this post


Link to post
Share on other sites
Advertisement
By default directx uses clockwise winding ordering (D3DRS_CULLMODE = CCW) which means the back face of triangle is culled away. If you want to use counter-clockwise ordering you have to set D3DRS_CULLMODE render state to CW.

Share this post


Link to post
Share on other sites
Thank you SIIYA. The problem was exactly what you've said. Much thanks.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!