The NEW Build Your Own Arcade Controls

Main => Lightguns => Topic started by: ryoken on May 10, 2019, 07:08:24 pm

Title: Diy Laser Light Gun.
Post by: ryoken on May 10, 2019, 07:08:24 pm
Hi  finally get this working and i make a quick test to show everyone the response time and precision i get out of a ps3 camera
I'm get extremely good results on a projector as a monitor.  Still i need too make more testing on a normal monitor and tv screens.
https://youtu.be/g7-hMvh8Ey0
https://youtu.be/-X4uJa74zto
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 10, 2019, 09:41:35 pm
Looks really good man, but can you give us some details?
Title: Re: Diy Laser Light Gun.
Post by: nugarp on May 11, 2019, 02:58:57 am
+1 on Howard's request. I would love to see how you did it!
Title: Re: Diy Laser Light Gun.
Post by: SammyWI on May 11, 2019, 08:50:57 am
Very cool.  Interested in more details myself.  I have a similar projector setup and several laser guns setup to use like this.  I'm using:

https://www.reddit.com/r/ShootOFF/comments/ahjz6n/shot_detection_to_mouse_click_alternative/ (https://www.reddit.com/r/ShootOFF/comments/ahjz6n/shot_detection_to_mouse_click_alternative/) Works well but still could use improvement.
http://shootoffapp.com/ (http://shootoffapp.com/) Works well within it's own program.  Shot to Click mode for external programs works so - so.
http://uweschmidt.org/projects/wiimote-whiteboard (http://uweschmidt.org/projects/wiimote-whiteboard)  Works fairly well but needs an IR laser gun.

Problem for gaming with any of these is that none of them work with emulators.  At least not for anything I've tried.  Would love to see a project for this that works with emulators.
Title: Re: Diy Laser Light Gun.
Post by: ryoken on May 11, 2019, 09:25:25 am
I just try it on a monitor  27" with satisfactory  response and accuracy
https://youtu.be/xpsTM654c68
Title: Re: Diy Laser Light Gun.
Post by: SammyWI on May 11, 2019, 11:09:12 am
Any reason you're using the green laser vs the more common red?  Camera track it better?
Title: Re: Diy Laser Light Gun.
Post by: ryoken on May 11, 2019, 11:39:50 am
Yes i use one cheap green laser because  they also  have infrared light in the output.  And i have an infrared  pass filter  in the ps3 camera.
Title: Re: Diy Laser Light Gun.
Post by: thet0ast3r on May 11, 2019, 01:34:28 pm
nice, this is with very minimal software and hardware, just get an infrared laser and you got a pretty decent and very precise lightgun. This concept was talked about here a lot.
Some problems however:
how to differentiate 2 guns on 1 screen?
What to do when the screen is too glossy?
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 12, 2019, 10:57:16 pm
Give me some more info guys and I might be able to do something with it.  I've got a lot of amazon credit I can use.  I doubt I can get a software solution to fake dual mice because of the way dual mice work, but I can probably get them to show up as joysticks. 

Glossy screens might be fixed via "clear" contact paper.  I checked and yes, such a thing exists.  Multiple players might mean two cameras with a different light filter on each and lasers putting out different ends of the spectrum. 
Title: Re: Diy Laser Light Gun.
Post by: pbj on May 12, 2019, 10:59:05 pm
That Sinden guy better hurry up.

Title: Re: Diy Laser Light Gun.
Post by: ryoken on May 12, 2019, 11:34:21 pm
Starting some test to replace laser diode.  Using a safe 5mm low power led instead.  This is about 1 meter of distance  but it will remain almost the same size  at 2 meters. The focus point is incredible small. More test coming  using IR leds. I even  think this type of focus glasses arrangement will blast laser tag games industry  like longer shots with less beam light  spread.  Making more realistic  and challenging the accuracy in the game
Title: Re: Diy Laser Light Gun.
Post by: thet0ast3r on May 13, 2019, 06:26:35 am
Give me some more info guys and I might be able to do something with it.  I've got a lot of amazon credit I can use.  I doubt I can get a software solution to fake dual mice because of the way dual mice work, but I can probably get them to show up as joysticks. 

Glossy screens might be fixed via "clear" contact paper.  I checked and yes, such a thing exists.  Multiple players might mean two cameras with a different light filter on each and lasers putting out different ends of the spectrum.

What I meant was not the software side of things, but rather the hardware. How do you separate 2 laser pointers and determine which one is player 1, and which one is player 2. With 4 players this would get messy. Also, if your camera is not accurate enough, it would be a problem if both players shoot at the same screen position. I wonder if one could do something with a simple lens, like in those laser levels, where you get a line instead of a dot. with 2 ir lines , it would be easier to separate 2 guns from eachother.
Title: Re: Diy Laser Light Gun.
Post by: ryoken on May 13, 2019, 07:03:08 am
Give me some more info guys and I might be able to do something with it.  I've got a lot of amazon credit I can use.  I doubt I can get a software solution to fake dual mice because of the way dual mice work, but I can probably get them to show up as joysticks. 

