3DConnexion Space Nav and Joystick Demos

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

3DConnexion Space Nav and Joystick Demos // The Garage

1  2  |  

Post by clintonman // Oct 24, 2007, 6:30pm

clintonman
Total Posts: 304
pic
This has 2 similar objects created for trueSpace7.5 that will read the data from a directx joystick and a 3DConnexion Space Navigator. They use activex dll's to communicate with the devices. Neither object is a widget object, but it's a start.:)


Clinton


http://www.clintons3d.com/truespace/inputDevice/inputDevices.htm

Post by splinters // Oct 24, 2007, 9:17pm

splinters
Total Posts: 4148
pic
As a Space Navigator owner I am very keen to try this out. I put the .dll in the tS7.5 directory then ra the command to register but got a warning message.


When I run the object in tS I get the following error:

Post by splinters // Oct 24, 2007, 9:39pm

splinters
Total Posts: 4148
pic
Aha, problem solved...you need to run cmd as administrator in Vista...:D


Now I load your object into tS and I see the numbers changing in the xyz and rot xyz fields but nothing is actually happening to the scene.


I am no scripter and rarely delve into the LE but am I supposed to do something else?


Oh, and I clicked on Start after it was started (doh!) and it would not work again until I closed/reopened tS...:o


Any ideas? Very excited to get this working in workspace...:D

Post by MadMouse // Oct 25, 2007, 12:57am

MadMouse
Total Posts: 1069
pic
Just gave this a try and I can confirm the same results as splinters. I can see the input values change as I use my space navigator, but nothing seems to happen to the scene or objects???

What are we doing wrong or is this just a starting point for others to built on???

Edit:

Oh and yes, if you click on the start button again by mistake it locks up until you restart TS

Post by splinters // Oct 25, 2007, 1:53am

splinters
Total Posts: 4148
pic
I wonder if this has to be linked to something, either object or widget.


I hope not because I am useless in the LE...:o

Post by clintonman // Oct 25, 2007, 5:09am

clintonman
Total Posts: 304
pic
Yes, it's just a starting point. Maybe I should have called it a "proof of concept" instead of a demo.

The first step was to write the activex dll's in c++ and get them to work with scripting. Second step was to do a script that would read in the values. The final step which is a mystery at the moment is to make it into a widget node that will take the values and translate them into a form the the other widget nodes can understand. I included all the source code so if someone already knows how to do this last step then they can run with it. The problem might also be solved when Caligari creates and releases the new SDK.


In the mean time I do plan to try to hook it up directly to a camera's matrix.


Clinton

Post by splinters // Oct 25, 2007, 6:09am

splinters
Total Posts: 4148
pic
great news...looking forward to trying this in workspace...eventually...:rolleyes:

Post by Délé // Oct 25, 2007, 8:49am

Délé
Total Posts: 1374
pic
Very Cool Clinton! Nice work! :) :banana:

In the mean time I do plan to try to hook it up directly to a camera's matrix.

That should be possible. Here's some code that can be used to change the EyeCam:


// Execute
// Called to execute the command
function Execute(params)
{
var Yin = params.ConValue('Yin');
var Xin = params.ConValue('Xin');
var Zin = params.ConValue('Zin');
var Yaw = params.ConValue('Yaw');
var Pitch = params.ConValue('Pitch');
var Roll = params.ConValue('Roll');

// Get the name of the EyeCam
Cam = Node.SubObject("/D3DView", 0);

// Set values for EyeCam
Node.Value("/D3DView/" + Cam, "tx") = Xin;
Node.Value("/D3DView/" + Cam, "ty") = Yin;
Node.Value("/D3DView/" + Cam, "tz") = Zin;
Node.Value("/D3DView/" + Cam, "yaw") = Yaw;
Node.Value("/D3DView/" + Cam, "pitch") = Pitch;
Node.Value("/D3DView/" + Cam, "roll") = Roll;
}


This will only work with the Jscript command though, it won't work with the Jscript object. So perhaps you could use a watchdog event to detect any changes from your script and have that trigger the EyeCam script.

