Import a Collada model doesn't align to pixels
Posted
by
Dan Friedman
on Stack Overflow
See other posts from Stack Overflow
or by Dan Friedman
Published on 2012-09-23T08:29:40Z
Indexed on
2012/09/23
9:37 UTC
Read the original article
Hit count: 305
three.js
Assume I have a model that is simply a cube. (It is more complicated than a cube, but for the purposes of this discussion, we will simplify.)
So when I am in Sketchup, the cube is Xmm by Xmm by Xmm, where X is an integer. I then export the a Collada file and subsequently load that into threejs.
Now if I look at the geometry bounding box, the values are floats, not integers.
So now assume I am putting cubes next to each other with a small space in between say 1 pixel. Because screens can't draw half pixels, sometimes I see one pixel and sometimes I see two, which causes a lack of uniformity.
I think I can resolve this satisfactorily if I can somehow get the imported model to have integer dimensions. I have full access to all parts of the model starting with Sketchup, so any point in the process is fair game.
Is it possible?
Thanks.
© Stack Overflow or respective owner