Glossy screens might be fixed via "clear" contact paper.  I checked and yes, such a thing exists.  Multiple players might mean two cameras with a different light filter on each and lasers putting out different ends of the spectrum.
Very good idea the clear screen paper. I was thinking to try with  clear  coat in mate finish  . I need to get and old cheap screen to try it first.
Title: Re: Diy Laser Light Gun.
Post by: MrLightgun on May 13, 2019, 12:44:24 pm
Interesting, how do we think Mars PDP solves the glossy screen?

Is the room dark or is it just the exposure of the camera?  What is the performance like with daylight?  I guess having a proper infra red laser would help with this.

I know it's a bit patronising but be careful with your eyes with that green laser and even when you switch to infra red don't automatically assume it is safe to look at.  There is no blink reflex with an infra red laser so if it happens to be unsafe it's actually more dangerous than a visible laser.

How essential is the piano in this setup?  :)
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 13, 2019, 01:49:09 pm
Give me some more info guys and I might be able to do something with it.  I've got a lot of amazon credit I can use.  I doubt I can get a software solution to fake dual mice because of the way dual mice work, but I can probably get them to show up as joysticks. 

Glossy screens might be fixed via "clear" contact paper.  I checked and yes, such a thing exists.  Multiple players might mean two cameras with a different light filter on each and lasers putting out different ends of the spectrum.

What I meant was not the software side of things, but rather the hardware. How do you separate 2 laser pointers and determine which one is player 1, and which one is player 2. With 4 players this would get messy. Also, if your camera is not accurate enough, it would be a problem if both players shoot at the same screen position. I wonder if one could do something with a simple lens, like in those laser levels, where you get a line instead of a dot. with 2 ir lines , it would be easier to separate 2 guns from eachother.

Like I said, you use lasers on opposite ends of the spectrum.  One IR and another UV.  The camera setup for IR can't see the UV dot and vice versa.  It could be done with visible lasers as well assuming you don't mind the dot.  You can do shape processing but it's better not to.  Finding a dot in a picture is pretty quick ... determining what shape it is isn't. Another option is having an Arduino control the on-off of the lasers and have it strobe the lasers in sequence, reading one at a time.  I'm not sure how quickly lasers fire up and fade off though, so that might not work. 

There aren't any 4 player light gun games that I'm aware of... there are some three player positional gun games. 
Title: Re: Diy Laser Light Gun.
Post by: SammyWI on May 13, 2019, 06:37:32 pm
nice, this is with very minimal software and hardware, just get an infrared laser and you got a pretty decent and very precise lightgun. This concept was talked about here a lot.
Some problems however:
how to differentiate 2 guns on 1 screen?
What to do when the screen is too glossy?

I know the ShootOff software I linked above can differentiate between green and red lasers so two players on that basis may be possible.  Or to look at the bright side, two players with the same color laser could turn a single player game into two player co-op!
Title: Re: Diy Laser Light Gun.
Post by: ryoken on May 14, 2019, 07:10:28 am
Later i will try with a red laser  1mw.  I was trying to take apart  a green laser pointer to modify the output  an make it as low as possible.  But sadly i damage the laser diode in the process.  I have few more on the way but i really like to use these green laser if i manage to drow the power to the minimum. What make it perfect is you can put in front of the laser a ir pass filter and you keep the tracking but without the visible green laser. So it can be very easy to change how you want to play.
Title: Re: Diy Laser Light Gun.
Post by: Mike A on May 14, 2019, 07:30:04 am
It is nice to see that there is progress being made on multiple fronts with light guns.
Title: Re: Diy Laser Light Gun.
Post by: ryoken on May 14, 2019, 07:36:08 am
I just read pdp mars will make an announcement tomorrow.  Probably they will release early because they don't say anymore for 15 July on Facebook. I say this because be able to play with the  mars hardware can help a lot to understand how to get stuff done and make the laser tracking  working on pc much better with one or 4 players with one   camera.
Title: Re: Diy Laser Light Gun.
Post by: ryoken on May 14, 2019, 12:30:50 pm
I just try  the 1mw red laser with a ps3 camera  unmodified the ir filter still in the camera. Still some glare from the window but it works  flawlessly. 
https://youtu.be/SRLUzkYody8
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 14, 2019, 10:50:27 pm
I just read pdp mars will make an announcement tomorrow.  Probably they will release early because they don't say anymore for 15 July on Facebook. I say this because be able to play with the  mars hardware can help a lot to understand how to get stuff done and make the laser tracking  working on pc much better with one or 4 players with one   camera.

That's a bad sign.  Usually when a company has a release date posted and they remove it means the release will be delayed.  :(
Title: Re: Diy Laser Light Gun.
Post by: ryoken on May 14, 2019, 11:22:42 pm
I just read pdp mars will make an announcement tomorrow.  Probably they will release early because they don't say anymore for 15 July on Facebook. I say this because be able to play with the  mars hardware can help a lot to understand how to get stuff done and make the laser tracking  working on pc much better with one or 4 players with one   camera.

That's a bad sign.  Usually when a company has a release date posted and they remove it means the release will be delayed.  :(

Indeed is what just happened.  It is delay some point at end of this year. Well it is ok i only  need to add the right  laser pointer to this beauty.
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 15, 2019, 12:32:03 am
The mars lightguns are up on amazon for pre-order.

https://www.amazon.com/PDP-Xbox-One-Mars-Starter-Pack/dp/B07RL8WQFC/ref=sr_1_1?keywords=ir+laser&qid=1557894265&s=videogames&sr=1-1 (https://www.amazon.com/PDP-Xbox-One-Mars-Starter-Pack/dp/B07RL8WQFC/ref=sr_1_1?keywords=ir+laser&qid=1557894265&s=videogames&sr=1-1)

Looks like there will be console versions.  The base unit with game, one gun and camera is $99 and each additional gun is $29.  Still pricy, but if you get the two gun bundle for $120 that's about the same as the act labs guns bitd.

Amazon has ps3 cameras up for $6.99, so I'm down to tinker.  I'm researching atm to see if this is yet another vb6 project or if I need to choose another language.  Video is one of the few things that vb6 can't do well so we'll see. 
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 15, 2019, 01:05:52 am
Went ahead and ordered a ps eye.  I also noticed that there are some sellers selling custom webcam filters at any desired wavelength.... around 2 for $10.  Aside from whatever device we choose to interface the buttons and the desired gun shell, I don't see a setup like this costing very much, which is kind of the point.    If you don't mind a wired setup I'm thinking a Arduino uno clone for the I/O (around $6) and a dollar store/s-mart toy gun for the shell and some misc bits like the laser and some micro switches. 

Found some vb code that looks decent, but until I get the actual webcam in hand I won't know if it's laggy or not.  I'm not going to buy everything needed until I can get a good proof of concept coded. 
Title: Re: Diy Laser Light Gun.
Post by: ryoken on May 15, 2019, 01:29:41 am
Pdpmars shipping date 31 /12/ 2019. And only USA and Canada market. Too bad not for Europe. This encourage me to go ahead with this Diy laser gun
Title: Re: Diy Laser Light Gun.
Post by: thet0ast3r on May 15, 2019, 03:27:49 am
Give me some more info guys and I might be able to do something with it.  I've got a lot of amazon credit I can use.  I doubt I can get a software solution to fake dual mice because of the way dual mice work, but I can probably get them to show up as joysticks. 

Glossy screens might be fixed via "clear" contact paper.  I checked and yes, such a thing exists.  Multiple players might mean two cameras with a different light filter on each and lasers putting out different ends of the spectrum.

What I meant was not the software side of things, but rather the hardware. How do you separate 2 laser pointers and determine which one is player 1, and which one is player 2. With 4 players this would get messy. Also, if your camera is not accurate enough, it would be a problem if both players shoot at the same screen position. I wonder if one could do something with a simple lens, like in those laser levels, where you get a line instead of a dot. with 2 ir lines , it would be easier to separate 2 guns from eachother.

Like I said, you use lasers on opposite ends of the spectrum.  One IR and another UV.  The camera setup for IR can't see the UV dot and vice versa.  It could be done with visible lasers as well assuming you don't mind the dot.  You can do shape processing but it's better not to.  Finding a dot in a picture is pretty quick ... determining what shape it is isn't. Another option is having an Arduino control the on-off of the lasers and have it strobe the lasers in sequence, reading one at a time.  I'm not sure how quickly lasers fire up and fade off though, so that might not work. 

There aren't any 4 player light gun games that I'm aware of... there are some three player positional gun games.

4 player-lightun game: Gaia attack 4 :D

2 ends of the spectrum would probably work, requiring 2 cameras nowadays wouldn`t even be that much of a problem.
Maybe one could simply take two ir lasers, and make one much brighter than the other one.

Another approach (that just came to my mind):
We could use identical lasers, that are pulsed at 120 hz, and get some cheap 3d shutter glasses (10 usd) for the 2 cameras) then we would have to sync the framerate to the cameras ( or probably [most likely)] that isn`t needed) - sync the guns to the glasses, and let them pulse with 120 hz ( microcontroller), with one gun always being on and the other one always being off. this should give (in theory) a somewhat robust, working solution, with 2 same laser pointers.
Title: Re: Diy Laser Light Gun.
Post by: ryoken on May 15, 2019, 03:41:55 am
Ghost squad can be play with 4 players on the wii
Title: Re: Diy Laser Light Gun.
Post by: SammyWI on May 15, 2019, 08:06:34 am
So the Mars PDP is for Xbox, delayed and no mention of aPC version. Blech. I do have a couple of ps3 eye cameras. Tried to use them with the ShootOff software but they locked up all the time. Hopefully they work better with different software.
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 15, 2019, 09:03:51 am
No the pc version is up on amazon as well.  It's a two gun kit for $129.  I'm not sure if there is a single person kit or not, but honestly the base unit is $99 anyway so it'd be silly not to fork over another 30 to make it two player. 

