I moved to a new URL! Check it out!

Dev Log: Drawing Lines

Dev Log: Drawing Lines
My to do list continues to grow shorter with my framework! Today I finished getting my draw line utility functions working. Check out these beautiful lines.

Image


Being able to draw things like rectangles, circles, and lines on the fly can be really useful for prototyping, debugging, and even effects for a game. The regular old line drawing using OpenGL results in just a one pixel thick line from point A to B, and that's no good for most cases.

For the red line I'm converting the line into a quad using some vector magic that doesn't really make sense to me yet but it works. The ends of the lines are hard edges, as it's just a quad. But the blue line is where the true magic happens. It's a line with rounded ends, WHOA! It took me awhile to figure out, but I'm drawing it using similar logic to the red line but adding a bunch of points to go around the outside of each end point of the line. It's using a TriangleFan to draw, whatever that means.

I've also been spending time attempting to document things in the code to prepare for a public "beta" release of the framework. It's coming very soon!
new comment!

Post your comment!

Name
Email
Comment