I am using the mid-point circle algorithm (bresenham circle) to efficiently draw whole circles. Is there something similar to draw circle arcs? I would like to specify a start angle and end angle and have only that portion of the circle drawn.
Thanks in advance!
EDIT: I would like to draw filled circle arcs too, i.e pie-slices. :)
...
I am trying to make the game Asteroids. My issue I have right now, is if you press the UP Arrow key, it will move the "ship" 10 pixels up. And if you hit the LEFT Arrow key, it will turn the "ship" 5 degrees to the left, the issue I have comes into play when you turn left, or right. And then try to move up. It won't move into the turned ...
I've written an implementation of Bresenham's algorithm in Python (following the Wikipedia article), and it works correctly except for lines at certain angles. All lines that should extend between 45 and 90 degrees, or between 135 and 270 degrees, will instead extend along the line y = x.
Here's my code:
def bresenham(origin, dest):...
I'm looking for a fast algorithm to draw an outlined line. For this application, the outline only needs to be 1 pixel wide. It should be possible, whether by default or through an option, to make two lines connect together seemlessly, if they share a common point.
Excuse the ASCII art but this is probably the best way to demonstrate it....
I'm looking for one to build a MS-paint like app.
...
I'm writing a MS paint-like application (I'm not allowed to use opengl primitives). So far it only draws lines and points. I don't understand why when rendering a single point on click this code prints it where it should, based on the transformation on the renderPoint function:
void renderPoint(double x, double y)
{
W = glut...