Jump to content
  • Advertisement
Sign in to follow this  
pbergeron

Colored Lines

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

I build a vertex buffer as follows:
            vbDir = new VertexBuffer(typeof(CustomVertex.PositionColored), 2, scene.Device, 0, CustomVertex.PositionColored.Format, Pool.Default);
            GraphicsStream stm = vbDir.Lock(0, 0, 0);
            CustomVertex.PositionColored[] verts = new CustomVertex.PositionColored[2];

            verts[0].X = vPos.X; verts[0].Y = vPos.Y + 0.1f; verts[0].Z = vPos.Z; verts[0].Color = System.Drawing.Color.Red.ToArgb();
            verts[1].X = vLookAt.X; verts[1].Y = vLookAt.Y + 0.1f; verts[1].Z = vLookAt.Z; verts[1].Color = System.Drawing.Color.Red.ToArgb();

            stm.Write(verts);
            vbDir.Unlock();

but when I render the line that it creates, the line is black. As you can see, I specified red ... what am I missing? Thanks

Share this post


Link to post
Share on other sites
Advertisement
I apologize. I realize that I have lighting enabled and that I would need to specify normal information in order for the coloring to work correctly.

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!