Difference between revisions of "User:Tohline/Appendix/Ramblings/VirtualReality"

From VistrailsWiki
Jump to navigation Jump to search
Line 65: Line 65:


==Good Cube Example==
==Good Cube Example==
A useful ''Cube.dae'' example can be found in Appendix A of the PDF-formatted document titled, [https://www.khronos.org/files/collada_spec_1_4.pdf COLLADA &#8212; Digital Asset Schema Release 1.4.1] &#8212; Specification (2<sup>nd</sup> Edition), March 2008.  I was able to execute/display this file using my Mac's Preview app after trimming it down a bit.  (When I tried to "copy" then "paste" this text file into my Mac's ''vi'' editor, it did not initially execute properly in the Preview app, so I removed some lines of the ''xml'' code in an effort to debug my file.  This ''trimming'' may not have been necessary because, in the end, I realized that the essential spacings between integer vertex values and integer normal values in the ''polygons'' specification had disappeared during the copy-and-paste operation.)  Here is my version of this executable COLLADA (.dae) file, created 2 September 2019.
A useful ''Cube.dae'' example can be found in Appendix A of the PDF-formatted document titled, [https://www.khronos.org/files/collada_spec_1_4.pdf COLLADA &#8212; Digital Asset Schema Release 1.4.1] &#8212; Specification (2<sup>nd</sup> Edition), March 2008.  I was able to execute/display this file using my Mac's Preview app after trimming it down a bit.  (When I tried to "copy" then "paste" this text file into my Mac's ''vi'' editor, it did not initially execute properly in the Preview app, so I removed some lines of the ''xml'' code in an effort to debug my file.  This ''trimming'' may not have been necessary because, in the end, I realized that the essential spacings between integer vertex values and integer normal values in the ''polygons'' specification had disappeared during the copy-and-paste operation.)  Here is my version of this executable COLLADA (.dae) file, created 2 September 2019; on my Mac, the filename is
<div align="center">'''/Dropbox/3Dviewers/Cube/ThirdCube/AppendA06Works.dae'''</div>


<pre>
<pre>

Revision as of 16:17, 3 September 2019


Virtual Reality and 3D Printing

[Circa August 2019] I am once again considering whether steady improvements in certain digital technologies over the past half-a-dozen years can be straightforwardly called upon to display to a broad audience the three-dimensional characteristics of rapidly rotating fluid systems. Two specific technologies come to mind: (1) 3D printing; and (2) XR (virtual reality). A cursory online investigation suggests that we may be able to import OBJ-formatted files into the software algorithms that drive these two technologies. In addition, the popular Unity design tool may serve us well in our efforts to build/view/export such files.

Whitworth's (1981) Isothermal Free-Energy Surface
|   Tiled Menu   |   Tables of Content   |  Banner Video   |  Tohline Home Page   |

Initial Browsing of Online Resources

  • DAE files & XML COLLADA format   <--   the Preview application on my MacBook Air will open/display a .DAE file
    • A file with the DAE file extension is a Digital Asset Exchange file. DAE files are based on the COLLADA (COLLAborative Design Activity) XML schema, which is now owned and developed by Autodesk (e.g., Maya). DAE files allow users to transmit 3D graphics files across multiple graphics applications.
    • Examples:

      cube.dae  <--   NOTE: I have copied this "dae" file into a dropbox folder and have successfully modified it (changed color from red to purple) inside my txt editor.

      In March 2011, Khronos released the COLLADA Conformance Test Suite (CTS). The suite allows applications that import and export COLLADA to test against a large suite of examples, ensuring that they conform properly to the specification. In July 2012, the CTS software was released on GitHub — also see, an associated PDF document, and OpenCOLLADA hosted on Github — allowing for community contributions.

      Check out turbosquid.com; or Free3d

    • August 2013:  Autodesk has released Maya LT with COLLADA export capabilities.
  • Four most common 3D printer file formats in 2019.
    • STL:
      File Format Simply Explained.

      As of today, STL is the undisputed champion among 3D printer file formats. STL’s history goes back to the invention of 3D printing itself. The first 3D printer was invented by Chuck Hull in 1987 at 3D Systems. The same guy was behind the STL file format. If you are primarily printing with a single material and in a single color, STL will do the job. But the moment you move to multicolor printing, you have to ditch STL because it is simply not capable of storing colors.

      There are many repositories, marketplaces and search engines on the web containing literally millions of free STL files. Thingiverse is probably the largest STL file repository on the internet – so check it out. You can also refer to our regularly updated list: Best Sites for Free STL Files & 3D Printer Models.

      STL File Viewers

    • OBJ:

      File format explained.

      Format developed by Wavefront; note that a number of the above-referenced STL viewers will also view OBJ files.

    • AMF
    • 3MF
  • Try this online 3D converter; in principle, it can be used to convert a DAE (i.e., COLLADA) file to an STL or OBJ file, and visa versa.
  • Unity
    • See especially the Products page which briefly refers to …
      • Platforms: Build once, deploy anywhere to reach the largest possible audience on our industry-leading platform; 25+ platforms across mobile, desktop, console, TV, VR (virtual reality), AR (augmented reality) and the Web.
      • XR: Powering over two-thirds of VR and AR experiences; Unity is the preferred development tool for the majority of XR creators.
  • Unreal Engine 4 — competitor of Unity
  • Oculus Rift S driven by PC; or Oculus Quest, standalone 6DOF VR — looks like they both can be driven by either Unity or Unreal, or via the Native Platform provided by Oculus.
    • In principle, the Oculus Rift can import new, user-supplied 3D scenes — see the advanced help document — but, for now, it only accepts files in GLB format.
    • But see the import feature of Oculus Medium 2.0.
    • GLB format:  a binary form of glTF that includes textures instead of referencing them as external images.
    • glTF:   (derivative short form of GL Transmission Format) is a file format for 3D scenes and models using the JSON standard. It is an API-neutral runtime asset delivery format developed by the Khronos Group 3D Formats Working Group. It was announced at HTML5DevConf 2016. This format is intended to be an efficient, interoperable format with minimum file size and runtime processing by apps. As such, its creators have described it as the "JPEG of 3D."
  • Gear VR — Samsung's headset (powered by Oculus)

    GearVR Framework is the SDK for Samsung's Gear VR.
  • Also consider Oculus Go
  • vtk has vtkOBJExporter as well as vtkOBJReader
  • Kitware may also be relevant
  • Jinghua Ge's CCT-based visualization lab course
  • Look into the VR Model Viewer from MindRend Technologies, which "is a tool to import and view CAD models of various types in VR."

    It claims to provide support for three of the four formats identified above in connection with 3D printers, namely: STL, OBJ (with MTL file), and 3MF.

    It supports the following VR headsets: Oculus Rift and HTC Vive.

Best Info, to Date

  1. Check out the Khronos Group's Overview of glTF; note that GLB is the binary form of glTF.
  2. Evidently, a user's native 3D scene can be transferred (in GLB format) to the Oculus Medium 2.0, and then viewed with Oculus-supported headgear.

    An Oculus blog posted 14 February 2019 and titled, "Rift Platform Updates: Create Your Own Space," states the following … "Home is no longer limited to the stock cabin model. Now, we give you a couple templates, a cafe and theater, plus special themed decor and furniture items to play with — and you can upload any additional 3D models you’d like." See more details here.

  3. DAE (i.e., XML COLLADA-formatted) files …
    1. The Mac's Preview application can display DAE files — see, for example, cube.dae.
    2. Evidently I should expect most 3D printers to accept DAE-formatted files as well as the older and more familiar STL and OBJ files.
    3. Check out the Khronos Group's Overview of COLLADA.
    4. COLLADA Tutorials
    5. Animation Tutorial

I wonder if even very simple DAE files can be converted to glTF (and GLB) files; perhaps the tools, glTF API or COLLADA2GLTF will work. If so, then we can kill two birds with one stone; i.e., simply build DAE files, then they should be straightforwardly ported to Oculus headgear or a 3D printer.

Good Cube Example

A useful Cube.dae example can be found in Appendix A of the PDF-formatted document titled, COLLADA — Digital Asset Schema Release 1.4.1 — Specification (2nd Edition), March 2008. I was able to execute/display this file using my Mac's Preview app after trimming it down a bit. (When I tried to "copy" then "paste" this text file into my Mac's vi editor, it did not initially execute properly in the Preview app, so I removed some lines of the xml code in an effort to debug my file. This trimming may not have been necessary because, in the end, I realized that the essential spacings between integer vertex values and integer normal values in the polygons specification had disappeared during the copy-and-paste operation.) Here is my version of this executable COLLADA (.dae) file, created 2 September 2019; on my Mac, the filename is

/Dropbox/3Dviewers/Cube/ThirdCube/AppendA06Works.dae
<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
  <asset>
    <created>2005-11-14T02:16:38Z</created>
    <modified>2005-11-15T11:36:38Z</modified>
    <revision>1.0</revision>
  </asset>
  <library_effects>
    <effect id="whitePhong">
      <profile_COMMON>
        <technique sid="phong1">
          <phong>
            <diffuse>
              <color>0.8 0.0 0.8 1.0</color>
            </diffuse>
          </phong>
        </technique>
      </profile_COMMON>
    </effect>
  </library_effects>
<!--                 -->
  <library_materials>
    <material id="whiteMaterial">
      <instance_effect url="#whitePhong"/>
    </material>
  </library_materials>
  <library_geometries>
    <geometry id="box" name="box">
      <mesh>
        <source id="box-Pos">
          <float_array id="box-Pos-array" count="24">
           -0.5  0.5  0.5
            0.5  0.5  0.5
           -0.5 -0.5  0.5
            0.5 -0.5  0.5
           -0.5  0.5 -0.5
            0.5  0.5 -0.5
           -0.5 -0.5 -0.5
            0.5 -0.5 -0.5
          </float_array>
          <technique_common>
            <accessor source="#box-Pos-array" count="8" stride="3">
              <param name="X" type="float" />
              <param name="Y" type="float" />
              <param name="Z" type="float" />
            </accessor>
          </technique_common>
        </source>
        <source id="box-0-Normal">
          <float_array id="box-0-Normal-array" count="18">
           1.0  0.0  0.0
          -1.0  0.0  0.0
           0.0  1.0  0.0
           0.0 -1.0  0.0
           0.0  0.0  1.0
           0.0  0.0 -1.0
          </float_array>
          <technique_common>
            <accessor source="#box-0-Normal-array" count="6" stride="3">
              <param name="X" type="float"/>
              <param name="Y" type="float"/>
              <param name="Z" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <vertices id="box-Vtx">
          <input semantic="POSITION" source="#box-Pos"/>
        </vertices>
<!--
The 6 separate polygons define the 6 sides of the "cube"; hence, each polygon will
have 4 vertices and 4 associated normals.
As identified in this xml file, the vertices + associated normal for each side/polygon
are listed between the <p></p> notation; the vertex number and associated normal
are interleaved such that the normal is offset by "1".  For example, the first of
the 6 sides/polygons is defined by connecting vertices:  0 -> 2 -> 3 -> 1 -> back to 0;
while all four normals are assigned the direction/number "4".
-->
        <polygons count="6" material="WHITE">
          <input semantic="VERTEX" source="#box-Vtx" offset="0"/>
          <input semantic="NORMAL" source="#box-0-Normal" offset="1"/>
          <p>0 4 2 4 3 4 1 4</p>
          <p>0 2 1 2 5 2 4 2</p>
          <p>6 3 7 3 3 3 2 3</p>
          <p>0 1 4 1 6 1 2 1</p>
          <p>3 0 7 0 5 0 1 0</p>
          <p>5 5 7 5 6 5 4 5</p>
        </polygons>
      </mesh>
    </geometry>
  </library_geometries>
  <library_visual_scenes>
    <visual_scene id="DefaultScene">
      <node id="Box" name="Box">
        <translate> 0  0  3</translate>
        <rotate> 0  0  1  0</rotate>
        <rotate> 0  1  0  0</rotate>
        <rotate> 1  0  0  0</rotate>
        <scale>  1  1  0.2</scale>
        <instance_geometry url="#box">
          <bind_material>
            <technique_common>
              <instance_material symbol="WHITE" target="#whiteMaterial"/>
            </technique_common>
          </bind_material>
        </instance_geometry>
      </node>
    </visual_scene>
  </library_visual_scenes>
  <scene>
    <instance_visual_scene url="#DefaultScene"/>
  </scene>
</COLLADA>


Whitworth's (1981) Isothermal Free-Energy Surface

© 2014 - 2021 by Joel E. Tohline
|   H_Book Home   |   YouTube   |
Appendices: | Equations | Variables | References | Ramblings | Images | myphys.lsu | ADS |
Recommended citation:   Tohline, Joel E. (2021), The Structure, Stability, & Dynamics of Self-Gravitating Fluids, a (MediaWiki-based) Vistrails.org publication, https://www.vistrails.org/index.php/User:Tohline/citation