Editing
ThreeDimensionalConfigurations/MeetsCOLLADAandOculusRiftS
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Inside the Oculus Rift S Environment== ===Introduction=== The [https://www.oculus.com/rift-s/ Oculus Rift S] will import user-constructed 3D objects and allow you to place those objects in a high-quality, interactive virtual reality (VR) environment. But the Oculus system does not accept COLLADA-formatted files directly. Instead, it is set up to import files that are in a ".glb" format, which is the binary version of a "GL Transmission Format" ([https://www.khronos.org/gltf/ glTF]) file. My original expectation was that, after I learned how to construct some intricate and astrophysically interesting 3D visual scenes using COLLADA — successfully accomplished (!) as illustrated above — all I would need to do is find a community tool that could translate a COLLADA (.dae) file into glTF (.glb). Here are a few discoveries I made along the way: <ul> <li>The Windows 10 startup menu includes a "3D Viewer" app but, at least on my Lenova PC, it does not recognize .dae-formatted files.</li> <li>The Windows 10 startup menu includes a "Paint 3D" application. Using this app, it was very easy to "draw" some simple 3D geometric objects — such as a cube or a torus — and it was straightforward to export each object to a .glb-formatted file.</li> <li>[https://www.adobe.com/products/photoshop.html Adobe Photoshop] can read in a COLLADA (.dae) file and it is capable of exporting a 3D scene in .glb format.</li> <li>[https://blackthread.io BlackThread.io] offers a browser-based tool, named "glTF Converter", that can ostensibly translate .dae-formatted files into .glb-formatted files.</li> <li>The [https://www.khronos.org Khronos Group]'s "COLLADA to glTF" conversion tool can be located under [https://github.com/KhronosGroup/COLLADA2GLTF/ the group's name on GitHub].</li> </ul> ===Khronos Group's COLLADA2GLTF Converter=== Among this group of potentially useful tools, we have had — by far — the most success/luck using the <font color="red">Khronos Group's COLLADA2GLTF</font> converter. We downloaded and installed version 2 of this Khronos Group conversion tool on our Mac Pro. The executable, named <b>COLLADA2GLTF-bin</b>, was installed on our Mac at the end of a directory tree named …/Dropbox/Lenovo/COLLADA_to_gltf/COLLADA2GLTF-v2/. In order to translate a specific COLLADA-formatted (''filename.dae) file: <ul> <li>From inside the Mac's "Terminal" application, we changed directories until we were sitting in the above-specified Mac (Dropbox) directory</li> <li>We moved (or copied) the chosen COLLADA-formatted file (<b>''filename''.dae</b>) into the same directory <li>At the terminal prompt, we typed the line command: <b>./COLLADA2GLTF-bin -i ''filename''.dae -b</b></li> <li>The .glb-formatted output file was stored as <b>…/Dropbox/Lenovo/COLLADA_to_gltf/COLLADA2GLTF-v2/output/''filename''.glb</b></li> </ul> <table border="1" cellpadding="8" align="center"> <tr> <td align="center">Example Mac-Pro Line Commands + Responses</td> </tr> <tr><td align="left"> <pre> command: pwd response: ../Dropbox/Lenovo/COLLADA_to_gltf/COLLADA2GLTF-v2 command: ls *.dae response: Inertial17.dae command: ./COLLADA2GLTF-bin -i Inertial17.dae -b response: Converting Inertial17.dae -> output/Inertial17.glb Time: 48.166 ms </pre> </td></tr> </table> <font color="red">CAUTION!</font> While we found this COLLADA2GLTF converter to be a very useful tool, we also discovered that porting a model from one visualization environment to another can be a challenging and frustrating endeavor. It is difficult enough to build a (error-free) COLLADA-formatted model that will properly display a desired animated scene in the Mac's Preview app. But it is naive to expect that that same COLLADA code will survive a translation to glTF and seamlessly construct the identical animated scene within the Oculus Rift S environment. In a pair of accompanying chapters — [[Appendix/Ramblings/OculusRiftS|this one]], followed by [[Appendix/Ramblings/RiemannMeetsOculus#Rebuild_Riemann_S-Type_Ellipsoid_Inside_Oculus_Rift_S_Environment|another one]] — we have chronicled the steps that we have taken to generate our first few (error-free) COLLADA-based models that display properly in both environments. Experience has taught us that … (1) When interpreting COLLADA's <xml>-formatted instructions, the Mac's Preview app is considerably more forgiving than is the Oculus system; (2) almost any code that display's properly in the Mac's Preview app will survive the translation to glTF, in the sense that the COLLADA2GLTF converter seldom complains; but, (3) nevertheless, frequently the Oculus system won't display the model because it detects an error(s), but it almost never suggests what the error(s) might be. When embarking on the development of a new interactive and animated 3D visual scene, the best strategy is a time-consuming one: Start with a COLLADA code that works in both environments — we provide two such codes herein; make only incremental changes and ensure that the model displays properly in the Mac's Preview app; convert the COLLADA-based code to glTF (.glb); don the Oculus Rift S headset & hand controllers, and attempt to import this new model into your "Oculus Home". ===Import to Oculus Rift S Environment=== We purchased a Lenovo PC (Windows 10) gaming laptop to drive the Oculus Rift S system; more specifically, it is Lenovo's Legion Y740 15" with NVIDIA GeForce GTX 1660Ti 6GB. Two connections were required: (1) Mini DisplayPort; and (2) USB. We downloaded and installed the Oculus program files under the directory <b>C:\Program Files\Oculus</b>. We also mounted Dropbox on the Lenovo, which gave us immediate access to the model files that were created using the Mac Pro. As an example, we located the model file named <b>Inertial17.glb</b> and placed a copy of the file in the directory <b>… This PC\Documents\Oculus Home\_Import</b>. Any (error free) ".glb"-formatted file that is located in this directory is available for import into the Oculus' 3D virtual-reality environment. When we want to view one of our models, we first start the Oculus application on the Lenovo then click on "Devices" to check whether the headset and two hand controllers are in proper communication with the PC (GREEN buttons) or not (RED buttons). We don the headset & controllers, thereby entering the Oculus Rift S VR environment. [Occasionally we forget to start the Oculus app before putting on the headset. When this happens, the app seems to sense that we have donned the headset and it starts itself!] The following sequence of steps allows us to place the example model, <b>Inertial17</b>, into our ''Oculus Home''. <table border="1" align="left" width="100%" cellpadding="8"> <tr> <th align="center" colspan="2"><font size="+1">Inside the ''Oculus Rift S'' Home Environment</font></th> </tr> <tr> <td align="center">[[File:HomeImage01sm.png|200px|Oculus Home (view 1)]]</td> <td align="left">The image shown here, immediately to the left, is a snapshot of the first scene that is displayed in our ''Oculus Home'' shortly after we have donned the headset and the pair of hand controllers. The shallow, curved desk immediately in front of us presents ten or so clickable panels (menu choices). In the image, we have highlighted the "Home" button by pointing to it with the index finger of our right hand. <ul> <li><font color="red">Click</font> on the "Home" button; the interactive panels in this scene will disappear.</li> <li>Wait (~ 10 seconds) and our stored "Home" environment will load.</li> <li>"Menu" button vs. "Oculus" button</li> </ul> </td> </tr> <tr> <td align="center">[[File:HomeImage02sm.mod.png|200px|Oculus Home (view 2)]]</td> <td align="left"> <ul> <li><font color="red">Click</font> the "Menu" button on the left-hand controller; it sits just below the "Y" and "X" buttons;</li> </ul> The image shown here, immediately to the left, is a snapshot of a portion of the scene that is displayed after we have clicked the "Menu" button on our left-hand controller. As illustrated, we have pointed to — and thereby have highlighted in blue — the top menu item, "<font color="blue">Places</font>," and we are in the process of sliding our aim down to the next menu item, "Inventory." <ul> <li><font color="red">Click</font> the "Inventory" menu item.</li> </ul> </td> </tr> <tr> <td align="center">[[File:HomeImage03sm.mod.png|200px|Oculus Home (view 3)]]</td> <td align="left"> As is shown here, immediately to the left, the menu panel is updated after the "Inventory" button has been clicked, as directed above. <ul> <li><font color="red">Click</font> the "My Imports" menu item.</li> </ul> After highlighting then clicking "<font color="blue">My Imports</font>," a three-dimensional display case (a shadow box) containing up to 4 × 3 objects appears, as is illustrated here in the screenshot on the left. Each object in this display case is generated from one of the (error free) ".glb"-formatted files that is located in the aforementioned Lenovo directory <b>… This PC\Documents\Oculus Home\_Import</b> — including files that reside in subdirectories of this parent _Import directory. </td> </tr> <tr> <td align="left" colspan="2"> NOTE: <ul> <li>The display case can hold more than twelve objects, but it will only display twelve at a time. In order to see more, you need to point to (any) one of the displayed objects then use the hand-controller's toggle button to scroll the shelves of the display case up or down.</li> <li>If Oculus sees a (error free) ".glb" file that it has never seen before — for example, a new model file that you have just placed in the PC's <b>…\_Import</b> directory — it will display a panel asking you to "<font color="blue">Confirm</font>" that you have permission to load this material.</li> <li>If the Oculus determines that one of your ".glb" files contains an error, it may try to display the faulty object in the display case and attach some sort of warning message. More often than not, however, it will simply ignore the file and leave you wondering why the object does not appear in the display case. </ul> </td> </tr> <tr> <td align="center">[[File:HomeImage04sm.mod.png|200px|Oculus Home (view 4)]]</td> <td align="left"> <ul> <li>Point at an object in the display case, then <font color="red">Grab</font> it (using the controller's middle-finger "grip" switch) and place it somewhere in your ''Home'' room.</li> </ul> In the image shown here, immediately on the left, we are pointing at, and are about to "grab", the model we have named, <b>MultiLagrange18</b>. We could have, just as well, pointed at and grabbed the model sitting on the shelf next to it named, <b>Inertial17</b>. <br /> It is worth mentioning that after you have ''grabbed'' an object — and before you have placed it in the room — you can do several things with it. <ol><li>Using the hand controller's ''thumbstick'', you can move the object farther from (or closer to) you by pushing the thumbstick away from you (or by pulling it toward you).</li> <li>Using the controller's index-finger ''trigger'', you can toggle between a mode that lets you spin the object and a mode that let's you resize it. In either mode, the direction or amplitude of the spin/resizing is determined by pushing the ''thumbstick'' to the left or right varying amounts.</li> </ol> </td> </tr> <tr> <td align="center">[[File:HomeImage05sm.png|200px|Oculus Home (view 5)]]</td> <td align="left"> The image shown here, immediately on the left, is a snapshot of our Oculus ''Home'' shortly after our model named, <b>Inertial17</b>, has been resized (enlarged) then placed in the room. </td> </tr> <tr> <td align="left" colspan="2"> NOTE: The steps required to remove a model from the "<font color="blue">My Imports</font>" Inventory — that is, from the display case — are not easy to guess. Here we identify what appears to be the required sequence of steps, using our model, <b>MultiLagrange18</b>, as an example. <ul> <li>Assuming the <b>MultiLagrange18</b> model is one of the objects that is on display in the ''Oculus Home'' room, grab it with the right-hand controller and use the index-finger "trigger" to toggle to the mode that lets you spin the object (the resize mode does not seem to work for this task).</li> <li>Press the "B" button; this should return the object to the "My Imports" display case.</li> <li>Point your index finger at the compartment on the "My Imports" display case that contains the (miniaturized) <b>MultiLagrange18</b> model, then use your thumb to press the "B" controller button. [Be careful not to squeeze the "grip" button with your middle finger instead, as you will end up unintentionally grabbing the object again.] A small panel containing bibliographical information about the <b>MultiLagrange18</b> file will appear immediately in front of your face; an even smaller accompanying panel will ask if you want to "Remove Upload", that is, do you want to remove the file from the inventory.</li> <li>Point your index finger at the smaller of these two panels and click on it (using the middle finger's "grip" button) to indicate you want the file removed. The panels will disappear but, confusingly, the inventory display box will not change in any way to signify that your request is being implemented.</li> <li>Remove the headset; sit down in front of the Lenovo PC; locate the <b>MultiLagrange18.glb</b> that has been stored in the Oculus' _Import directory and trash it! The next time you don the Oculus Rift S headset and look at the "My Imports" display case, the <b>MultiLagrange18</b> will no lonber be among the group of displayed objects. </ul> </td> </tr> </table> <p> </p> <table border="1" align="center" cellpadding="0" width="710px" cellpadding="5"> <tr> <th align="center" colspan="2"><font size="+1">Additional Photos from Inside the ''Oculus Rift S'' Home Environment</font></th> </tr> <tr> <td align="center">[[File:B41c385 Oculus03.jpg|350px|Third Oculus Rift Selfie]]</td> <td align="center">[[File:B41c385 Oculus02.jpg|350px|Second Oculus Rift Selfie]]</td> </tr> <tr> <td align="center" colspan="2">[[File:B41c385 Oculus01.jpg|700px|Third Oculus Rift Selfie]]</td> </tr> <tr> <td align="left" colspan="2"> Two of our COLLADA-driven animated models can be identified in each of the three frames of this image montage: In all three cases, the one on the right is model <b>Inertial17</b> and the one on the left is model <b>MultiLagrange18</b>. The bottom (selfie) visual scene illustrates that we can add to our Oculus home environment other items that are straightforwardly selected from a large Oculus objects inventory. </td> </tr> </table>
Summary:
Please note that all contributions to JETohlineWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
JETohlineWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Tiled Menu
Table of Contents
Old (VisTrails) Cover
Appendices
Variables & Parameters
Key Equations
Special Functions
Permissions
Formats
References
lsuPhys
Ramblings
Uploaded Images
Originals
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information