Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 15 Feb 2005
Offline Last Active Dec 13 2013 04:22 AM

Topics I've Started

Arc calculation

10 December 2013 - 06:33 AM

I'd like a user to be able to bend a line by dragging the end. The line will be an arc when bent. The length of the arc (L) needs to stay constant. The other end of the line, not being dragged, is at known point P1 and angle a1, which shouldn't change when the other end P2 is being dragged. The way I want it to work is that the angle at P2 (a2) should be such that that end of the line points towards the cursor when being dragged (Pc). The difficulty is that I can't work out P2 without knowing a2 and and I can't a2 without knowing P2. I have an expression where the only unknown is the radius r of the arc, but can't solve for it because of the complexity. I want to try to avoid numerical solutions. Has anyone done anything like this before? Is it possible to solve for r?



Arc line calculation

09 April 2013 - 10:20 AM

I'd like to make it possible for a user to drag the end of a line so that it bends in 2D. The line will be an arc when bent (section of a circle). The start point of the line will be fixed in terms of its position and angle/direction. The length of the line/arc will also remain constant. The angle/direction at the end of the line will point to some point P (the cursor position).

That should be enough to define the arc fully. However, it seems non-trivial to work out the parameters of the arc. This is because to work out the position of the end of the arc requires knowledge of the radius or angle at the end of the line and visa-versa. If I could just work out the radius the rest is easy.


Here are some relations:

angle at end = angle at start + length/radius

circle centre is perpendicular to start direction at distance radius from start position

circle centre is perpendicular to end direction at distance radius from end position

end direction is vector from end position to point P.


I need an equation for radius in terms of the arc start position, direction, arc length and point P. Putting the equations into Maxima to find a closed form solution using 'solve' didn't seem to come up with anything.

Alpha-numeric character coordinates

09 May 2012 - 09:04 AM

I'm looking for 2D coordinates for alpha-numeric characters made from simple polylines in a basic font. I'm most interested in the number characters. I could make them myself but thought that some data like this must already be available somewhere. Does anyone know where I can find this?

Slow software renderer blitting

10 June 2008 - 02:29 AM

I have written a software rasterizer (a 3D software renderer). I rasterize to an off-screen bitmap by writing to the bitmap scanlines and then blit the bitmap to the screen. The problem is that the blitting is slow because I have to set the pixel format of the bitmap to a 32 bit DIB in order to write to the scanlines - it then has to convert to the pixel format of the device (monitor) when blitting. If I set the bitmap pixel format to device dependant it will blit very quickly but then I can't write to the scanlines correctly - even if my screen colour depth settings are 32 bit. Is it possible to write to the scanlines of a device dependant bitmap without using hardware? The GDI routines in Windows are capable of doing this so how do they do it? Are they using hardware? Thanks Peter Bone

Sphere collision response

07 June 2008 - 03:07 AM

I'm looking for information on sphere collision detection and response. I only need to detect elastic collisions with flat surfaces and other spheres. Can anyone suggest a good physics engine that handle this or a good article on the subject? Regards, Peter