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

126
Views
How to Align Meshes to the left and make it responsive three.js

I'm trying to make a website with three.js, the problem is that I don't know how to align and being responsive the mesh at the same time, I align the mesh like this.

cube.position.x = -20

But when I resize the window it doesn't move. How can I make it responsive and align it the the left?

here is my code

const geometry = new THREE.BoxGeometry( 29, 20, 3  )
const material = new THREE.MeshBasicMaterial( { map: cubetexture } );
const cube = new THREE.Mesh( geometry, material );
cube.position.x = -20
scene.add(cube)

var clock = new THREE.Clock();

function animate() {
  requestAnimationFrame( animate );
  const time = clock.getElapsedTime();

  cube.position.y = Math.cos( time ) * 2;
  cube.rotateY(Math.cos( time ) * 0.002)
  renderer.render( scene, camera );
}

animate()

thank you in advance:)

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!