Results 1 to 7 of 7
Thread: A compass
- 10-29-2008, 04:00 AM #1
Member
- Join Date
- Nov 2007
- Posts
- 19
- Rep Power
- 0
- 10-29-2008, 07:49 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Since you no need to move the arrow, use lines to build the array.
- 10-29-2008, 02:09 PM #3
Drawing the shaft of the arrow would be just a straight line from the center of the circle to the end point. Drawing the head of the arrow would require some computations that will have to be worked out.
Can you draw a circle?
Can you draw a line from the center of the circle to the end point?
Do these first then work on drawing the arrow head.
There are code examples for drawing on the forum. Use search.
- 10-30-2008, 05:13 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Actually it's not much difficult. Only thing need to identify is about the starting point and the end point of a line, and three lines only need.
- 10-30-2008, 01:55 PM #5
I think drawing the 2 lines that make the head of the arrow will be tricky. That would require some trig to get the angles right.
- 10-30-2008, 05:01 PM #6
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Actually it's not much difficult if you keep track with the coordination.
- 10-30-2008, 05:50 PM #7
Not too hard if your trig is good:
Say you have the arrow 100 pixels long pointing to the right.
Say the head is to be 10 pixels long.
Say the angle between the head parts and the shaft is 45 deg.
Go to the end of the arrow and measuse a 45 deg angle above the shaft and find the point 10 pixels away at that angle and draw a line from the end of the arrow to the above point.
Do the same for the angle below the shaft.
Voila you have an arrow with head.
Similar Threads
-
Compass 1.2 M1
By levent in forum Java SoftwareReplies: 0Last Post: 05-14-2007, 08:32 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks