Code Monkey home page Code Monkey logo

Comments (8)

sirkitree avatar sirkitree commented on July 20, 2024

I wrote up some code to see how this might look. Here's a prototype:

/**
 * objLocation should be the http location of the file without the extension.
 * we will automatically assume that an obj file and an mtl file are present.
 * ex: https://raw.githubusercontent.com/bitgridio/models/gh-pages/lullabot/Body
 */
var loadObjMtl = function(objLocation) {
  var loader = new THREE.OBJMTLLoader(manager)
  loader.load(
    objLocation + '.obj',
    objLocation + '.mtl',
    function(obj) {
      console.log(obj)
      VR.scene.add(obj)
    },
    function(xhr) {
      console.log(xhr.loaded + ' bytes loaded')
    },
    function(xhr) {
      console.log('Error loading object')
    }
  )
}

loadObjMtl('https://raw.githubusercontent.com/bitgridio/models/gh-pages/lullabot/Body')
loadObjMtl('https://raw.githubusercontent.com/bitgridio/models/gh-pages/lullabot/Headd')

If you think something like this would be a good addition to this library, let me know and I'll look at your source and see what might be a good way to implement it as a VR.prototype or something.

from webvr-starter-kit.

brianchirls avatar brianchirls commented on July 20, 2024

This is a good idea. I'll see if I can whip something up. There are a couple things I need to think about though...

  1. Is there a good place for people to host obj files if they don't have their own servers? Need CORS headers.
  2. What's the best way to design the API to allow for multiple object formats?
  3. How many different object formats do we need to support? Each one comes at a cost of making the script file a bit larger.

from webvr-starter-kit.

sirkitree avatar sirkitree commented on July 20, 2024

Not sure about the first two, but for the third I'd suggests starting with .obj (these can have multiple textures though so not sure that my approach in assuming .mtl is going to pan out), .dae (collada), .fbx?

from webvr-starter-kit.

brianchirls avatar brianchirls commented on July 20, 2024

I think I will start with obj since it seems to be the most popular. Collada is also popular, but I think the files are quite large and slow to parse. So they're not great for deployment on the web.

I've put off building this because everything else about the library is meant to be as self-contained as possible, for people who may not have easy access to their own servers. jsbin is fine for hosting prototype code; imgur.com is good at hosting images. But I haven't found a good place to store video, audio or 3d models. So it's unlikely this feature will be used by some beginners. I would like to find a way to solve that problem. I'm open to suggestions...

from webvr-starter-kit.

brianchirls avatar brianchirls commented on July 20, 2024

...might be cool to build a github repo full of open source models, kind of like npm or homebrew. They could be served by github pages, or maybe someone will donate CDN space. Could be a fair bit of work to dig up the models and make sure they're in usable formats at consistent scales and with working materials/textures.

What do you think?

from webvr-starter-kit.

sirkitree avatar sirkitree commented on July 20, 2024

I help run http://vrsites.com/ where we do some hosting of models and rooms for http://janusvr.com/. The goal of that site is to help teach people to make JanusVR rooms and provide some basic hosting capabilities. Might be an option to point people to, but I do prefer putting things up on GitHub cuz they're so damned fast.

from webvr-starter-kit.

brianchirls avatar brianchirls commented on July 20, 2024

I'm kind of excited about this idea. I'm gonna run it by some folks at Mozilla Festival this weekend. What if I set up an empty repo with notes and some issues for discussion? Would you be interested in participating at least in some ideas of how to put it together, or possibly contributing code and/or models?

from webvr-starter-kit.

sirkitree avatar sirkitree commented on July 20, 2024

Yes, I certainly would.

from webvr-starter-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.