eventhorizon5 / skyscraper

The Skyscraper Project (Skyscrapersim) - an open source building, city, and elevator simulator
https://www.skyscrapersim.net
GNU General Public License v2.0
28 stars 7 forks source link

Minor texture mapping issue #38

Closed eventhorizon5 closed 1 year ago

eventhorizon5 commented 1 year ago

There's a minor texture mapping issue involving small polygons apparently aiming to the left or right, not front or back. I've attached the test case/reproduction.

So far I don't know if the planar mapper is having any issues (it seems fine so far), or if the texture computations are having issues. My tests showed that this bug was introduced in the Ogre versions, so Alpha 8 and greater are all affected. All CS versions work fine.

When running the test case, there should be a small arrow to the right of the elevator doors, in this, it's a badly-tiled arrow texture. If the indicator is enlarged a little, the texture appears fine, or if the indicator is oriented to the front or back, it also works fine.

testcase.zip

eventhorizon5 commented 1 year ago

This has been fixed, and was related to a bad matrix inversion being used. I switched the code to use the standard matrix inversion with a higher precision tolerance.