Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

tile_skybox_img in skyboxengine.py #9

Closed
yggs1401 opened this issue Nov 9, 2020 · 4 comments
Closed

tile_skybox_img in skyboxengine.py #9

yggs1401 opened this issue Nov 9, 2020 · 4 comments

Comments

@yggs1401
Copy link

yggs1401 commented Nov 9, 2020

Hello!

First of all, great work!
I was wondering if you can explain a little bit the meaning of concat for imgtile and how it works.

Thank you!

@jiupinjia
Copy link
Owner

Hi yggs1401, thanks for your good question. The concat for imgtile is a small trick for building skybox image. In theory, a skybox should have no boundaries. When building a skybox using a single background sky image, say, the "./skybox/jupiter.jpg", we need to relocate the center of the camera-view to the top-left corner of the background image. This is because, when we are performing the affine transform, the origin of the transformation is at the upper left corner of the image. We need to make such an alignment. If you show the background image after the tile, it would be like the following.
This operation may look a little bit tricky but it does simply the warping a lot. Hope the above explanation will address your concern.

WeChat Screenshot_20201119141224

@yggs1401
Copy link
Author

yggs1401 commented Nov 19, 2020

Thank you for your answer! The origin of the affine transformation is always on the top left corner? Another question is, we apply the transformation matrix on all pixels or just on the origin?

Thank you!

@jiupinjia
Copy link
Owner

Thank you for your answer! The origin of the affine transformation is always on the top left corner? Another question is, we apply the transformation matrix on all pixels or just on the origin?

Thank you!

Yes, the origin of an affine transform should be always in the top left corner. Let's say if you want to rotate an image for a certain degree. If you simply apply a rotation matrix to the image data, the rotation would be performed based on the upper left corner of the image, rather than the image center.
The second question. We apply the transform to all pixels.

@yggs1401
Copy link
Author

Thank you! Kind regards and stay safe!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants