PrincessGod / objTo3d-tiles

Convert obj model file to 3d tiles
https://princessgod.github.io/objTo3d-tiles
Apache License 2.0
792 stars 236 forks source link

gerented bounding volume(region) has reversed dimension and direction #29

Open CrashedBboy opened 6 years ago

CrashedBboy commented 6 years ago

https://github.com/PrincessGod/objTo3d-tiles/blob/0e0d32fa3a8cca0a07bd782945cc333690f433e8/lib/obj2Tileset.js#L31

the indice of Height and Y are wrong.

Line 31 should be minmaxPoint.max[1] - minmaxPoint.min[1]; Line 35 should be var offsetY = height / 2 + minmaxPoint.min[1]; Line 40, 41 should be minmaxPoint.min[2] and minmaxPoint.max[2]

https://github.com/PrincessGod/objTo3d-tiles/blob/0e0d32fa3a8cca0a07bd782945cc333690f433e8/lib/createSingleTileset.js#L62

Line 62 should be + offsetY / tileHeight * latitudeExtent; Line 64 should be + offsetY / tileHeight * latitudeExtent; (use plus sign instead of minus sign)

petergerten commented 5 years ago

My output seems to be tilted 90 degrees on the roll axis. I tried your patch but it seems it did not make a difference.

hy785737396 commented 3 years ago

it works well, thanks