Comments (10)
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.
I think this is now supported, right? So we can close this?
from model-viewer.
Ah ok, so you've exposed the variable yourself. I also see the problem now:
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.
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.
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.
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.
Just built HEAD and it doesn't work with Viewer#load
at least:
from model-viewer.
How are you even able to see viewer
using the latest codebase?
Now that the viewer is built with Webpack, that variable is not visible from the JS console.
from model-viewer.
window.pc = pc;
function startViewer() {
var viewer = new Viewer(document.getElementById("application-canvas"), onSceneReset, onAnimationsLoaded, onMorphTargetsLoaded);
registerElementEvents(viewer);
window.viewer = viewer;
}
from model-viewer.
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)
- Load error message looks wrong HOT 1
- Hierarchy does not display nodes when loading multiple models HOT 1
- Rendering issue with car on iOS 15.4 where it doesn't update when camera is moving HOT 7
- Blockiness rendering across gradients on Windows 11 laptop HOT 2
- New camera is wobbling strangely to front/back on panning HOT 4
- Ministats renders incorrectly HOT 1
- UI todo
- Improve Ui performance when loading models with many morph targets
- Camera popup panel doesn't work when playing animations
- Just want to ask a few simple questions? HOT 1
- Expose debug rendering functionality HOT 2
- Sharing glb seems to be broken
- Place the object in front of the camera in XR mode (Android)
- Build: shader compile error when updating dependencies HOT 9
- npm run serve and 404 HOT 2
- Selected nodes improvements
- Nonsense controls HOT 1
- Sharing of local pls files does not work HOT 1
- How to get the progress when loading a gltf file from Url? HOT 1
- Animation scrubber bar does not appear on smaller screensizes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from model-viewer.