Sign in to follow this  
HiAliR

How can i draw a line?

Recommended Posts

How can i draw a line?
linelist and linestrip dose not contain width.
and ID3DXLINE is a differnt world. it will not be change when i move the camera, or effects dosen't work for it. and etc.
sorry for my bad english!

Share this post


Link to post
Share on other sites
Yeah, you are right. I was checking some of my old code where I remembered I used lines. There is no way to accomplish what you want using a primitive_line. If you want to draw lines of different sizes, you probably need to create four verts like this

D3DXVECTOR3 rect[4] = {

D3DXVECTOR3(-1.0f, 1.0f, 0,0f),
D3DXVECTOR3(1.0f, 1.0f, 0,0f),
D3DXVECTOR3(-1.0f, -1.0f, 0,0f),
D3DXVECTOR3(1.0f, -1.0f, 0,0f)
};

Then, make sure to scale it correctly so it represents a line (make it skinny) and then draw it where ever you need a line.

Share this post


Link to post
Share on other sites

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