Giter Site home page Giter Site logo

Comments (10)

slimbuck avatar slimbuck commented on May 20, 2024 1

Hi @kungfooman,

The next release of the viewer is a big change which includes the ability to load a gltf using its URL alone. The basePath is derived from the URL though, it can't be specified.

Hope this helps!

from model-viewer.

willeastcott avatar willeastcott commented on May 20, 2024 1

I think this is now supported, right? So we can close this?

from model-viewer.

willeastcott avatar willeastcott commented on May 20, 2024 1

Ah ok, so you've exposed the variable yourself. I also see the problem now:

image

Looks like dependencies aren't loaded for unpacked glTF scenes still. I think it's best to wait for @slimbuck to comment.

from model-viewer.

slimbuck avatar slimbuck commented on May 20, 2024 1

Hi @kungfooman, @willeastcott,

This will work correctly once the next version of engine has been released, as it requires playcanvas/engine#2312.

Thanks!

from model-viewer.

slimbuck avatar slimbuck commented on May 20, 2024

Hi @kungfooman ,

Try specifying the files as objects with url and filename properties. The filename is used to match internal references. Check out the drop handler.

Hope that helps!

from model-viewer.

kungfooman avatar kungfooman commented on May 20, 2024

Hi @slimbuck, thanks for the info!

Got it working like this now:

viewer.load([{
    url: "http://127.0.0.1/libwebgame_assets/gltf/AppleTree/AppleTree.gltf",
    filename: "AppleTree.gltf"
}, {
    url: "http://127.0.0.1/libwebgame_assets/gltf/AppleTree/AppleTree.bin",
    filename: "AppleTree.bin",
}, {
    url: "http://127.0.0.1/libwebgame_assets/gltf/AppleTree/AppleTree_baseColor.png",
    filename: "AppleTree_baseColor.png",
}, {
    url: "http://127.0.0.1/libwebgame_assets/gltf/AppleTree/AppleTree_roughnessMetallic.png",
    filename: "AppleTree_roughnessMetallic.png",
}, {
    url: "http://127.0.0.1/libwebgame_assets/gltf/AppleTree/AppleTree_normal.png",
    filename: "AppleTree_normal.png",
}, {
    url: "http://127.0.0.1/libwebgame_assets/gltf/AppleTree/AppleTree_baseColor1.png",
    filename: "AppleTree_baseColor1.png",
}, {
    url: "http://127.0.0.1/libwebgame_assets/gltf/AppleTree/AppleTree_roughnessMetallic1.png",
    filename: "AppleTree_roughnessMetallic1.png",
}, {
    url: "http://127.0.0.1/libwebgame_assets/gltf/AppleTree/AppleTree_normal1.png",
    filename: "AppleTree_normal1.png",
}, {
    url: "http://127.0.0.1/libwebgame_assets/gltf/AppleTree/AppleTree_baseColor2.png",
    filename: "AppleTree_baseColor2.png",
}, {
    url: "http://127.0.0.1/libwebgame_assets/gltf/AppleTree/AppleTree_roughnessMetallic2.png",
    filename: "AppleTree_roughnessMetallic2.png",
}, {
    url: "http://127.0.0.1/libwebgame_assets/gltf/AppleTree/AppleTree_normal2.png",
    filename: "AppleTree_normal2.png",
}]);

Isn't it a bit strange that people have to reference every single file? In playcanvas-gltf people only have to define basePath (which even can be derived from a single URL in lots of cases)

from model-viewer.

kungfooman avatar kungfooman commented on May 20, 2024

Just built HEAD and it doesn't work with Viewer#load at least:

image

from model-viewer.

willeastcott avatar willeastcott commented on May 20, 2024

How are you even able to see viewer using the latest codebase?

image

Now that the viewer is built with Webpack, that variable is not visible from the JS console.

from model-viewer.

kungfooman avatar kungfooman commented on May 20, 2024
window.pc = pc;

function startViewer() {
    var viewer = new Viewer(document.getElementById("application-canvas"), onSceneReset, onAnimationsLoaded, onMorphTargetsLoaded);
    registerElementEvents(viewer);
    window.viewer = viewer;
}

from model-viewer.

slimbuck avatar slimbuck commented on May 20, 2024

https://github.com/playcanvas/engine/releases/tag/v1.32.3

This should now be fixed! (Please reopen if you any further issues).

from model-viewer.

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.