Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

158
Vistas
Three.js Update an object's position relative to another object's scale

I dont know who needs to see this, just wanted to share a solution for a problem I encountered recently. I hope it helps someone.

Lets say you have an object House and inside that House you have another object Chair in a very specific spot. you scale the House's Size by 2, making it bigger. The Chair then is not at the same spot inside the House because the House's size is different. you need to move the chair to that very specific spot without doing it manually.

EDIT Moved the solution to an answer

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

this is the formula you would use: ( (Chair.position * House.scaleFactor) - (House.position * (House.scaleFactor - 1)) )

In Threejs code it would look something like this:

const scaleFactor = 2;
house.scale.setScalar(scaleFactor);
chair.position.set(
                    (chair.position.x * scaleFactor) - (house.position.x * (scaleFactor - 1)),
                    (chair.position.y * scaleFactor) - (house.position.y * (scaleFactor - 1)),
                    (chair.position.z * scaleFactor) - (house.position.z * (scaleFactor - 1))
                );
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda