Sign in to follow this  

help-- how to draw a triangle

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

This topic is 4353 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this