This code will also only work with one view. I don't think that's a big issue though because you probably will only be using one perspective view when using a Space Nav device anyway.

Post by clintonman // Oct 25, 2007, 9:24am

clintonman
Total Posts: 304
pic
Great tip! Thanks, Ill look into it.


Clinton

Post by Délé // Oct 25, 2007, 9:34am

Délé
Total Posts: 1374
pic
Here's a quick scene to demonstrate what I mean. If you use the scrubbers to adjust the inputs on the "Cam Move" script, it will move the view around. You should be able to adapt your script that outputs the values to work with this in place of the "Cam Move" script.

Edit: Oh, I hadn't even noticed. I think this solves a problem that I've had for a while. 'doh. We can use this same method to attach an avatar to a vehicle.

Post by frootee // Oct 25, 2007, 9:52am

frootee
Total Posts: 2667
pic
Cool Dele! Looking forward to hooking this up soon!

Post by clintonman // Oct 25, 2007, 11:00am

clintonman
Total Posts: 304
pic
The problem is that the angles are not intuitive. It doesn't give the same motion as a navigation widget where rotation is around an objects center or the up/down left/right motion from camera centered rotations.

Post by clintonman // Oct 28, 2007, 9:59pm

clintonman
Total Posts: 304
pic
I had an idea and got the Space Navigator working with the 3d view camera. Attached is the still incomplete but updated demo. It will crash if the view is changed to a 2D view. You'll have to excuse the long name. I change it when I try different techniques to keep track. In this case it's "Space Navigator Camera Control using Quaternion rotations with the D3D view camera".:o


Anyway it works and I'll do the joystick and fix the bugs next.


Clinton

Post by splinters // Oct 28, 2007, 11:11pm

splinters
Total Posts: 4148
pic
Great, can't wait to try this out...:D

Post by MadMouse // Oct 29, 2007, 10:56am

MadMouse
Total Posts: 1069
pic
I sure its me being dumb but what am I supposed to do with it? When I start it up I get the same results as before?


What view/ camera do I use?? I'm hugely confused:confused::confused::confused::confused:

Post by MadMouse // Oct 29, 2007, 11:01am

MadMouse
Total Posts: 1069
pic
any luck Splinters??????????

Post by splinters // Oct 29, 2007, 11:02am

splinters
Total Posts: 4148
pic
I haven't had chance to try this yet but it sounds like I would have done what Madmouse has done anyway so any further instructions would be welcome...:D

Post by splinters // Oct 29, 2007, 1:28pm

splinters
Total Posts: 4148
pic
any luck Splinters??????????



Indeed I have Mr. Mouse. Works like a dream albeit a bit jerky like some old PC flight simulator, but it definitely works. Just opened a new scene dropped the object in and started using the space navigator.


Did you register the .dll from the last object Clintonman supplied?


Alas, it seems to work only once per windows session. If I stop it then load a new scene and add the object it no longer works...but it did...

Post by splinters // Oct 29, 2007, 1:40pm

splinters
Total Posts: 4148
pic
Mmmm, shame it is so jerky in even a small scene. Good news is that you can actually edit while moving around; something the model side tsx cannot do...:D


Also, tilting the navigator does the same to your view. It would be nice to be able to lock that feature off.


Still this is an excellent start and bodes well for workspace use. Cheers Clintonman.

Post by MadMouse // Oct 29, 2007, 2:48pm

MadMouse
Total Posts: 1069
pic
Did you register the .dll from the last object Clintonman supplied?


Yep, I'm still getting the numbers up but no movement. Do you use the main perspective view Paul?? or a camera??


Edit:


Dont know what I did different, but I just tried it again and it worked :confused:


Not quiet right yet but getting closer!!! Good work Clintonman :banana::banana:


If you can get this fully working I might even start using the workspace side more ;):D

Post by Steinie // Oct 29, 2007, 3:01pm

Steinie
Total Posts: 3667
pic
If you get this working I'm buying the Space Nav!:)

Post by clintonman // Oct 29, 2007, 8:20pm

clintonman
Total Posts: 304
pic
Here's the latest Space Navigator script. This one works with the orthogonal views(instead of crashing) and it's set to run a little bit smoother. Like the original it requires that the dll is registered and it only works with the default views not the camera views. The view roll can't be locked down now because the program doesn't know which way is up, so it needs the roll to manually correct for drift.

The start and stop sequence is like so,

to start - push the start button and then check the checkbox
to stop - uncheck the checkbox and push the stop button

Clinton

Post by splinters // Oct 29, 2007, 11:05pm

splinters
Total Posts: 4148
pic
Wow, progress on this is great Clintonman...but I have to wait until I get home to try it again...;)


Thanks again for this, means a lot...:D

Post by MadMouse // Oct 30, 2007, 11:03am

MadMouse
Total Posts: 1069
pic
Outstanding Clintonman!!! This is almost there now. Much smoother and no crashes so far. To be perfect for me it really needs to be able to be linked to a camera also, so that I can 'look at' the object I'm modeling and spin around it as I work.


We SN users cant thank you enough for the time your taking on this!!!!



@Splinters:- Don't forget you get a lot of control over the SN in its built in driver. Once I'd tweaked this a bit I found control much better.

Post by splinters // Oct 30, 2007, 11:11am

splinters
Total Posts: 4148
pic
Outstanding Clintonman!!! This is almost there now. Much smoother and no crashes so far. To be perfect for me it really needs to be able to be linked to a camera also, so that I can 'look at' the object I'm modeling and spin around it as I work.


We SN users cant thank you enough for the time your taking on this!!!!



@Splinters:- Don't forget you get a lot of control over the SN in its built in driver. Once I'd tweaked this a bit I found control much better.


Agreed, many thanks Clintonman.


Madmouse, what do you mean tweak the drivers? I only ever saw the config panel that lets you set axis etc...:o

Post by MadMouse // Oct 30, 2007, 11:16am

MadMouse
Total Posts: 1069
pic
I only ever saw the config panel that lets you set axis etc...


Thats what I meant. You were asking about locking axis's well this can be done in the config panel. But You know that right? I found that once I'd swapped some of the axis and altered some of the speeds things were much easier to use (for me).



Sorry for the confusion.:o

Post by splinters // Oct 30, 2007, 11:22am

splinters
Total Posts: 4148
pic
Aha, BUT...I turned the roll off and it sort of works but as you move around the scene the view does drift off slightly (tilts).


Also I cannot get this to work each time. I have to close tS down with the object in then reopen. I get an error message but it then works...:o

Post by MadMouse // Oct 30, 2007, 11:37am

MadMouse
Total Posts: 1069
pic
I turned the roll off and it sort of works but as you move around the scene the view does drift off slightly (tilts). yep I see what you mean, you want the horizon to stay level no matter what. No I cant get that either.

Also I cannot get this to work each time. I have to close tS down with the object in then reopen. I get an error message but it then works... Do you mean you have to turn roll off everytime? If so just set the SN up as you want then save the settings as a new layout. Not sure about error messages. As long as I turn off clintonman's 'doohicky' before I close TS everything is fine for me:confused:

If this could be made to work like the jet demo that comes with the SN then I would be very VERY happy. I don't really need to be able to fly round the scene, just move around the object as I work on it.

Post by splinters // Oct 30, 2007, 11:40am

splinters
Total Posts: 4148
pic
No, I load the object into a new scene and it will not work. Need to close tS with that scene open then restart tS, scene loads automatically (annoying at the best of times) I get an error message then the scene works...:confused:

Post by MadMouse // Oct 30, 2007, 11:43am

MadMouse
Total Posts: 1069
pic
Hmmmmmmm. Nope sorry Paul not getting that here. Everything seems fine on that front for me.


Perhaps the god of 3D input devices is making up for me not being able to make the model side TSX work.:o:D
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn