Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

190
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!