Archived

This topic is now archived and is closed to further replies.

paulbird

How do I make a 3D Mouse?

Recommended Posts

Hello, I would like to make a 3D mouse that I can connect to the mouse socket in my computer which would help me make 3D graphics. Any ideas how to do this (without taking an electronics degree)? Here is the plan:
  
      _|__ 
     (____)...   <-mouse       ______
       |      .               |      |
       |      .               |      |
       |       .              |      |
       |         ............[| CPU  |    
      _|_                     |      |
     (   )...................[|      |
====================(TABLE)=============
  
Maybe I could somehow connect two mices together and use the input from both of them to determine where the combined 3D mouse was in space? Hmmm..... yes its coming to me now.... I stick one mouse sideways on a ruler and attcach that ruler vertically to mouse-2. Then that mouse will measue the XY direction and the other mouse can measure the Z direction... Is it possible to connect two mouses into the computer? If so, how would you read the input from each mouse seperately?

Share this post


Link to post
Share on other sites
quote:
Original post by paulbird Is it possible to connect two mouses into the computer? If so, how would you read the input from each mouse seperately?


DirectInput will allow you to have a joypad that has up to 6 axies (possibly more), so you could buy one with enough inputs and chop it up for your own needs perhaps..?

Share this post


Link to post
Share on other sites
I''m pretty sure most locally-executed (ie Windows with the tower right there, as opposed to an X11 box) OSs won''t allow more than one active "pointing device" at a time.

What you may be able to do is use OrangyTang''s idea of jury-rigging a joystick''s axes.

I''m sure you can come up with much better ideas if you had an electronics degree.

Share this post


Link to post
Share on other sites
How about you set a web-cam to look at your mouse and then you write some fancy software which calculates the 3d-position of the mouse by analyzing the image. That would be cool.


____________________ ____ ___ __ _
Enselic''s Corner - My site. Go test my game Spatra and see if you can beat it onto the Official Spatra Top 10.
CodeSampler.com - Great site with source for specific tasks in DirectX and OpenGL.

Share this post


Link to post
Share on other sites
quote:
Original post by Enselic
How about you set a web-cam to look at your mouse and then you write some fancy software which calculates the 3d-position of the mouse by analyzing the image. That would be cool.[...]
If you''re going to be fancy, why use a mouse at all? Just have the camera figure out the 3d position of your finger and you could just wave your hand around. I think it would take 2 cameras though.

If you do use a hardware device, you should add sensors to it so it can tell when you rotate it as well to get 6 DOF instead of only 3 =-)

[edited by - Big Brother on January 1, 1984 12:00:00 AM]

Share this post


Link to post
Share on other sites
Tough one huh?

If I can remember trere was a question on our forums (Slovenian -Joker magazine) about connecting two mices onto the PC and control the cursor with them. OK, the question was:

Pozdravljeni ...

Kar k vprasanju :
...
...


OH, you dont understand Slovene Well, the question was somethink like that: I want to have dual mouse on my PC. each of theme has to work on their own (double XY coords, for each of them).


The problem was that if you connect two mices on the computer it works as one (move mouse no. 1 and the cursor will move. Move mouse no. 2, and the same cursor will move... how odd. ).

So, the answer came... http://www.touch-base.com/files/updintro.pdf

And I'm the winner! I hope.


PS, sorry for my english!
PPS. the link to the forums we disscussed: http://www.joker.si/mnenjalnik/viewtopic.php?t=24082&highlight= Do you understand slovene?

[edited by - unknownnick on May 3, 2003 4:11:12 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
DirectInput supports multiple mice.

However, your mouse already has the third dimension: the scroll wheel. Use it!

Share this post


Link to post
Share on other sites
I can''t remember if this still works but I remember I used to use the NUMPAD mouse & the mouse together, so just use those 2. I s''pose ud still have to make a proggy to readjust the numpads behaviour, thats if you want to use the keyboard though

Share this post


Link to post
Share on other sites
using the mouse wheel, as mentioned above, is by far the best solution to your problem.

It may not be the coolest, but if you were going for that, just buy some extra equipment to read your brain waves, and then design a program that reads those and can move on 3 axises depending on which of six directions you are thinking. Maybe you could blink to click? .sen

Share this post


Link to post
Share on other sites
lol! That''s awesome!

If you actually complete it, make sure you submit a picture! I''m very interested in seeing this.



- Rob Loach
Current Project: Go Through Object-Oriented Programming in C++ by Robert Lafore

"Do or do not. There is no try."
- Yoda

Share this post


Link to post
Share on other sites
The camera way is almost the best approach for this. You will just need two cameras.

While the human eye is the best camera ever created our body needs two to see in a three dimensional space, causing stereoscoping view.

When you put together two images from almost the same angle you get reference points which you can measure from camera to camera and see how far away those reference points are. You can simplify the work of the camera by using an specific object or color for the camera to search for.

This approach to immitate human vision is widely used in robots which navigate through buildings with or without a map of it. Using it to evade obstacles, go through doors, calculating collision with moving objects.

This 3d mouse approach has been already used but is only available in some universities, there is nothing commercial about it because we don''t need it yet.

There is also a way of scanning 3d objects with a single camera using a shadow as the scanner, the program searches reference points with the moving shadow over the object and can get the depth of it creating a 3d model...

So this area is widely researched and you might even find some papers on using this as your 3d mouse. What i would love to see is for this to be implemented with an holographic interface, that would definitely rock.

Mecha Engineer (Making Real Humanoid Suits)

Share this post


Link to post
Share on other sites
Hmm, it would also be cool to have a pointer within a cube that you could move around. This would be more natural, but would also make you somewhat tired after awhile I would think. Perhaps instead of a large cube you could have a very small cube that you moved a pointer around inside of.

Not only would this be cool, but it wouldn''t be that hard to do if you knew some basic electrical engineering. Is there a patent on such a device? .sen

Share this post


Link to post
Share on other sites
I''m not sure if this would work but...

Set up two cameras as mentionned before. Make sure you are in an area free of, say, red. Now tape a little red ball or something like that to your finger.

The idea here is to write a program that spots the red ball (easy, since it would be the only component of the image that has a high red intensity and low green and blue) and interpolate from both cameras to get its x/y/z position. The problem would be that scanning the entire image every frame would probably take too much time to work smoothly in real-time. As for clicking, you could handle that by using your other hand to press space or something like that on your keyboard. It would require a bit of coordination, but I suppose it would work.

You can find two webcams for, what, a total of $150? Less? Hell if I know what those cost nowadays. The red ball, eh, free. So it wouldn''t be a massively expensive thing...

Share this post


Link to post
Share on other sites
why do they need to be in seperate planes? just have two seperate mouse pads with two mices.

the twin joysticks on a gamepad are effectively what you are trying to do.

Share this post


Link to post
Share on other sites
One solution that exists involves a stylus on an armature. Like a pen holder on an arm attached to a column like you show. The angle of the arms is reported to the driver, which calculates the positions.

The cheapest come at about 3000USd so if you make one, please make me one too.

Share this post


Link to post
Share on other sites
Aha! I've just thought of a better design! It is made out of an old mouse-mat and a couple of springs!

    

SIDE VIEW:
___.............-->to CPU
mouse->_____(___)____
mat ---> (______________) --------------
X X |
springs-> X X | DESKTOP
-----------------------------



So you can move the mouse normally on-top of the mouse mat in 2 dimensions and then apply pressure to the mouse downwards to-wards the desk to enter the 3rd dimension! It might be better with an actual hole cut into the desktop... Then when you don't want to use the 3rd dimension you can flick a switch and it becomes just a normal mouse mat! All I need for this is something to measure the tension in the springs and send the data to the computer.

Anyway, it seems Direct Input is the way to go so I'll have to look that up.

[edited by - paulbird on May 7, 2003 11:56:20 AM]

Share this post


Link to post
Share on other sites