Jump to content
  • Advertisement
Sign in to follow this  
wexuv

help-- how to draw a triangle

This topic is 4692 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

CUSTOMVERTEX cvVertices[] = { {(float)ptA.x, (float)ptA.y, 1.0f, color,0.0f, 0.0f,}, {(float)ptB.x, (float)ptB.y, 1.0f, color,0.0f, 0.0f,}, {(float)ptC.x, (float)ptC.y, 1.0f, color, 0.0f, 0.0f,}, }; m_pD3DDevice->SetVertexShader( D3DFVF_CUSTOMVERTEX ); m_pD3DDevice->DrawPrimitiveUP( D3DPT_TRIANGLESTRIP, 1, cvVertices, sizeof(CUSTOMVERTEX) ); why i only see a line not a triangle? i have to write code like this to draw a triangle. CUSTOMVERTEX cvVertices[] = { {(float)ptA.x, (float)ptA.y, 1.0f, color,0.0f, 0.0f,}, {(float)ptB.x, (float)ptB.y, 1.0f, color, 0.0f, 0.0f,}, {(float)ptC.x, (float)ptC.y, 1.0f, color, 0.0f, 0.0f,}, {(float)ptA.x, (float)ptA.y, 1.0f, color, 0.0f, 0.0f,}, }; m_pD3DDevice->SetVertexShader( D3DFVF_CUSTOMVERTEX ); m_pD3DDevice->DrawPrimitiveUP( D3DPT_TRIANGLESTRIP, 2, cvVertices, sizeof(CUSTOMVERTEX) ); is there anything wrong? hope you understood my questtion and help me. thanks. [Edited by - wexuv on January 10, 2006 1:24:13 AM]

Share this post


Link to post
Share on other sites
Advertisement
Dear sir, take more word than "help" to describe what kind of "help" you need in the subject. then you will save people's time to know if they can help you work it out without click the "help" and wait for a while.

Forgive the time difference. while you post something, half of people in the earth
maybe in dream.

Welcome to gamedev.net!

Share this post


Link to post
Share on other sites
CUSTOMVERTEX cvVertices[] =
{
{(float)ptA.x, (float)ptA.y, 1.0f, color,0.0f, 0.0f,},
{(float)ptB.x, (float)ptB.y, 1.0f, color,0.0f, 0.0f,},
{(float)ptC.x, (float)ptC.y, 1.0f, color, 0.0f, 0.0f,},
};
m_pD3DDevice->SetVertexShader( D3DFVF_CUSTOMVERTEX );
m_pD3DDevice->DrawPrimitiveUP( D3DPT_TRIANGLELIST, 1, cvVertices,
sizeof(CUSTOMVERTEX) );

like above? but nothing appears... :(


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!