This one has actual completed product shots and pre-orders on amazon via a well established hardware company so atm at least it's closer to production than the sinden guns.  I want to see them both come out so people have options, but dems the facts. 

The software example I found really works with any webcam, but the high frame rate of the ps eye is something unusual on a low end, low resolution camera and processing a smaller image obviously takes less time, so I figured that'd be the place to start.  I think 640x480 should be enough, but like I mentioned in other threads, I'm not 100% certain it's enough in oddball mounting situations where the view wouldn't be straight on. 
Title: Re: Diy Laser Light Gun.
Post by: bandicoot on May 15, 2019, 11:11:54 am
here's a hack for opentrack
https://www.youtube.com/watch?v=0fLq6bC2Vuc
it's work with only 1 point but for IR , i test it with PS3 EYETOY it's works but like a LIGHTPEN ( can't move with angle )
another hack of this for laser could work like a charm
Title: Re: Diy Laser Light Gun.
Post by: ryoken on May 15, 2019, 12:26:40 pm
Opentrack could be in my opinion the best o the best in lightguns. But only if the mouse or joystick emulate can can get a screen calibration using 3 tracking points like  the the clip with 3 ir leds for the headset.  But instead in front of the gun. In this way we can  track  multiple guns  with different led patterns
Title: Re: Diy Laser Light Gun.
Post by: SammyWI on May 15, 2019, 05:22:04 pm
No the pc version is up on amazon as well.  It's a two gun kit for $129. 

I'm not finding a PC version on Amazon.  Do you have a link?

Edit: The lightgun only listings say: 'universal lightgun' but everything with the camera says 'Xbox one'.  Hopefully they come out with a PC version and the light guns will work with either: 'universal'.  Or maybe the Xbox one version will work with PC.  All the Xboxes are basically a specialized PC AFAIK but I am not counting on that.  (until someone else does the testing, that is.)
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 16, 2019, 03:34:59 pm
I think that's just a press release mistake because the xbox version has a pic with the familiar xbox one stripe at the top of the game art and the other doesn't.  The easiest way to do this sort of gun in modern times is to have it show up as a gamepad, so that's probably the case here. 
Title: Re: Diy Laser Light Gun.
Post by: SammyWI on May 17, 2019, 11:04:49 am
I think that's just a press release mistake because the xbox version has a pic with the familiar xbox one stripe at the top of the game art and the other doesn't.  The easiest way to do this sort of gun in modern times is to have it show up as a gamepad, so that's probably the case here.
I think I'll wait until someone else tests that theory.
Title: Re: Diy Laser Light Gun.
Post by: KenToad on May 17, 2019, 02:47:41 pm
Yeah, the PDP Mars camera seems to be Xbox One only at the moment and the company's own website gives no hint as to further supported platforms. I would assume that the guns are just glorified laser pointers.

PS3 cameras are mind-bogglingly cheap and plentiful. If someone could get that working with the PDP Mars gun on PC, then that would be the best of both worlds, IMO. Otherwise, I'll just wait for the inevitable PC support from PDP Mars, assuming the Xbox One launch doesn't completely bomb.
Title: Re: Diy Laser Light Gun.
Post by: thet0ast3r on May 17, 2019, 04:42:53 pm
Has anyone looked into raspberry pi + rpi camera? those are ridiculously cheap when bought from aliexpress, too (4.07 EUR / 5 USD) per piece, or 10 EUR if you want the night vision version. If you could get the software running on the raspberry pi (maybe zero?) then this could be a plug and play solution, which would be pretty cheap too.
Title: Re: Diy Laser Light Gun.
Post by: ryoken on May 17, 2019, 05:32:33 pm
I just finish virtua cop 2. With a laser on top of my wiimote shell.it feels so good to play with the laser tracking  it feels pixel accurate
Title: Re: Diy Laser Light Gun.
Post by: pbj on May 17, 2019, 07:23:16 pm
Are you going to share?
Title: Re: Diy Laser Light Gun.
Post by: KenToad on May 17, 2019, 08:12:18 pm
Agreed, is this potentially a DIY thing that the rest of us can test?

Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 17, 2019, 09:12:03 pm
He's probably just using open track, which works ok for 1p I believe.  As soon as the UPS guy gets off his fat butt and brings me my ps eye I'll cobble at least a mouse emulator together. 
Title: Re: Diy Laser Light Gun.
Post by: ryoken on May 18, 2019, 02:41:25 am
I didn't use opentrack yet. Because i can't calibrate the screen  size with it. I will try to recording a better  video to show  how it works.  I really will like to have more time to expend in this project but work every day take me 10 to 11 hours an then the baby, wife... not much time left in my daily  routine. I'm having a bit of problem with model 2 emulator because it crash every time  i change to full screen.
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 18, 2019, 05:21:25 pm
Mine came in today.  I can't even get it to behave as a proper webcam in windows.  There's an example directshow app I found specifically for the ps3 cam that works, but pretty much nothing else does.  If it's a directshow only thing, that'll work, but it's a bit slower than pulling down the raw images. 

From what little testing I have done you might want to keep this in mind.....  My old mame cab, which has a 27' 16:10 monitor in it needs the camera about 14 inches back before it can get the whole screen in, even in widescreen mode.  So on a traditional cab this isn't going to be entirely easy to setup.  You'd probably need to mount it either at the trailing edge of your control panel or the ceiling or something. 
Title: Re: Diy Laser Light Gun.
Post by: SammyWI on May 18, 2019, 06:14:47 pm
Mine came in today.  I can't even get it to behave as a proper webcam in windows.  There's an example directshow app I found specifically for the ps3 cam that works, but pretty much nothing else does.  If it's a directshow only thing, that'll work, but it's a bit slower than pulling down the raw images. 

From what little testing I have done you might want to keep this in mind.....  My old mame cab, which has a 27' 16:10 monitor in it needs the camera about 14 inches back before it can get the whole screen in, even in widescreen mode.  So on a traditional cab this isn't going to be entirely easy to setup.  You'd probably need to mount it either at the trailing edge of your control panel or the ceiling or something.

PS3 eye cameras have pretty poor windows driver support.  There is some stuff on Github.  And there's the Code Laboratories driver that you have to pay for.  I've used the free ones and got lock ups with the ShootOff software. But they have that high FPS which is enticing.
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 18, 2019, 09:36:19 pm
Yeah I ran across this:

https://github.com/psmoveservice/PSMoveService/wiki/PSEye-Software-Setup-%28Windows%29 (https://github.com/psmoveservice/PSMoveService/wiki/PSEye-Software-Setup-%28Windows%29)

I don't have the time nor inclination to try them all right now so I'll take a look at it later.  This was my concern all along and why I initially dismissed the ps eye as a viable solution.
Title: Re: Diy Laser Light Gun.
Post by: SammyWI on May 19, 2019, 09:05:09 am
I'll probably try messing with the PS3 eye again since I did take the time to remove the IR filter and add a lens with focus adjustment.  And I'll probably be disappointed once again.
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 19, 2019, 08:27:32 pm
Was it hard to remove the IR filter?  I haven't attempted it yet.  I'm just wondering how much IR light the green lasers put off because the image quality of the ps eye is surprisingly poor.  It's quick in terms of frame rate, but there's all kinds of static.... blocking out visible light and just tracking ir would really improve accuracy.  Assuming I can sort out the drivers the wide lens is probably good enough for me to be able to get good tracking with a minimum of distortion. 

My idea for the system as a whole is this....  A 3d printed lens cap with a visible light filter installed could be removed for calibration.  To calibrate the eye would just take a pic and the user could click on the corners.... that'd give me the screen bounds and I could draw a trapezoid with them.  I can then scan the image one pixel at a time for that trapezoid's color to determine the start and stop points for each row and column and save those values as offsets and multipliers.  The leftmost pixel in a row and the topmost pixel in a column are the offsets and the rightmost and bottommost minus those values converted to a percentage of the screen are the multipliers.  Then when you play replace the lens cap and the dot's position would be applied to the array to determine the position on the screen with distortion removed.  Alternatively the user could "paint" the corners by firing at them with a visible laser that also has ir.  Either would work, I just need to know the corners.  So long as the camera isn't moved, it'd never have to be calibrated again.  It might be prudent to do a 4:3 calibration for 16:9 monitors but that could be calculated from the 16:9 corners. 
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 20, 2019, 12:48:21 am
I ran across this:

https://www.walmart.com/ip/Universal-AR-Gun-Smart-Pistol-Bluetooth-Game-Handle-Controllers-W-Phone-Stand-3D-AR-Games-Gun-For-Smartphones/981944364 (https://www.walmart.com/ip/Universal-AR-Gun-Smart-Pistol-Bluetooth-Game-Handle-Controllers-W-Phone-Stand-3D-AR-Games-Gun-For-Smartphones/981944364)

For people with limited DIY skills it'd be an ideal shell for a basic gun.  The trigger is actually a Bluetooth controller, so it's wireless.  Drill out the front to slide a laser pointer in, rig it to stay on and you are good to go. 
Title: Re: Diy Laser Light Gun.
Post by: SammyWI on May 20, 2019, 08:29:30 am
Was it hard to remove the IR filter? 
It's been a while but IIRC it was a PITA.  And on top of that you have to add some kind of shim behind the lens mount to get things to focus.  That was why I put on a new lens with the focus adjustment built in.  I had another one where I just guessed on adding a shim and the picture was a little out of focus but still worked OK for laser detection.

I've also done some testing with filters.  Photographic gel films work well.  I ordered this pack from Amazon and it has worked well (plus cheap!).
https://smile.amazon.com/gp/product/B00QN48X0Q/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1 (https://smile.amazon.com/gp/product/B00QN48X0Q/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1)
Two red plus two blue filters work well as a visible light filter for IR laser use.   For a visible red laser, adding a red filter can help.
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 21, 2019, 12:57:24 am
I might give it a shot anyway, I need to get the drivers working before I do anything... might be able to do something decent with visible light, at least enough for testing. 

In terms of filters I saw one link on amazon for custom filters... 2 for $10 or something like that.  In the description it said you could contact them to get it made for a specific spectrum.  In theory one could check the tech specs of two different colored lasers, get filters made for them and then put the opposite filter in two cameras... so camera 1 can't see laser 2 and vice versa. 

The more I think about it, the more a stationary camera makes sense.  Screen location doesn't have to be calculated which decreases processing time.  It's just getting the damn lasers and camera to cooperate. 
Title: Re: Diy Laser Light Gun.
Post by: SammyWI on May 21, 2019, 06:30:01 pm
Well I tried the PS3 eye again, this time with the Code Laboratories driver.  On the good side: it did work and seemed to detect lasers well (using Win 10).  On the bad side it still locks up on me.  Instead of just freezing the input picture it will go into kind of a static (poor reception) kind of thing.  I have read that it takes a lot of USB bandwidth so I may try again with everything else unplugged from that USB bus.  The other big issue is I couldn't find a good way to change camera settings (brightness, contrast, etc) and that is pretty critical for getting rid of false positives.  Maybe with a visible light filter and IR laser it would be OK.

Looking at filters some more I learned something new (to me).  Most photographic IR filters actually block visible light (for taking IR photos).  If you want to block IR you need to look for an IR cut off filter.  And knowing is half the battle.  ;)
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 21, 2019, 08:17:02 pm
I wonder if filters work on the lasers themselves... as in put one on a visible laser and make it ir only. 
Title: Re: Diy Laser Light Gun.
Post by: PL1 on May 21, 2019, 09:54:23 pm
I wonder if filters work on the lasers themselves... as in put one on a visible laser and make it ir only.
Visible light wavelengths range from 400nm to 700nm. (violet to red)

An optical filter will only block wavelengths, not change them, so it depends on how much power the visible laser diode outputs in/around the IR wavelengths. (700nm - 1000nm)

- Red is at the edge of IR so there's a good chance that there will be some overlap between a visible laser and IR sensor.

- Green is in the middle of the visible range. (around 530nm)
-- It's less likey to have a direct overlap, but IR sensors might be able to see the lower second harmonic frequency. (around 1060nm -- half the frequency = double the wavelength)
-- Some green lasers output the longer wavelength (around 1060nm) that would also contain a visible upper second harmonic frequency. (around 530nm -- double the frequency = half the wavelength)


Scott
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 22, 2019, 01:34:04 am
I'm getting frustrated.  Tried a few drivers and I still can't get the eye to show up as a webcam.  Gonna try a few more things.
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 22, 2019, 01:32:37 pm
So using the ps3 camera might be a dead end.  I'm confident that I can eventually get it working, but if I'm having this much trouble an end user is going to go nuts.  I also read that the CL drivers are set to only allow one camera, so that kind of kills it. 

If somebody wants to help me track down a low cost camera that will do at least 30fps I'm still willing to work on this.  It'd be nice if we could find one without an IR filter as well so it wouldn't have to be removed.
Title: Re: Diy Laser Light Gun.
Post by: pbj on May 22, 2019, 02:22:18 pm
I want you to make it work with the PS3 Eye camera because I have one NIB collecting dust.

Keep coding.

Title: Re: Diy Laser Light Gun.
Post by: Gilrock on May 22, 2019, 02:30:00 pm
Pretty sure the CL driver will work with 2 cameras because I use to run it that way.  I had 2 PS3 eye cameras installed in my VPIN to use with BAM.  It was a cool novelty that allowed the table to actually move as your head moved around.  I rigged up sunglasses to have an IR LED in the center to do the tracking.  I ended up removing them from the cab because I wasn't using them anymore and I thought they might be contributing to a video lag issue but turns out they weren't.  My cameras have been de-cased so that they would mount in the cab better and the IR filters were removed to allow the IR LED to work.  I've got it all packaged up in a bag and meant to list it for sale some day.
Title: Re: Diy Laser Light Gun.
Post by: SammyWI on May 22, 2019, 06:33:10 pm
There are two versions of the Code Laboratories driver.  The single camera one is $3.00 and the multi camera one is $5.00 so not really going to break the bank.  On cameras, the ShootOff devs recommend these two for $20 - $25 (Logitech C270 or Microsoft Lifecam HD-3000):
https://smile.amazon.com/dp/B004FHO5Y6/?coliid=I2FQ3ZK4SITCPO&colid=H5MR9RCDFQQ0&psc=0&ref_=lv_ov_lig_dp_it (https://smile.amazon.com/dp/B004FHO5Y6/?coliid=I2FQ3ZK4SITCPO&colid=H5MR9RCDFQQ0&psc=0&ref_=lv_ov_lig_dp_it)
https://smile.amazon.com/Microsoft-3364820-LifeCam-HD-3000/dp/B008ZVRAQS/ref=sr_1_3?keywords=microsoft+lifecam&qid=1558563359&s=electronics&sr=1-3 (https://smile.amazon.com/Microsoft-3364820-LifeCam-HD-3000/dp/B008ZVRAQS/ref=sr_1_3?keywords=microsoft+lifecam&qid=1558563359&s=electronics&sr=1-3)
I have both and they work, both run about 27 -28 fps.  The MS lifecam has the IR filter removed.  There are instructions out there on that.  In fact here are instructions for both cameras IR filter removal I believe.  But, over the years web cam makers seem to iterate their designs even inside of the same model.  And newer cams tend to use a coating for IR on the sensor instead of a separate lens. Cheaper I'm sure but not removable AFAIK.  My C270 had no separate filter lens when I opened it but the Lifecam did.

I am strongly considering ordering this (Spinel UC03MPD):
https://smile.amazon.com/dp/B07CN5KBPD/?coliid=I1LI28M7UN7SRH&colid=H5MR9RCDFQQ0&psc=0&ref_=lv_ov_lig_dp_it (https://smile.amazon.com/dp/B07CN5KBPD/?coliid=I1LI28M7UN7SRH&colid=H5MR9RCDFQQ0&psc=0&ref_=lv_ov_lig_dp_it)
$35, 60 fps and no IR filter out of the box.  But needs a mount and would have to find a way to turn off or remove the built in IR LEDs.
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 22, 2019, 11:37:35 pm
I haven't had much luck with the CL drivers regardless.  The camera works with the included software, but nothing else.  It seems to show up as a webcam in various software suites but crashes or does nothing when it's selected.  Maybe the drivers are interfaced in a non-standard way and that's why I can't get anything to work, I dunno.  Now technically all I need to do is grab a frame and analyze it so I could probably just use api calls to grab it from the cl-eye test, but man that'd be hacky having to keep a window up like that.  I'll see if I can find some technical documents that'll help but I'm not super hopeful.   I might cludge together an app that does do this just for a proof of concept. 

The other cameras might be a better way to go but I am concerned about cost.  $50 or less per gun seems reasonable to me if it's a DIY solution since we have commercial solutions on the horizon and the only reason to go a diy route is to save a bit of money.  A $25 camera isn't bad on it's own, but to complete a gun you'll need a shell, a laser, an Arduino for the buttons, some misc leds, switches and a relay and solenoid if you want force-feedback.  It adds up and I don't want to waste time coming up with a solution that's just as expensive as the commercial products only a bigger pain in the butt to setup and assemble.  I'm not ruling any of them out though... they are all good suggestions... I'm just trying to see the forest instead of just the trees for once. 
Title: Re: Diy Laser Light Gun.
Post by: ryoken on May 23, 2019, 03:52:05 am
I will show with details how i run the software to track the ps3 camera with  the cl drivers. I sorry i didn't make any post with this info but it's mainly because i damage  the only and my last green laser. Still waiting  for few laser pointers ordered from aliexpress. Rather than wait for they i will just use a red one. I will like to do it this week. I know everyone who is waiting for a better light gun experience wireless  or wired in any angle or distance from the screen and very cheap.  I warranty it is possible. Projector displays are the ideal working  scenario 
Title: Re: Diy Laser Light Gun.
Post by: SammyWI on May 24, 2019, 09:50:45 am
I haven't had much luck with the CL drivers regardless.  The camera works with the included software, but nothing else.  It seems to show up as a webcam in various software suites but crashes or does nothing when it's selected.  Maybe the drivers are interfaced in a non-standard way and that's why I can't get anything to work, I dunno.  Now technically all I need to do is grab a frame and analyze it so I could probably just use api calls to grab it from the cl-eye test, but man that'd be hacky having to keep a window up like that.  I'll see if I can find some technical documents that'll help but I'm not super hopeful.   I might cludge together an app that does do this just for a proof of concept. 

The other cameras might be a better way to go but I am concerned about cost.  $50 or less per gun seems reasonable to me if it's a DIY solution since we have commercial solutions on the horizon and the only reason to go a diy route is to save a bit of money.  A $25 camera isn't bad on it's own, but to complete a gun you'll need a shell, a laser, an Arduino for the buttons, some misc leds, switches and a relay and solenoid if you want force-feedback.  It adds up and I don't want to waste time coming up with a solution that's just as expensive as the commercial products only a bigger pain in the butt to setup and assemble.  I'm not ruling any of them out though... they are all good suggestions... I'm just trying to see the forest instead of just the trees for once.

Something is odd that you can't get the camera working at all in other software.  It shows the image stream for me in Yawcam and Manycam as well as some of the laser detection stuff I posted earlier.  (But does not show in Win10 camera app)  I wonder if you have some driver conflicts.  You have to uninstall all of the other drivers for the PS3 eye to get it to work.  And Windows tries to automatically install a driver as well.  You might try looking through Device Manger for any other instances of the PS3 eye (might not be labeled that) to uninstall.  It may show up under USB devices, Game Controllers, etc.

Your goals of a multi player setup with wireless on gun controls sounds cool.  But for me much of that would be optional.  A basic single gun would work for many games.  For an extra in game button or two I could rig up something as simple as a USB numeric keypad with all but one or two keys pulled off and put it on the floor as a foot switch.  Admin buttons work fine from any wireless or even wired keyboard.  Lots of ways to incrementally improve the controllers from there.
Title: Re: Diy Laser Light Gun.
Post by: SammyWI on May 24, 2019, 09:54:50 am
I will show with details how i run the software to track the ps3 camera with  the cl drivers. I sorry i didn't make any post with this info but it's mainly because i damage  the only and my last green laser. Still waiting  for few laser pointers ordered from aliexpress. Rather than wait for they i will just use a red one. I will like to do it this week. I know everyone who is waiting for a better light gun experience wireless  or wired in any angle or distance from the screen and very cheap.  I warranty it is possible. Projector displays are the ideal working  scenario
Looking forward to seeing (and trying) what you have come up with.  I hope it will be possible to try with other cameras as well as the PS3eye as well.
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 24, 2019, 08:33:45 pm
Well assuming we ever get anything working, the idea would be to setup a cheaper Arduino (like an uno clone) to have 3 or 4 inputs for buttons and 3 or four outputs for recoil and the leds used in positional games like terminator 2.  Maybe also some switches to toggle "fake" recoil or quickly switch between 4:3 and 16:9 mode.   The whole thing would show up as a mouse and a joystick and the camera software could send the processed data to the Arduino via a serial connection... that way virtual joysticks and mice aren't needed... it'd show up in the hardware.  Mamehooker and/or troubleshooter 2 could control the outputs, again via serial connection. 

That's the easy part of the equation though.... I can throw that together in a couple of hours.  It's getting the camera stuff squared away and reliable, which hopefully ryokan can help us with. 

I'm just burnt out fiddling with the drivers.  I'll start again fresh some other time.
Title: Re: Diy Laser Light Gun.
Post by: ryoken on May 26, 2019, 09:31:33 am
https://youtu.be/g7-hMvh8Ey0
Title: Re: Diy Laser Light Gun.
Post by: ZTylerDurden717 on May 26, 2019, 12:35:33 pm
that's brilliant
Title: Re: Diy Laser Light Gun.
Post by: SammyWI on May 26, 2019, 05:26:22 pm
Looking good.  I diddn't realize you were using a mouse for the actual click and just using the laser for position.  Most stuff I've seen uses a laser that is only turned on when you want a click.  I can see + and - both ways.  I assume that you have the mouse sensor taped over so you don't get unwanted movements?
Title: Re: Diy Laser Light Gun.
Post by: ryoken on May 26, 2019, 11:19:15 pm
 I don't play with this wireless mouse with the laser taped on it. I use it for demonstrate in the video how simple can i get. I don't have yet a light gun  ready for play. I'm still waiting for few green laser for more testing to play with or without infrared pass filters and lowering the output of the laser driver to the minimum enough to be captured by the camera.  I also try and works flawlessly is to tape the laser to one of my wiimotes with a gun shell  and use touchmote to mapping the wiimote  buttons.
Title: Re: Diy Laser Light Gun.
Post by: bandicoot on May 27, 2019, 12:16:42 pm
same idea for me , is to put a laser in a wiiimote

Another good hack is with AIMTRAK if we can put a laser and track it
Title: Re: Diy Laser Light Gun.
Post by: Howard_Casto on May 27, 2019, 05:04:16 pm
I wasn't going to fool with wireless myself because I want recoil.  That means you need at least a decent 12v power source so if you are going to have to run lines for it anyway....  I say do like the old school act-labs guns and run all the I/O to the shell via a network cable.  Either that or a vga cable since I've got a million of those damn things now due to the fact that every monitor comes with one. 
Title: Re: Diy Laser Light Gun.
Post by: anirudhya_g on July 14, 2023, 04:26:22 am
https://youtu.be/g7-hMvh8Ey0
Does anyone know where can I find the software used in this video?