Hi
I was looking for information on how to implement a scale bar like this in three js like this one:
Or something more simple like this :
https://fervent-snyder-c66537.netlify.app/
I found this post three.js - How can I draw a scale meter? - Stack Overflow
And I’m try it with this code :
const distance = this.camera.position.distanceTo(this.controls.target)
const normalizedDistance =
distance / (this.controls.maxDistance - this.controls.minDistance)
console.log(normalizedDistance)
fieldNameElement.innerText = 'Scale : ’ + normalizedDistance.toFixed(2).toString()
But I’m not sure that fragment represents what I’m looking for.
Anyway, Does anyone have any ideas on how to get started, is there an example or something I can use as a starting point?
thanks