Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hello,

I'm doing a project (curling with Lego Mindstorms) and I already got the webcam working (this webcam detects color and traces objects). But now I'm stuck. I want to make a scoring system with visual studio but I don't know how to start. I want to give points to a object(puck) and if the puck is closer to the inner circle then it will get more points. So the closer you are, how higher your score will be.

Can maybe somebody tell me wich objects I should use and maybe tell some tips or something.

I only started working with c# 6 weeks so I'm still a noob to this

thank you for reading!
Posted

1 solution

You will be processing images, so here you go:


1. Get the screen coordinate of the center of the inner circle
(xc,yc)
2. Get the screen coordinate of your puck (xp,yp)
3. Compute the distance between the two of them: sqrt[(xp-xc)2+(yp-yc)2]
4. Apply points proportionnaly to this distance.
 
Share this answer
 
Comments
Member 10697712 25-Mar-14 14:30pm    
Thank you very much!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900