Drawing Hexagon Using Java error

You were drawing on the JFrame. Never draw on a JFrame. Always draw on a JPanel. Here’s the GUI. Here are the major changes I made. I moved the creation of the hexagon into its own class, Hexagon. That way, you can create a List of Hexagons if you want. I moved the creation of … Read more

Calculating the angle between the line defined by two points

Assumptions: x is the horizontal axis, and increases when moving from left to right. y is the vertical axis, and increases from bottom to top. (touch_x, touch_y) is the point selected by the user. (center_x, center_y) is the point at the center of the screen. theta is measured counter-clockwise from the +x axis. Then: Edit: you mentioned in a comment that y increases from top to bottom. … Read more

Graphics Library for C++

Having learned the basics of OpenGL in a 10 week university course that was primarily focused on modeling statistical data, I would definitely think OpenGL would be a reasonable option for an easy to learn graphics package for 2D real time modeling. Although there’s certainly complexity available to OpenGL you don’t need to wrap your … Read more