Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

197
Visualizações
three.js ply loader could not load local assest

i am using three.js to display a .ply model, and i found a modified version of three.js' official example webgl_loader-ply(from https://editor.p5js.org/setapolo/full/7idSig9acP). This modified version load all library and models from remote servers using url, and i can run this file in my browser without problem.

const loader = new PLYLoader();

// 'https://threejs.org/examples/models/ply/ascii/dolphins.ply'   The author uses this url to load model from a remote server
    
loader.load( 'http://127.0.0.1:8080/static/dolphins.ply', function ( geometry ) {  // I replaced his url with mine which is a local server running on my pc

    geometry.computeVertexNormals();

    const material = new THREE.MeshStandardMaterial( { color: 0x0055ff, flatShading: true } );
    const mesh = new THREE.Mesh( geometry, material );

    mesh.position.y = - 0.2;
    mesh.position.z = 0.3;
    mesh.rotation.x = - Math.PI / 2;
    mesh.scale.multiplyScalar( 0.001 );

    mesh.castShadow = true;
    mesh.receiveShadow = true;

    scene.add( mesh );

} );

However, when i tried to replace the model with my own, nothing is displayed. i tried either a local directory path or a url to a local golang static file server, and they all failed. I am pretty sure these two dolphines.ply files are exactly the same.
I've seen some other question, tried to reference mesh.rotate.x or mesh.scale.multiplyscalar and didnot work.

By the way, my .ply model comes with texture, i also want to know how to disply the model's texture, instead of create a pure color texture in the js code. Thank you very much.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda