Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Convert wall textures from 1D to 2D #338

Merged
merged 1 commit into from
Apr 22, 2021
Merged

Conversation

luca-della-vedova
Copy link
Member

New feature implementation

Implemented feature

Walls' textures are now 2D instead of 1D, this allows mapping complex textures to wall and removing the glitches that appeared when some textures (such as tiles) were applied to walls.

Implementation description

To be fully honest I don't understand 100% the obj specification and whether the logic I added for the texture vertices is correct. I tried to follow the same ordering as the polygon vertices and "unwrap" the wall textures manually.

This implementation is only a starting point, followup work should parametrize texture scale for walls, as it happens for floors, as well as adding more wall specific textures. Now we are assuming 2.5m height x 1m width textures.
I split the results in a classic western way.

The good, what would happen if we parametrized the texture height and applied the correct scale to a tiles texture (example taken from airport world):

image

The bad, the state with the current PR, vertical scale is wrong since the texture is 1x1 but we assume 2.5x1:

image

The ugly, what it was before this PR (!)

image

Signed-off-by: Luca Della Vedova <luca@openrobotics.org>
Copy link
Contributor

@codebot codebot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! In the future we can add parameters to diverge from the 2.5m x 1m default scaling, but that's a future expansion.

Does the previous default wall texture still look reasonable with this new code that is doing 2d textures (not just 1d) ?

@luca-della-vedova
Copy link
Member Author

Does the previous default wall texture still look reasonable with this new code that is doing 2d textures (not just 1d) ?

Yap! Office demo walls are unchanged

image

@luca-della-vedova luca-della-vedova merged commit 750edc6 into main Apr 22, 2021
@luca-della-vedova luca-della-vedova deleted the fix/wall_2d_texture branch April 22, 2021 08:53
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants