|
成本初步估计不超过280元,使用效果很好!
头上面可以顶wiimote,也可以顶led,
硬件:wii-remote(wiimote)、蓝牙适配器、LED
软件:GlovePIE、蓝牙驱动、wiinRemote
有必要说一下GlovePIE,这个东西很多功能,模仿TrackIR只是其中的一种功能而已,有兴趣的读一下附件中的documentation.rar;
附上经过我优化的的一段模仿TrackIR(2轴)的代码(非我原创),还有LOFC的.trk文件,感兴趣的可以看看效果,反正我用着挺爽的!!
至于它和freetrack的比较,我不好说,因为过一开始用过freetrack,无奈一运行就死机,后来放弃了,所以我也说不清楚哪个效果好一些,但是可以肯定的是,freetrack用可见光波段的我是不喜欢的!用红外波段的我觉得价钱也不便宜,还不如wiimote功能多样化呢!
wiimote经过glovePIE的环境几乎能实现所有在Wii游戏机中的功能!!!
什么电光枪啦、光剑、棒球、鼠标控制,赛车方向盘之类的,而且通过led阵列和红外感应器,还有数据手套能!!
另外还有一些有意思的小制作,什么led pen之类的,,,6轴trackIR的基本功能已经被实现了(freetrack的用户甚至不用改动已经制作好的led架子,不过led还是要更换成940的红外led),但是我用了一下,不知道是我的led支架做得不好,还是编程不是很成熟,效果不是很满意。
我现在用的是自己优化的2轴FacktrackIR代码(拷贝到glovePIE中,点击"Run"):
/*
This was Modified based on " ipoXYZ's 2Dof, 2Leds, Flight- and RaceScript."
Modifications:
1. "smooth()" was added;
2. Freeze Yaw& itch was added;
3. var.Angle is initialized by 1000 instead of 200;
Keys:
F9 = Less Sensitive
F10 = More Sensitive
F11 = Set CenterView
q = Freeze Aspect
Compatible with these games:
http://www.naturalpoint.com/trackir/03-enhanced-games/enhanced-games-all.html
Emulates Yaw/Pitch
Setup:
Place your Wiimote near your monitor facing your head.
Wear two IR-leds on your head facing the Wiimote.
The leds can be attached to glasses, headphones, caps or something else.
*/
if starting then
wait 200 ms
PIE.FrameRate = 120Hz
if Wiimote.dot2vis = true then
var.XOffset = (Wiimote.Dot1x + Wiimote.Dot2x) / 2
var.YOffset = (Wiimote.Dot1y + Wiimote.Dot2y) / 2
else
var.XOffset = Wiimote.Dot1x
var.YOffset = Wiimote.Dot1y
endif
var.Angle = 1200
endif
//Sensitivity
if pressed(F9) and var.Angle < 1200 then
var.Angle = var.Angle + 50
say (var.Angle)
else
var.Angle = var.Angle
endif
if pressed(F10) and var.Angle > 50 then
var.Angle = var.Angle - 50
say (var.Angle)
else
var.Angle = var.Angle
endif
//Maprange
var.MinIRX = var.XOffset - var.Angle
var.MaxIRX = var.XOffset + var.Angle
var.MinIRY = var.YOffset - var.Angle
var.MaxIRY = var.YOffset + var.Angle
//Center View
if pressed(F11) then
if Wiimote.dot2vis = true then
var.XOffset = (Wiimote.Dot1x + Wiimote.Dot2x) / 2
var.YOffset = (Wiimote.Dot1y + Wiimote.Dot2y) / 2
else
var.XOffset = Wiimote.Dot1x - var.TempX
var.YOffset = Wiimote.Dot1y - var.TempY
endif
say "CV"
endif
//Freeze the Yaw& itch position of TrackIR when "q" is pressed
if q then //if Joystick1.button14 then
else
//Mapset
if Wiimote.dot2vis = true then
var.TempDot2x = Wiimote.Dot2x
var.TempDot1x = Wiimote.Dot1x
var.TempDot2y = Wiimote.Dot2y
var.TempDot1y = Wiimote.Dot1y
var.X = (Wiimote.Dot1x + Wiimote.Dot2x) / 2
var.Y = (Wiimote.Dot1y + Wiimote.Dot2y) / 2
if var.TempDot1x < var.TempDot2x then
var.TempX = (Wiimote.Dot2x - Wiimote.Dot1x) / 2
else
var.TempX = (Wiimote.Dot1x - Wiimote.Dot2x) / 2
endif
if var.TempDot1y < var.TempDot2y then
var.TempY = (Wiimote.Dot2y - Wiimote.Dot1y) / 2
else
var.TempY = (Wiimote.Dot1y - Wiimote.Dot2y) / 2
endif
else
if var.TempDot1x < var.TempDot2x then
var.X = Wiimote.Dot1x + var.TempX
else
var.X = Wiimote.Dot1x - var.TempX
endif
if var.TempDot1y < var.TempDot2y then
var.Y = Wiimote.Dot1y + var.TempY
else
var.Y = Wiimote.Dot1y - var.TempY
endif
endif
//smoothing
var.TrackIRYawOld = var.FakeTrackIRYaw
var.TrackIRPitchOld = var.FakeTrackIRPitch
var.FakeTrackIRYaw = ensureMapRange(var.X, var.MaxIRX, var.MinIRX , -360, 360)
var.FakeTrackIRPitch = ensureMapRange(var.Y, var.MinIRY, var.MaxIRY , -360, 360)
var.DiffX = max(var.TrackIRYawOld,var.FakeTrackIRYaw) - min(var.TrackIRYawOld,var.FakeTrackIRYaw)
if var.DiffX < 10 then
FakeTrackIR.Yaw = smooth(var.FakeTrackIRYaw,30)
//FakeTrackIR.Yaw = kalman(smooth(var.FakeTrackIRYaw,30),0.4,0.04)
//FakeTrackIR.Yaw = smooth(kalman(var.FakeTrackIRYaw,0.4,0.03),30)
endif
var.DiffY = max(var.TrackIRPitchOld,var.FakeTrackIRPitch) - min(var.TrackIRPitchOld,var.FakeTrackIRPitch)
if var.DiffY < 10 then
FakeTrackIR.Pitch = smooth(var.FakeTrackIRPitch,30)
//FakeTrackIR.Pitch = kalman(smooth(var.FakeTrackIRPitch,30),0.4,0.04)
//FakeTrackIR.Pitch = smooth(kalman(var.FakeTrackIRPitch,0.4,0.03),30)
endif
endif //endif for "//Freeze the Yaw& itch position when "q" is pressed"
//FakeTrackIR.z = random() * 100
//Microphone.Enabled = joystick1.Button1
//Backslash = said("team",2) //The higher the number, the more confidence is required to recognise it.
//F1 = said("?",2)
//if Microphone.HeardNoise then say("I can't hear you over the noise.")
//if Microphone.TooFast then say("Don't talk so fast.")
//if Microphone.TooSlow then say("You need to talk faster.")
//if Microphone.TooLoud then say("Stop shouting. I'm not deaf.")
//if Microphone.TooQuiet then say("Speak up, I can't hear you.")
debug = ' Battery=' + Wiimote.Battery + ' Yaw=' + FakeTrackIR.Yaw + ' Pitch=' + FakeTrackIR.Pitch
感兴趣glovePIE编程的,可以到http://www.wiili.org/forum/
也欢迎来继续完善trackIR的代码!!!
[ 本帖最后由 Akar 于 2008-9-13 20:12 编辑 ] |
ini, lock, 视频, FTP, lock, 驾驶仓, TAG, FTP, 怎么没了FLASH连接, СС, 1111, 图片, HUD, 编队, SPY, 飞行模拟, ILS, LOFC, lock, 彩虹六号, 提醒, 晕啊, WOE, 707, FSX, lock, 错了, lock, 补丁, insky, FPS,
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即加入
x
|