king2088 / vue-3d-loader

VueJS and threeJS 3d viewer plugin
https://king2088.github.io/vue-3d-loader-docs
MIT License
242 stars 40 forks source link

Does not contains color when load the ply model. #57

Closed oung153 closed 1 year ago

oung153 commented 1 year ago

I load the ply model doesn't contains color. Here is my code

        <vue3dLoader
          height="400"
          :file-type="store.fileType"
          :parallel-load="true"
          :file-path="store.filePaths"
          :scale="{ x: 0.8, y: 0.8, z: 0.8 }"
          :web-g-l-renderer-options="{ preserveDrawingBuffer: true }"
          output-encoding="sRGB"
          backgroundAlpha="0.5"
        />

I also check the documentation and the the example codes.

These are the version of dependencies i used.

{
  "dependencies": {
    "pinia": "^2.0.32",
    "vue": "^3.2.47",
    "vue-3d-loader": "^2.1.6"
  },
  "devDependencies": {
    "@rushstack/eslint-patch": "^1.2.0",
    "@vitejs/plugin-vue": "^4.0.0",
    "@vitejs/plugin-vue-jsx": "^3.0.0",
    "@vue/eslint-config-prettier": "^7.1.0",
    "@vue/test-utils": "^2.3.0",
    "autoprefixer": "^10.4.14",
    "eslint": "^8.34.0",
    "eslint-plugin-vue": "^9.9.0",
    "jsdom": "^21.1.0",
    "postcss": "^8.4.23",
    "prettier": "^2.8.4",
    "tailwindcss": "^3.3.1",
    "vite": "^4.1.4",
    "vitest": "^0.29.1"
  }
}

This is the model which does not load color.

facebook

I think that might missing some jpg file. But it contains color when view with https://imagetostl.com/view-ply-online. facebook

oung153 commented 1 year ago

I also found three.js ply colorless from stack overflow solve it by using MeshBasicMaterial, and the source code does not import MeshBasicMaterial at all. I hope this can be a little help.

oung153 commented 1 year ago

I'm sorry, because that is private file.

king2088 commented 1 year ago

I'm sorry, because that is private file.

OK

king2088 commented 1 year ago

I can't find a ply model file contains colors on the internet. If you can find it, you can send it to me.

oung153 commented 1 year ago

I got it. I will send pull request when I finish sir.

oung153 commented 1 year ago

Since ply model contains vertex, we need to use MeshBasicMaterial with vertexColor: true.

king2088 commented 1 year ago

Thanks. You can use new version , if vue2 use 1.2.16 , if vue3 use 2.1.7. I add a api plyMaterial.