samuelgoto / arpub

AR Content Publishing
9 stars 0 forks source link

Explicit support for 3D assets #2

Open skonig-google opened 6 years ago

skonig-google commented 6 years ago

Many AR experiences involve placing 3D assets (e.g., glTF models) into the real world. Most of our examples to date have been about bringing 2D assets into the real world though.

I wonder if it's worth having explicit support for 3D models as an asset type. Doing so could also provide properties or constraints about how the 3D object should be rendered, for example:

An example of such an annotation might be the following:

    <script type=”application/ld+json”>
    {
      @context: “https://schema.org/”,
      @type: Artifact,
      asset: {
        @type: 3DModel,
        url: "http://myblog.com/egyptian_vase.gltf",
        constraints: {
           renderOn: "horizontal plane",
           size: "actual"
        }
      },
      landmark: {
        @type: GeoCoordinates,  
        latitude: “37.4334”,
        longitude: “122.0872”
      }
    }  
  </script>
samuelgoto commented 6 years ago

Ha, that's very interesting.

Can you help me get some clarity at where to draw the line between things that should go into GLTF-like formats and 3DModel? How should we think about the relationship between these two things from a layering perspective?

Would something along the lines of "GLTF is to 3DModel as JPEG is to <img>?" That is, you use JPEG to store/serve an image, but you use <img> to set its scale (e.g. <img width="123" height="456">) and position (e.g. <img style="position: absolute; x: 123px; y: 456px;">). Or is a better analogy here something akin to "GTLF is to 3DModel as JPEG is to SVG"?

Is that the way you are thinking of 3DModel?

Taking the <img> tag analogy further, can you have (and position and scale) more than one GLTF model in a 3DModel (e.g. composition)?

samuelgoto commented 6 years ago

Also, since this just came out today too, wondering what would be the relationship between 3DModel and web-components based models. Example:

https://magicleaphelio.com/devsamples/animated-model

 <ml-model
          id="birdModel"
          src="res-2/hummingbird.fbx"
          materials="
            kmat: res-2/hummingbird_Material.kmat;
            textures:
              res-2/hummingbird_Material_Albedo.png
              res-2/hummingbird_Material_Reflection.png
              res-2/hummingbird_Material_AO.png
              res-2/hummingbird_Material_Normal.png;"
          model-scale="0.3 0.3 0.3"
          model-animation="flightLoop, false, -1"
          model-animation-speed="1"
          z-offset="300">
        </ml-model>
skonig-google commented 6 years ago

Yeah, the relationship between glTF and 3DModel is like JPG to . For one thing there are different 3D model formats (Apple has proposed USDZ for example), but conceptually they both represent 3D models and they both would have constraints that are independent of the format (like where they can be placed).

In the short term a web component could be used to provide declarative markup around 3D models, since the only way to render them at present is via WebGL. In the medium term a proper tag may make sense.

On Wed, Aug 8, 2018 at 7:13 PM sam goto notifications@github.com wrote:

Also, since this just came out today too, wondering what would be the relationship between 3DModel and web-components based models. Example:

https://magicleaphelio.com/devsamples/animated-model

<ml-model id="birdModel" src="res-2/hummingbird.fbx" materials=" kmat: res-2/hummingbird_Material.kmat; textures: res-2/hummingbird_Material_Albedo.png res-2/hummingbird_Material_Reflection.png res-2/hummingbird_Material_AO.png res-2/hummingbird_Material_Normal.png;" model-scale="0.3 0.3 0.3" model-animation="flightLoop, false, -1" model-animation-speed="1" z-offset="300">

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/samuelgoto/arpub/issues/2#issuecomment-411583326, or mute the thread https://github.com/notifications/unsubscribe-auth/APftR8jDCDWXo1YSBoAaT9sIQKjNasdzks5uO3CmgaJpZM4VssfY .