Giter Site home page Giter Site logo

playcanvas / model-viewer Goto Github PK

View Code? Open in Web Editor NEW
362.0 362.0 51.0 161.52 MB

3D model viewer supporting glTF 2.0 and PLY (3d Gaussian Splats)

Home Page: https://playcanvas.com/viewer

License: MIT License

JavaScript 2.19% CSS 0.34% TypeScript 89.49% Mustache 1.36% SCSS 6.61%
3d-gaussian-splatting gaussian-splatting gltf javascript pcui playcanvas typescript webgl

model-viewer's People

Contributors

andreivreja avatar ellthompson avatar epreston avatar gsterbrant avatar imgbot[bot] avatar kpal81xd avatar kungfooman avatar mvaligursky avatar slimbuck avatar vkalpias avatar willeastcott avatar yak32 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

model-viewer's Issues

Cloning animated models doesn't work

I tried it very simply with:

clone = viewer.entities[0].clone()
viewer.app.root.addChild(clone)
clone.translate(1, 0, 0)
clone.anim.playing

Anything I'm doing wrong? The second model is just not animated, even though all properties seem right.

image

Add initial call to action

When a new user opens the viewer, it's not obvious what they should do (i.e. drag and drop files into the 3D view). We should add a CTA/hint for the end user.

Add manifest.json

A manifest.json file will enable the website to be added to the home screen as a webapp on phones, enabling a fullscreen interface.

eg:
{ "name": "Playcanvas Viewer", "short_name": "Viewer", "start_url": ".", "scope": ".", "display": "standalone", "icons": [ { "src": "./static/playcanvas-logo.png", "type": "image/png", "sizes": "64x64" } ] }

Browse model hierarchy

It would be great if it was possible to browse the model hierarchy directly in the viewer.

Ideally we could see:

  • the node hierarchy including name, position, rotation, scale
  • mesh details including #vert, #primitives
  • material details including basic settings and textures
  • texture details possibly with preview
  • animation details
  • etc

Large hierarchy UI issue

When the list of scene nodes is large, the node info box scrolls off screen. Ideally the node information box would always be visible.

Screenshot 2021-03-31 at 15 40 29

The viewer linked to glTF Asset Generator is out of date

It may already be scheduled to be fixed, but I'll report back Issue just in case.

The old playcanvas-gltf viewer is referenced by the Khronos glTF Asset Generator.
https://github.com/KhronosGroup/glTF-Asset-Generator

Perhaps modifying the following configuration file will refer to the new viewer.
https://github.com/bghgary/glTF-Assets-Viewer/blob/master/engines.json

"PlayCanvas": {
    "templateUrl": "https://playcanvas.github.io/playcanvas-gltf/viewer/index.html?assetUrl=${assetUrl}&cameraPosition=${-cameraPosition.x},${cameraPosition.y},${cameraPosition.z}"
},

Remove debug graph

The graph visualisation option is really a debug feature that's probably confusing to users, not useful.

Style side panel scroll bar

The side bar currently shows an OS scroll bar:

image

It would be good to bring this in line with the Editor's styled scroll bars:

image

Missing deps: bfj and ejs-webpack-loader

I had to install bfj and ejs-webpack-loader manually, otherwise I would run into these two errors:

image

image

I don't know why others don't seem to have an issue with this, but maybe add it to package.json?

Show loading indicator

It would be nice to have a visual indication when the viewer is busy loading/downloading content.

Add an upload button for files and background

Currently the viewer is unusable on phones as the only option to open files is via drag and drop which is not possible on mobile devices. An upload button would be really helpful for mobile users as the rest of the UI already does work perfectly on phones.

Animation with STEP interpolation on scale not displayed

SuzanneSequence.glb.zip

This example should step through a sequence of 5 meshes, displaying each at scale 1,1,1 for 1/2 second before hiding it with scale 0,0,0 and displaying the next mesh. The example is simple (modeled in Blender, animated with glTF-Transform) but would be similar to more complex animation from programs like Quill.

The model doesn't seem to animate in the PlayCanvas viewer currently. The result should be:

BBC4AED3-21F3-4244-933C-2ECBBFA2B744-2877-000119D9A79ADF7C

Aside, but minor โ€” the model doesn't include normals, and so should be displayed with flat normals rather than smooth ideally.

Build scripts do not work on Windows

package.json has:

    "watch": "node_modules/.bin/webpack --config webpack.config.js --watch",
    "build:local": "ENVIRONMENT=production node_modules/.bin/webpack --config webpack.config.js",
    "build:server": "ENVIRONMENT=production PUBLIC_PATH=/viewer/ node_modules/.bin/webpack --config webpack.config.js"

This doesn't work on Windows.

First thing to say is that you don't need to specify the path to webpack. So you can do:

    "watch": "webpack --config webpack.config.js --watch",
    "build:local": "ENVIRONMENT=production webpack --config webpack.config.js",
    "build:server": "ENVIRONMENT=production PUBLIC_PATH=/viewer/ webpack --config webpack.config.js"

(see https://github.com/playcanvas/playcanvas-webpack/blob/master/package.json)

But Windows doesn't like how environment variables are being set here. We need a cross platform approach for controlling the build.

Allow pain-free viewer/engine local dev

It is a pain using the viewer with a local build of the engine, especially since loosing use_local_engine.

Using the viewer with local engine currently requires the following:

  • create symlink in playcanvas_viewer to ../engine/build/playcanvas.js and ../engine/build/playcanvas-extras.js
  • replace import blah from 'playcanvas' to import blah from 'playcanvas.js' in viewer.js, controls.js and index.js

This is a huge pain and we need a solution ideally integrated with webpack.

How to load multi file assets?

I am not sure how the API is supposed to work:

viewer.load([
"http://127.0.0.1/libwebgame_assets/gltf/AppleTree/AppleTree.gltf",
"http://127.0.0.1/libwebgame_assets/gltf/AppleTree/AppleTree.bin"
]);

The AppleTree got these files:

image

Result:

playcanvas.js:24239 failed to load uri=AppleTree.bin

image

Material debugging

It would be great if we had the ability to debug materials in the viewer:

  • display normal, roughness, albedo maps etc
  • display various lighting
  • display texture basis

License of src/lib/pcui.js

Is this file MIT licensed? It is here, but minified/uglified only.

It would be nice if it could be beautified, so people who may want to extend the viewer know what they are dealing with

Issue with morph target animation

When I use the attached glb file with the view
blendshapes_trial.zip

This is the console output in my local viewer set up
Screen Shot 2021-03-29 at 2 10 13 PM

When I tried it in the prod build, I don't see the errors, but there is an issue with the morph playback compared to what's expected / other viewers display. The white sphere with the red inside bas two meshes (two materials), but only the white part morphs, not the red one. Perhaps animation does not resolve paths to both?

This is possibly multiple issues in this ticket, and as we confirm issues, we should separate them to their own issues, but at the moment it's not clear what the root cause here is.

GLB loading gets progressively slower

Keep drag & dropping larger GLB files onto the viewer, they load slower each time. After maybe 20 drops, the load times goes up from 1 to maybe 5 seconds.

Attaching two glb files I used for testing. I tried others as well, and they all behave the same.
glbs.zip

Remove shiny ball

The shiny ball option is not particularly userful to end users (and can even be confusing).

Smooth camera rotation with damping

At the moment the camera seems to rotate the scene in direct response to the mouse events, making its rotation not very smooth and polished. This should be implemented.

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.