How do I set the object scale value(width and height) based on the pixel value using three.js?
object.scale.set(0.05,0.05,0.05);
I need to set 0.05 value pixel size
How do I set the object scale value(width and height) based on the pixel value using three.js?
object.scale.set(0.05,0.05,0.05);
I need to set 0.05 value pixel size
Rephrasing your question, please correct me if I got you wrong:
You want to use pixel values instead of the relative values to set the size of your object as it appears on screen.
Now, the problem here is, that three.js (or even webgl) don't really use a concept of pixels internally.
How large (in pixels) an object appears on the screen depends on a lot of factors:
So pixels will simply lose any meaning when it comes to 3D-graphics. There's nothing keeping you from using any unit you want for sizes and positions, but that doesn't make it have any relation to pixels on screen.
You will also want to check out this answer: THREE.JS: Get object size with respect to camera and object position on screen