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

309
Views
Passing paramiter values to three.js via vars (or php echo) causes undesired results

When I pass the values to three.js like so..

const paintgeom = new THREE.CylinderGeometry(2.5, 1.5, 3.3, 240, 1, true);

The result looks like this (all is as expected)..

enter image description here

However if i pass the same as a var like so..

var trad = '2.5';
const paintgeom = new THREE.CylinderGeometry(trad, 1.5, 3.3, 240, 1, true);

I get very weird 'pinch' or 'hourglass' type results like this..

enter image description here

I have also tried passing the params as a php echo but get the same odd result? How can I pass these numbers to the script and not have to hard code them in please?

I have also put the complete code on JSFiddle https://jsfiddle.net/StickerMonkey/ov12fh3s/53/

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!