mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
101.6k stars 35.29k forks source link

Scaling PlaneGeometry starts from the center not left #12394

Closed danrossi closed 6 years ago

danrossi commented 6 years ago

Hi I'm sorry if this turns into a question not a possible bug. I am trying to scale a PlaneGeometry bar to act as a progress bar slider. I've not seen any demos of this before. Even datGui use canvas.

When I try to scale the front bar over the background bar. it starts from the middle. I can't work out why I have to use fraction scaling values , but as you can see from this fiddle it it scales from the centre not left.

You might have to move the camera around.

Any ideas ?

https://jsfiddle.net/19u6th3n/4/

looeee commented 6 years ago

@danrossi feel free to ask this over on https://discourse.threejs.org/

But just FYI, this is probably going to be one of the harder ways to create a loading bar.