Not really, I just mean to have a room with better graphics.
OpenXR/OpenVR (virtual reality support), new Python workbench WiP
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
-
- Veteran
- Posts: 2189
- Joined: Tue Jan 03, 2017 10:55 am
Re: OpenXR/OpenVR (virtual reality support)
Re: OpenXR/OpenVR (virtual reality support)
Hi kwahoo,
Thank you for all your great work on adding OpenXR support!
It seems that the last update post and pre-release build of the git repo ( https://github.com/kwahoo2/FreeCAD ) were more than 2 months ago. So development seems to have stopped/slowed down and the build of current features (e.g working HMD) looks stable ( https://www.youtube.com/watch?v=K8pXt4s0YU4 ).
I thought it might be a good idea to push the current changes to the mainline so that everyone can use it with the latest features/version.
A 'smaller' commit would also make it easier to review and see what has been added. It would also allow other people ( like me ) to implement additional stuff like edit capability in VR.
Side note: If controller support is still missing we can add that later, since there are many controllers out there (Xbox 360/One, Playstation, Oculus Touch, Vive wand, Hydra's etc, WII motes and other custom things).
Thank you for all your great work on adding OpenXR support!
It seems that the last update post and pre-release build of the git repo ( https://github.com/kwahoo2/FreeCAD ) were more than 2 months ago. So development seems to have stopped/slowed down and the build of current features (e.g working HMD) looks stable ( https://www.youtube.com/watch?v=K8pXt4s0YU4 ).
I thought it might be a good idea to push the current changes to the mainline so that everyone can use it with the latest features/version.
A 'smaller' commit would also make it easier to review and see what has been added. It would also allow other people ( like me ) to implement additional stuff like edit capability in VR.
Side note: If controller support is still missing we can add that later, since there are many controllers out there (Xbox 360/One, Playstation, Oculus Touch, Vive wand, Hydra's etc, WII motes and other custom things).
Re: OpenXR/OpenVR (virtual reality support)
This is because I've started working on a different things lately, and I'm going to return to XR view development later. I still listen for a feedback. The truth is: I have no idea if the code works for others at all. There is no point mainlining not tested code. For testing, there is a preview release.
Also, should I make pull request for OpenXR view or the OpenVR one? Which one gives more compatibility (listening feedback here)? Is there a hardware that supports OpenGL+OpenVR but does not support OpenGL+OpenXR? OpenXR was supposed to be THE VR standard, but current implementations are limited. I cannot even run OpenXR on Nvidia+Linux, because of lack of asynchronous reprojection.
Finally, after seeing how slow is mainline FreeCAD rendering, I'm going to wait for LinkStage3 merge.
Re: OpenXR/OpenVR (virtual reality support)
Btw, do you still use these Xenial/Bionic scripts as the base for your Appimages? I would like to build a custom Appimage based on LinkStage3 brach, but I have to disable Python2/QT4 part and move to Focal, since XR libraries do not exist in older Ubuntu releases.realthunder wrote: ↑Sat Sep 12, 2020 9:09 am Not really, I just mean to have a room with better graphics.
-
- Veteran
- Posts: 2189
- Joined: Tue Jan 03, 2017 10:55 am
Re: OpenXR/OpenVR (virtual reality support)
No, that is for debian packages. The AppImage scripts are here.kwahoo wrote: ↑Sun Oct 25, 2020 2:26 pm Btw, do you still use these Xenial/Bionic scripts as the base for your Appimages? I would like to build a custom Appimage based on LinkStage3 brach, but I have to disable Python2/QT4 part and move to Focal, since XR libraries do not exist in older Ubuntu releases.
Re: OpenXR/OpenVR (virtual reality support)
Thanks, unforunately I cannot get it working (using your repository for testing):realthunder wrote: ↑Sun Oct 25, 2020 9:51 pm
No, that is for debian packages. The AppImage scripts are here.
Code: Select all
+ test conda-fc-dev
+ docker_name=conda-fc-dev
++ date +%Y%m%d
+ date=20201026
+ conda_img_name=FreeCAD-img-Conda-Py3-Qt5-20201026-glibc2.12-x86_64
+ cat
+ bash -c ' docker build -t conda-fc-dev -f tmp.dockfile'
"docker build" requires exactly 1 argument.
See 'docker build --help'.
Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
-
- Veteran
- Posts: 2189
- Joined: Tue Jan 03, 2017 10:55 am
Re: OpenXR/OpenVR (virtual reality support)
Should be fixed now.
Re: OpenXR/OpenVR (virtual reality support)
Thanks, it's fixed.
Re: OpenXR/OpenVR (virtual reality support)
I would like to show a very simple way to get basic creation/modification support in VR using doCommand:
https://forum.freecadweb.org/viewtopic.php?f=10&t=17944
https://wiki.freecadweb.org/Command
Small example, adding a box, when trigger is pressed:
Code added in CoinXRWidget.cpp:
Edit: I did some experimentation in the XRInteraction.cpp https://github.com/kwahoo2/FreeCAD/comm ... b0f245281d
Update: above code may crash, because it seems you should not call Python from another thread https://forum.freecadweb.org/viewtopic. ... =10&t=2597
Edit 2:
I added ray for picking objects. It draws a red sphere where an object is hit https://github.com/kwahoo2/FreeCAD/comm ... dca3002fac

https://forum.freecadweb.org/viewtopic.php?f=10&t=17944
https://wiki.freecadweb.org/Command
Small example, adding a box, when trigger is pressed:
Code added in CoinXRWidget.cpp:
Code: Select all
#include "PreCompiled.h"
#include "CoinXRWidget.h"
#include "Base/Exception.h"
#include <Base/Console.h>
#include <Command.h>
#include "Application.h"
#include "Document.h"
(...)
SbRotation conZrot = SbRotation(conZaxis, xaxis);
SbRotation padrot = SbRotation();
padrot = conXrot * conZrot;
padrot.scaleAngle(0.5f * movSpeed);
transfMod->rotation.setValue(padrot);
worldTransform->combineRight(transfMod);
}
/***** testing command invocation ***/
if (currTriggerVal[i] > 0.5 && oldTriggerVal[i] <= 0.5)
{
double l = 100.0;
double w = 100.0;
double h = 100.0;
App::Document* doc = App::GetApplication().getActiveDocument();
QString cmd = QString::fromLatin1("box = App.getDocument('%1').addObject('%2','%3')\n"
"box.Length = %4\n"
"box.Width = %5\n"
"box.Height = %6\n"
"box.Placement.move(App.Vector(%7, %8, %9))\n"
)
.arg(QString::fromLatin1(doc->getName()))
.arg(QString::fromLatin1("Part::Box"))
.arg(QString::fromLatin1("Cube"))
.arg(l)
.arg(w)
.arg(h)
.arg(conTrans[i]->translation.getValue()[0] * 1000)
.arg(conTrans[i]->translation.getValue()[1] * 1000)
.arg(conTrans[i]->translation.getValue()[2] * 1000);
Gui::Command::doCommand(Gui::Command::Doc, cmd.toUtf8());
doc->recompute();
}
oldTriggerVal[i] = currTriggerVal[i];
/***** ***/
Of course such hard-codding have no sense. But an user could make his own (editable) Python script for interaction, and pass values to the script using doCommand.tran10 wrote: ping
Edit: I did some experimentation in the XRInteraction.cpp https://github.com/kwahoo2/FreeCAD/comm ... b0f245281d
Update: above code may crash, because it seems you should not call Python from another thread https://forum.freecadweb.org/viewtopic. ... =10&t=2597
Edit 2:
I added ray for picking objects. It draws a red sphere where an object is hit https://github.com/kwahoo2/FreeCAD/comm ... dca3002fac

Re: OpenXR/OpenVR (virtual reality support)
Dear All,
I'm pretty novice to FreecadOpenXR, and installded Kwahoo's win64 version next to SteamVR. WMR and StemVR run flawlessly. I came to have the video-part running, but I don't get the controllers to move at all (Lenovo WMR) in Freecad. The controller (one only) lays on the ground and doesn't move along with my physical controllers.
Do you know of settings or software that could be missing or improved? Sorry to disturb you with this, but many-many searches and blind attempts didn't help...
Kind regards, C.
I'm pretty novice to FreecadOpenXR, and installded Kwahoo's win64 version next to SteamVR. WMR and StemVR run flawlessly. I came to have the video-part running, but I don't get the controllers to move at all (Lenovo WMR) in Freecad. The controller (one only) lays on the ground and doesn't move along with my physical controllers.
Do you know of settings or software that could be missing or improved? Sorry to disturb you with this, but many-many searches and blind attempts didn't help...
Kind regards, C.