About the design of the Wii Light gun positioning (turn)

Source: Internet
Author: User

Method 1: Simple 1 LEDs Method

This is a very tricky way to think of the LED as the center of the screen, the light gun camera Vision range as a screen range.

Assume that the data range of the WII gun head camera is [0,1024]*[0,768] and the display screen resolution is dx,dy. If the coordinate value obtained from the handle is x, y, the corresponding screen position is (x*dx/1024,y*dy/1024). The position of the LED is best placed in the middle of the screen, not bad on the edge. If the location of a given person and the size of the screen and other data, then you can get accurate play.

Method 2: It seems to be the official 2LED Method

Use 2 LEDs. The feeling is similar to the above method, because it is 2LED, so you can also more identify the direction of the gun rotation. The 2LED position is placed above or below the screen.

Reference:

Wiki-wiimote/pointing

---http://www.wiibrew.org/wiki/Wiimote/Pointing

A Better Wiimote Pointer

----http://blog.dawnofthegeeks.com/?p=496

Accuracy improvements for both of the above methods

http://www.davidhawley.co.uk/ Wiisensorbar.aspx's article "led

Method 3: My exact method

hypothesis 1: 2( 3) LEDs are in the same plane as the screen, making the plane an x -y plane.

hypothesis 2 : gun use is always balanced. (If this is not assumed, you can add more LEDs or use the data of the accelerometer built into the gun, but the accuracy of the accelerometer is uncertain)

Then there are 2 problems to solve :

question 1 , If the point of the gun is (x, Y, z) and the direction is (n,m,p), then through the equation of the line and the plane equation z=0 can be obtained by the shot in X-y The position on the plane.

How to askX,y,z,n,m,pThis6A value? Some values can be fixed directly, such as the direction regardless of size can makep=1 (n,m,p) and a,bpa,b a led obtained by the gun-head camera x,yledx,y to the direction of the gun and the gun axis direction offset angle. Thus, with p and Point (x, y, z) can get a led coordinate values (this is known), then two equations.

question 2 , the x-y coordinate values of the four corners are obtained by starting a single shot at the four corners of the screen, and by obtaining the resolution of the screen, the x-y coordinate values can then be converted to the screen resolution value by mapping. How to convert, without thinking, it should be quite simple.

The current problem is: there is a direction vector (n,m,p), given a, b , How to find a new direction vector p?

in order to explain under A, B, What is, look at the new coordinate system below.

ab words. Convenient point, the left arrow axis is x ' The UP Arrow is y ' z '    so vector p z ' Y ' projection and z ' on projection with z ' b

Cond...

Special Acknowledgement:

In fact , 1LED method is not chasing the name of the moon is a long fire cloud first put forward and I see the 2LED method in the back of the decision to use, although there are obvious flaws in theory, but the actual effect is good. In addition, he also put forward a very bluff theory is not yet know how to solve the 2LED method, here is skipped.

Very grateful to Ronaldinho classmate in this problem spent a lot of time and at the end to point out to me that this problem is not so easy to solve, so I think next time can try the numerical method to solve.

About the design of the Wii Light gun positioning (turn)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.