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

Add support for flipped UV coord generation w/ uv-cube-map-* fns #41

Open
acron0 opened this issue Apr 28, 2016 · 1 comment
Open

Add support for flipped UV coord generation w/ uv-cube-map-* fns #41

acron0 opened this issue Apr 28, 2016 · 1 comment

Comments

@acron0
Copy link

acron0 commented Apr 28, 2016

https://github.com/thi-ng/ws-ldn-8/blob/master/day1/ex03/src/ex03/webgl04.cljs

If you use :flags :nesw (for example) on the aabb, the texture appears to map to the wrong faces. So, 'front' and 'back' are removed but the texture still labels two of the sides 'front' and 'back' rather than 'east' and 'west'. It appears to have something to do with which faces are omitted, because :flags :ewfb works fine.

@postspectacular
Copy link
Member

Hi @acron0 - so I found the problem and it's not a bug in this project, but has to do with the texture setup in our workshop example. We simply need to flip the texture (by setting :flip true here) for correct operation. However, since the cam is located inside the cube, the UV coords need to be manually flipped horizontally (they will only be correct if viewed from outside the cube). I will rename this task to focus on adding an optional arg to the attr/uv-cube-map-* fns to take this use case into account...

@postspectacular postspectacular changed the title When using :flags to cull sides of aabb, texture maps to wrong faces Add support for flipped UV coord generation w/ uv-cube-map-* fns Apr 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants