spaceball again

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: spaceball again

Post by jriegel »

Great! :D

I have a new cheap one, USB. I have also a old serial one (very old, one of the first) , but the driver dont support it on Vista :(

Dont hesitate and ask questions!
Stop whining - start coding!
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: spaceball again

Post by tanderson69 »

jriegel wrote: I have a new cheap one, USB.
I am guessing you have a space traveler that has just 6DOF and no buttons? As long as the unit doesn't slide across your desk that is all you need! I haven't used all the models over the years but I have used enough of them to decide that the buttons are of little use and please a LCD screen...for what? It's the 6DOF that matters to me.
jriegel wrote: I have also a old serial one (very old, one of the first) , but the driver dont support it on Vista
There is no reason in the world that they can't continue to support those devices other than they want to sell more devices. I wish there was another company making these. Take a look at my next post.
jriegel wrote: Dont hesitate and ask questions!
thanks.
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: spaceball again

Post by tanderson69 »

I am going to continue to post subject matter as to use this thread as a research log. That way if I am unable or unwilling to take this to completion, there will be a collection of information. Don't feel obligated to respond.

I was doing some research to try and determine if the event structures for the various devices are the same (I have more evidence they are but not a fact yet....not the point). I downloaded a third party driver I have looked at in the past called spacenav. http://spacenav.sourceforge.net/
The latest svn revision has support for serial devices on linux. It worked great with my 4000 flx spaceball but not so much with my magellan spacemouse plus serial. I am going to see if I can work on that. This project has a windows port but I think it is only for usb at this point and based on .net. But the guy sounds eager to get it to "normal" c driver and I hope serial will follow. This driver is compatible with the prop driver, so all software coded to use the prop driver should work with this one. Hopefully this will support "obsolete" devices where the prop driver doesn't. This project also has SDK to develop software to utilize the driver. This is the direction I plan on heading.
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: spaceball again

Post by jriegel »

I looked it up, its the "3DConnexion Spacenavigator Personal Editon 3D mouse" and the drivers for that.

I think they will continue to send the same Windows message events, otherwise they loose all the software support
already programed in CAD systems (like CATIA)....

To post your research here is really good!
Stop whining - start coding!
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: spaceball again

Post by tanderson69 »

jriegel wrote:I looked it up, its the "3DConnexion Spacenavigator Personal Editon 3D mouse" and the drivers for that.
IMHO that is all you need. I wish they would sell a keyboard with puck added on to the end. I have a whole keyboard full of keys and most apps today allow some key customization. I wouldn't pay an extra $300 dollars for more keys. I haven't had a puck yet that I could take my hand off of the ball and hit the correct button without taking my eyes off of the screen and "hunting" for the correct button. At that point I might as well hit a key on the keyboard.
jriegel wrote: I think they will continue to send the same Windows message events, otherwise they loose all the software support
already programed in CAD systems (like CATIA)....
I had the same thought.

Nothing new to report. I have been parallelized by my magellan not working with the spacenav driver. Been making headway on that front and will be back.
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: spaceball again

Post by tanderson69 »

Well I finally got back to this and got something going. Motion3Events seem to be working great except for Z. Reading the following from NavigationStyle::zoom

Code: Select all

// Since there's no perspective, "zooming" in the original sense
// of the word won't have any visible effect. So we just increase
// or decrease the field-of-view values of the camera instead, to
// "shrink" the projection size of the model / scene.
so maybe in NavigationStyle::ProcessSoEvent we need to call the zoom function for Z translations of Motion3Events????????
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: spaceball again

Post by wmayer »

Do you get a zooming effect if you use the perspective camera? And the z value of SoMotion3Event::getTranslation() of the incoming events does it change its values for the perspective/orthographic camera?
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: spaceball again

Post by tanderson69 »

wmayer wrote:Do you get a zooming effect if you use the perspective camera?
yes, zoom works for perspective. zoom for orthographic seems to move the clipping plane.
wmayer wrote:And the z value of SoMotion3Event::getTranslation() of the incoming events does it change its values for the perspective/orthographic camera?
No they are the same right now. Do I need to? I cranked up the z value to test the orthographic camera and it just made the clipping of my test cube faster.


Apparently I am going to have to bone up on the cameras in the coin lib. I can see from the NavigationStyle::zoom function the different operations based upon camera type. So right now if we have an ortho camera we will: SoCamera::position::setValue(for x and y only), SoCamera::orientation::setValue(for x,y and z rotation) and SoOrthoCamera::scaleHeight for z translation(zoom)?
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: spaceball again

Post by wmayer »

The point with the orthographic camera is that changing the view point or the rotation don't have any influence to the zooming. Thus, for this type the height of the viewport needs to be changed to achieve this effect. Therefore we need a certain factor (a float) to set a new height. Since the z value doesn't change from where else can we get this factor?
SoCamera::position::setValue(for x and y only), SoCamera::orientation::setValue(for x,y and z rotation) and SoOrthoCamera::scaleHeight for z translation(zoom)?
Does this produce something usable?
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: spaceball again

Post by tanderson69 »

wmayer wrote:Does this produce something usable?
Yes, it is working good. And once I quit moving the camera around by z, my clipping plane problem was better (probably going to regret that). As far as the scale factor, that is a good question. Like you, I developed a zoom constant that acted "naturally" with the x and y spaceball translations. Spaceball felt good with 10mm cube and 1000000mm cube, so I am not sure there is a "correct" factor. Maybe factor could be calculated by distance front and back clipping planes? Another thing I am curious about is what affect does viewall have on an orthographic camera position and height?
Post Reply