Thanks, this is basically what I was looking for.I have changed the app orientation to Landscape, and I have added the camera to capture background image, but the image doesnt keep its perspective (is stretched when applied as canvas background. Cannot get a setting to keep aspect ratio?
Secondly is there a way to edit(Move) the sprites once its placed if misaligned?
You will have to set the canvas to the aspect ratio of the image to avoid stretching/squeezing, there are extensions available to get the height/width of an image which you can use. Alternatively you could use an ImageSprite suitably placed and sized to load the image.
Sprites ? If you mean the circles (dots) and lines, then with this method, no to moving them or realigning. Once drawn, that is it, just reset and set again (it is admittedly easier with a mouse on the emulator than with a fat finger on a screen. With (a lot) more code you could use buttons to nudge a dot to the correct place, before confirming its position. Someone else may have a better approach....)
Or use the touch down / up events to position finger before setting the dot....
Thanks, and if for example have a preset of red dots and lines already placed (for example in the shape of a bicycle frame) the goal is to move the sprites to match the bicycle frame and indicate the angles? Can I for example use Balls, with lines connected?
Awesome thanks, I've made good progress. Really appreciate the help.
Is there a way to zoom in on the canvas to make more precise adjustments to the ball positions?
I haven't thought through the trigonometry on this, but at first glance it is necessary for your code to take into account the (x,y) values of three Balls:
Thanks for the feedback - I missed that. I have added the calculation for BC now, still no luck.
I see in your example you have used a list to get theX,Y points. In my example I tried to get them directly from the balls. Maybe its the issue here?
Assuming the cyclist doesn't scratch his nose or break his elbow,
the angle of his elbow B is going to be obtuse, the sum of 2 acute angles + 90 degrees.
This construction shows the two acute angles:
Ok, Ive used formulas to calculate the angle of each segment, and then another formula to calculate the angle between the lines. Working fine, but the moment the angle go over 90 degrees, it shows wrong, For example it works fine from 180 degrees down to 90, but the moment I go less than 90, for example 60 deg, it shows 240.
Again, back in my first example, it output all three angles. Somehow, one has to figure out which angle is the correct one to apply, given it all depends on which way around you draw the lines, perhaps a user choice ?