GLTF - JPG for 3D Objects in WebVR

GLTF - JPG for 3D Objects in WebVR

By Steve Luiting - October 29, 2017

In the image above I added a 3D model of our building into a procedurally generated landscape. The landscape is a new component that allows you to add a scene with one line of code in the <scene> code. The component is javascript based.

The GLTF was made by creating the building in Sketchup and exporting it as a .obj and .mtl file. I then created a Sketchfab account and uploaded the model. Sketchfab has a great GLTF converter. So, I set the file to allow download and as I do it asks what type I would like to download and I chose gltf. You can see the example here: https://www.cablecenter.org/vr/gltf/

The file is 15MB in size and yet it loads on a good connection in three to five seconds. I could, in the future, optimize the model. I am considering rebuilding the model in VR using Gravity Sketch, https://youtu.be/XDCmDjs9z5I. I would rebuild it in three parts allowing for three downloads as opposed to one large one.

GLTF is now in version two which allows for animation. This works in A-Frame version 7. If you want to use GLTF 7 and you have an older format you need to load an extension that allows GLTF version one to show up.

So, in the HTML header, I add these components:

<script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>

?<script src="https://rawgit.com/fernandojsg/aframe-teleport-controls/master/dist/aframe-teleport-controls.min.js"></script>

?<script src="https://unpkg.com/[email protected]/dist/aframe-environment-component.min.js"></script>?

Above the <scene> I add the preload of the building:

???<a-assets>

<a-asset-item id="building" src="scene.gltf"></a-asset-item>

???</a-assets>

In the scene I add:

<a-entity gltf-model="#building" position="-50.10 -1 60" scale="0.020 0.020 0.020" rotation="0 0 0"></a-entity>??

For more gltf information: https://aframe.io/docs/0.7.0/components/gltf-model.html#sidebar

The information about the environment component is here:

https://blog.mozvr.com/aframe-environment-component/


要查看或添加评论,请登录

Steve Luiting的更多文章

  • The Resurrection of Flash Animation

    The Resurrection of Flash Animation

    Back from the dead Steve Jobs in 2010, wrote an open letter titled "Thoughts on Flash," in which he criticized Flash…

  • The Evolution of Memories: From Images to Experiences

    The Evolution of Memories: From Images to Experiences

    D to 4D G-Splats in VR and AR In the vast landscape of digital content, we've witnessed an evolution from grainy black…

  • Unity VS A-Frame

    Unity VS A-Frame

    So, this is the second of a series documenting my path down the rabbit hole in using JavaScript/A-Frame instead of…

    3 条评论
  • A-Frame and WebVR

    A-Frame and WebVR

    Update: 9/13/2017 I am following up on my thought processes with AFrame. Mouse capability has been added to the latest…

  • Buying Bitcoin made easy

    Buying Bitcoin made easy

    In the USA go to coinbase.com and setup an account.

  • The fragmentation of the Internet? Ethereum vs Blockstack

    The fragmentation of the Internet? Ethereum vs Blockstack

    Steve Luiting My bet is on Ethereum and IPFS but it looks like Wall Street big money is backing Blockstack. It could…

    1 条评论
  • 360 Video in VR is not Theater

    360 Video in VR is not Theater

    I've been holding my tongue for some time now when listening to so-called "experts" in storytelling as they stand on…

  • Microsoft: Where's my VR Windows?

    Microsoft: Where's my VR Windows?

    OK. I've waited two years now for Microsoft to get off of its butt and create a VR version of Windows.

  • GearVR or HoloLens?

    GearVR or HoloLens?

    I was using my GearVR the other day when a new app appeared in the app store named Spectacle. Spectacle is written by a…

    2 条评论
  • Will Virtual Reality Kill the Internet?

    Will Virtual Reality Kill the Internet?

    I've been working building web pages since 1991. The web has always been similar to print in that we have "pages" and…

    3 条评论

社区洞察

其他会员也浏览了